From 58fcb0f30f850f1e3140b42419c280a5dd731e30 Mon Sep 17 00:00:00 2001 From: Johann Klähn Date: Wed, 8 Sep 2010 22:31:42 +0200 Subject: vim. make sure cursor/line is on a transaction Thanks to Chad Voegele for reporting and fixing this in the first place. --- contrib/vim/ftplugin/ledger.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'contrib/vim/ftplugin/ledger.vim') diff --git a/contrib/vim/ftplugin/ledger.vim b/contrib/vim/ftplugin/ledger.vim index 6719529f..1cced35c 100644 --- a/contrib/vim/ftplugin/ledger.vim +++ b/contrib/vim/ftplugin/ledger.vim @@ -471,6 +471,11 @@ function! s:get_transactions(...) "{{{2 endf "}}} function! s:get_transaction_extents(lnum) "{{{2 + if ! (indent(a:lnum) || getline(a:lnum) =~ '^[~[:digit:]]\S\+') + " only do something if lnum is in a transaction + return [0, 0] + endif + " safe view / position let view = winsaveview() let fe = &foldenable -- cgit v1.2.3