diff --git a/autoload/EasyMotion.vim b/autoload/EasyMotion.vim index aaeb60c..b0502ac 100644 --- a/autoload/EasyMotion.vim +++ b/autoload/EasyMotion.vim @@ -3,7 +3,7 @@ " Author: Kim Silkebækken " haya14busa " Source: https://github.com/Lokaltog/vim-easymotion -" Last Change: 03 Mar 2014. +" Last Change: 17 Mar 2014. "============================================================================= " Saving 'cpoptions' {{{ scriptencoding utf-8 @@ -349,7 +349,9 @@ function! s:SaveValue() "{{{ call EasyMotion#helper#VarReset('&readonly', 0) call EasyMotion#helper#VarReset('&spell', 0) call EasyMotion#helper#VarReset('&virtualedit', '') - call EasyMotion#helper#VarReset('&foldmethod', 'manual') + if &foldmethod !=# 'expr' + call EasyMotion#helper#VarReset('&foldmethod', 'manual') + endif endfunction "}}} function! s:RestoreValue() "{{{ call EasyMotion#helper#VarReset('&scrolloff') @@ -358,7 +360,9 @@ function! s:RestoreValue() "{{{ call EasyMotion#helper#VarReset('&readonly') call EasyMotion#helper#VarReset('&spell') call EasyMotion#helper#VarReset('&virtualedit') - call EasyMotion#helper#VarReset('&foldmethod') + if &foldmethod !=# 'expr' + call EasyMotion#helper#VarReset('&foldmethod') + endif endfunction "}}} function! s:turn_off_hl_error() "{{{ let s:error_hl = EasyMotion#highlight#capture('Error') diff --git a/autoload/EasyMotion/helper.vim b/autoload/EasyMotion/helper.vim index 934945c..547c45b 100644 --- a/autoload/EasyMotion/helper.vim +++ b/autoload/EasyMotion/helper.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: autoload/EasyMotion/helper.vim " AUTHOR: haya14busa -" Last Change: 22 Feb 2014. +" Last Change: 17 Mar 2014. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -105,8 +105,8 @@ function! EasyMotion#helper#VarReset(var, ...) "{{{ if a:0 == 0 && has_key(s:var_reset, a:var) " Reset var to original value - " setbufbar( or bufname): '' or '%' can be used for the current buffer - call setbufvar("", a:var, s:var_reset[a:var]) + " setbufvar( or bufname): '' or '%' can be used for the current buffer + call setbufvar('%', a:var, s:var_reset[a:var]) elseif a:0 == 1 " Save original value and set new var value @@ -116,7 +116,7 @@ function! EasyMotion#helper#VarReset(var, ...) "{{{ let s:var_reset[a:var] = getbufvar("", a:var) " Set new var value - call setbufvar("", a:var, new_value) + call setbufvar('%', a:var, new_value) endif endfunction "}}}