Skip to content

Commit 0ebef8f

Browse files
committed
use "normal!"
1 parent a12c410 commit 0ebef8f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

autoload/ledger.vim

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ endf
334334

335335
" Move the cursor to the specified column, filling the line with spaces if necessary.
336336
function! s:goto_col(pos)
337-
exec "normal" a:pos . "|"
337+
exec "normal!" a:pos . "|"
338338
let diff = a:pos - virtcol('.')
339-
if diff > 0 | exec "normal" diff . "a " | endif
339+
if diff > 0 | exec "normal!" diff . "a " | endif
340340
endf
341341

342342
" Align the amount expression after an account name at the decimal point.
@@ -373,32 +373,32 @@ function! ledger#align_commodity()
373373
" Go to the column that allows us to align the decimal separator at g:ledger_align_at:
374374
call s:goto_col(g:ledger_align_at - pos - 1)
375375
" Append the part of the line that was previously removed:
376-
exe 'normal a' . rhs
376+
exe 'normal! a' . rhs
377377
endif
378378
endf!
379379

380380
" Align the amount under the cursor and append/prepend the default currency.
381381
function! ledger#align_amount_at_cursor()
382382
" Select and cut text:
383-
normal viWd
383+
normal! viWd
384384
" Find the position of the decimal separator
385385
let pos = match(@", g:ledger_decimal_sep) " Returns zero when the separator is the empty string
386386
" Paste text at the correct column and append/prepend default commodity:
387387
if g:ledger_commodity_before
388388
call s:goto_col(g:ledger_align_at - (pos > 0 ? pos : len(@")) - len(g:ledger_default_commodity) - len(g:ledger_commodity_sep) - 1)
389-
exe 'normal a' . g:ledger_default_commodity . g:ledger_commodity_sep
390-
normal p
389+
exe 'normal! a' . g:ledger_default_commodity . g:ledger_commodity_sep
390+
normal! p
391391
else
392392
call s:goto_col(g:ledger_align_at - (pos > 0 ? pos : len(@")) - 1)
393-
exe 'normal pa' . g:ledger_commodity_sep . g:ledger_default_commodity
393+
exe 'normal! pa' . g:ledger_commodity_sep . g:ledger_default_commodity
394394
endif
395395
endf!
396396

397397
func! ledger#entry()
398398
" enter a new transaction based on the text in the current line.
399399
let l = line('.') - 1 " Insert transaction at the current line (i.e., below the line above the current one)
400400
let query = getline('.')
401-
normal "_dd
401+
normal! "_dd
402402
exec l . 'read !' g:ledger_bin '-f' shellescape(expand(g:ledger_main)) 'entry' shellescape(query)
403403
endfunc
404404

0 commit comments

Comments
 (0)