Skip to content

Commit 38d7a03

Browse files
committed
compatibility fix for look-behind limit
1 parent 8741526 commit 38d7a03

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

syntax/ledger.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ endif
1313

1414
" Force old regex engine (:help two-engines)
1515
let s:oe = v:version < 704 ? '' : '\%#=1'
16+
let s:lb1 = v:version < 704 ? '\@<=' : '\@1<='
1617

1718
" for debugging
1819
syntax clear
@@ -30,9 +31,9 @@ syn match ledgerPosting /^\s\+[^[:blank:];][^;]*\ze\%($\|;\)/
3031
" every space in an account name shall be surrounded by two non-spaces
3132
" every account name ends with a tab, two spaces or the end of the line
3233
exe 'syn match ledgerAccount '.
33-
\ '/'.s:oe.'^\s\+\zs\%(\S\@1<= \S\|\S\)\+\ze\%( \|\t\|\s*$\)/ contained'
34+
\ '/'.s:oe.'^\s\+\zs\%(\S'.s:lb1.' \S\|\S\)\+\ze\%( \|\t\|\s*$\)/ contained'
3435
exe 'syn match ledgerAmount '.
35-
\ '/'.s:oe.'\S\@1<=\%( \|\t\)\s*\zs\%([^;[:space:]]\|\s\+[^;[:space:]]\)\+/ contained'
36+
\ '/'.s:oe.'\S'.s:lb1.'\%( \|\t\)\s*\zs\%([^;[:space:]]\|\s\+[^;[:space:]]\)\+/ contained'
3637

3738
syn region ledgerPreDeclaration start=/^\(account\|payee\|commodity\|tag\)/ skip=/^\s/ end=/^/
3839
\ keepend transparent

0 commit comments

Comments
 (0)