vim. fix for accounts with spaces
This commit is contained in:
parent
3b1898f3e8
commit
4156a0488c
1 changed files with 6 additions and 6 deletions
|
|
@ -55,7 +55,7 @@ function! LedgerFoldText() "{{{1
|
||||||
let line = getline(lnum)
|
let line = getline(lnum)
|
||||||
|
|
||||||
" Skip metadata/leading comment
|
" Skip metadata/leading comment
|
||||||
if line !~ '^\s\+;'
|
if line !~ '^\%(\s\+;\|\d\)'
|
||||||
" No comment, look for amount...
|
" No comment, look for amount...
|
||||||
let groups = matchlist(line, s:rx_amount)
|
let groups = matchlist(line, s:rx_amount)
|
||||||
if ! empty(groups)
|
if ! empty(groups)
|
||||||
|
|
@ -111,11 +111,11 @@ function! LedgerComplete(findstart, base)
|
||||||
return -1
|
return -1
|
||||||
elseif line =~ '^\s\+'
|
elseif line =~ '^\s\+'
|
||||||
let b:compl_context = 'account'
|
let b:compl_context = 'account'
|
||||||
let firstcol = lastcol
|
if matchend(line, '^\s\+\%(\S \S\|\S\)\+') <= lastcol
|
||||||
while firstcol >= 0 && (matchend(line, '^\%(\S\|\S \S\)\+', (firstcol - 1))-1) == lastcol
|
" only allow completion when in or at end of account name
|
||||||
let firstcol -= 1
|
return -1
|
||||||
endwhile
|
endif
|
||||||
return firstcol
|
return matchend(line, '^\s\+')
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue