Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions autoload/ledger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,12 @@ endf
function! ledger#autocomplete_and_align()
if pumvisible()
return "\<c-n>"
" See http://stackoverflow.com/questions/23323747/vim-vimscript-get-exact-character-under-the-cursor
elseif matchstr(getline('.'), '\%' . (col('.')-1) . 'c.') =~ '\d'
endif
" Align an amount only if there is a digit immediately before the cursor and
" such digit is preceded by at least one space (the latter condition is
" necessary to avoid situations where a date starting at the first column is
" confused with a commodity to be aligned).
if match(getline('.'), '\s.*\d\%'.col('.').'c') > -1
norm h
call ledger#align_amount_at_cursor()
return "\<c-o>A"
Expand Down