Skip to content

Commit dbc683e

Browse files
authored
Align currency with no decimal point correctly (#160)
1 parent 7b97c87 commit dbc683e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autoload/ledger.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ function! ledger#align_commodity() abort
510510
endif
511511
if pos < 0
512512
" Find the position after the first digits
513-
let pos = matchend(rhs, '\m\d[^[:space:]]*')
513+
let pos = matchend(rhs, '\m\d[^[:space:]]*') - 1
514+
if pos >= 0
515+
let pos = strchars(rhs[:pos])
516+
endif
514517
endif
515518
" Go to the column that allows us to align the decimal separator at g:ledger_align_at:
516519
if pos >= 0

0 commit comments

Comments
 (0)