From 1d773b0dfe1d98df30a4d2a077c5cdcf4413db96 Mon Sep 17 00:00:00 2001 From: bootleq Date: Wed, 10 Apr 2013 14:03:25 +0800 Subject: [PATCH] Fix incorrect setbufvar with invalid bufname expr. When bufname contains |file-pattern|, setbufvar() might raise E16 Invalid Range error. Use setbufvar("", ...) instead of setbufvar(bufname_string, ...). --- autoload/EasyMotion.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index 7c79dd8..f38bf95 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -118,19 +118,17 @@ let s:var_reset = {} endif - let buf = bufname("") - if a:0 == 0 && has_key(s:var_reset, a:var) " Reset var to original value - call setbufvar(buf, a:var, s:var_reset[a:var]) + call setbufvar("", a:var, s:var_reset[a:var]) elseif a:0 == 1 let new_value = a:0 == 1 ? a:1 : '' " Store original value - let s:var_reset[a:var] = getbufvar(buf, a:var) + let s:var_reset[a:var] = getbufvar("", a:var) " Set new var value - call setbufvar(buf, a:var, new_value) + call setbufvar("", a:var, new_value) endif endfunction " }}} function! s:SetLines(lines, key) " {{{