|
334 | 334 |
|
335 | 335 | " Move the cursor to the specified column, filling the line with spaces if necessary.
|
336 | 336 | function! s:goto_col(pos)
|
337 |
| - exec "normal" a:pos . "|" |
| 337 | + exec "normal!" a:pos . "|" |
338 | 338 | let diff = a:pos - virtcol('.')
|
339 |
| - if diff > 0 | exec "normal" diff . "a " | endif |
| 339 | + if diff > 0 | exec "normal!" diff . "a " | endif |
340 | 340 | endf
|
341 | 341 |
|
342 | 342 | " Align the amount expression after an account name at the decimal point.
|
@@ -373,32 +373,32 @@ function! ledger#align_commodity()
|
373 | 373 | " Go to the column that allows us to align the decimal separator at g:ledger_align_at:
|
374 | 374 | call s:goto_col(g:ledger_align_at - pos - 1)
|
375 | 375 | " Append the part of the line that was previously removed:
|
376 |
| - exe 'normal a' . rhs |
| 376 | + exe 'normal! a' . rhs |
377 | 377 | endif
|
378 | 378 | endf!
|
379 | 379 |
|
380 | 380 | " Align the amount under the cursor and append/prepend the default currency.
|
381 | 381 | function! ledger#align_amount_at_cursor()
|
382 | 382 | " Select and cut text:
|
383 |
| - normal viWd |
| 383 | + normal! viWd |
384 | 384 | " Find the position of the decimal separator
|
385 | 385 | let pos = match(@", g:ledger_decimal_sep) " Returns zero when the separator is the empty string
|
386 | 386 | " Paste text at the correct column and append/prepend default commodity:
|
387 | 387 | if g:ledger_commodity_before
|
388 | 388 | 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 |
391 | 391 | else
|
392 | 392 | 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 |
394 | 394 | endif
|
395 | 395 | endf!
|
396 | 396 |
|
397 | 397 | func! ledger#entry()
|
398 | 398 | " enter a new transaction based on the text in the current line.
|
399 | 399 | let l = line('.') - 1 " Insert transaction at the current line (i.e., below the line above the current one)
|
400 | 400 | let query = getline('.')
|
401 |
| - normal "_dd |
| 401 | + normal! "_dd |
402 | 402 | exec l . 'read !' g:ledger_bin '-f' shellescape(expand(g:ledger_main)) 'entry' shellescape(query)
|
403 | 403 | endfunc
|
404 | 404 |
|
|
0 commit comments