From 94b2db2de6fb3f4d72cca3b506ad6074fbafc63b Mon Sep 17 00:00:00 2001 From: Chris Perl Date: Sat, 17 Mar 2012 09:35:16 -0400 Subject: [PATCH] Replace virtcol() with len() in handleLeftClick(). When 'virtualedit' is set, the column where the cursor resides can no longer be relied on for determining the number of elements in the 'line' list for iterating. Replacing virtcol() with len() seems to work correctly and not result in E684 errors. Fixes Issue #144 --- plugin/NERD_tree.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 3ec87a0..a2e88ea 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -4106,7 +4106,7 @@ function! s:handleLeftClick() "take the line substring manually let line = split(getline(line(".")), '\zs') let startToCur = "" - for i in range(0,virtcol(".")-1) + for i in range(0,len(line)-1) let startToCur .= line[i] endfor