File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -341,9 +341,9 @@ function! s:goto_col(pos, min_spaces)
341
341
if diff > 0 | exec " normal!" diff . " a " | endif
342
342
endf
343
343
344
- " Return substring position (in chars).
345
- function ! s: strpos (expr , pat )
346
- let pos = match (a: expr , a: pat )
344
+ " Return character position of decimal separator (multibyte safe)
345
+ function ! s: decimalpos (expr )
346
+ let pos = match (a: expr , ' \V ' . g: ledger_decimal_sep )
347
347
if pos > 0
348
348
let pos = strchars (a: expr [:pos]) - 1
349
349
endif
@@ -378,7 +378,7 @@ function! ledger#align_commodity()
378
378
let pos = -1
379
379
if g: ledger_decimal_sep != ' '
380
380
" Find the position of the first decimal separator:
381
- let pos = s: strpos (rhs, ' \V ' . g: ledger_decimal_sep )
381
+ let pos = s: decimalpos (rhs)
382
382
endif
383
383
if pos < 0
384
384
" Find the position after the first digits
@@ -399,7 +399,7 @@ function! ledger#align_amount_at_cursor()
399
399
" Select and cut text:
400
400
normal ! viWd
401
401
" Find the position of the decimal separator
402
- let pos = s: strpos (@" , ' \V ' . g: ledger_decimal_sep ) " Returns zero when the separator is the empty string
402
+ let pos = s: decimalpos (@" ) " Returns zero when the separator is the empty string
403
403
if pos <= 0
404
404
let pos = len (@" )
405
405
endif
You can’t perform that action at this time.
0 commit comments