Do not modify foldmethod if the value is expr
It seems calculation of `expr` slows down to complete jump If &foldmethod == 'expr', maybe there are no need to modify values temporarily
This commit is contained in:
parent
7d930dd734
commit
5302eecff5
@ -3,7 +3,7 @@
|
|||||||
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
|
" Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
|
||||||
" haya14busa <hayabusa1419@gmail.com>
|
" haya14busa <hayabusa1419@gmail.com>
|
||||||
" Source: https://github.com/Lokaltog/vim-easymotion
|
" Source: https://github.com/Lokaltog/vim-easymotion
|
||||||
" Last Change: 03 Mar 2014.
|
" Last Change: 17 Mar 2014.
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
" Saving 'cpoptions' {{{
|
" Saving 'cpoptions' {{{
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
@ -349,7 +349,9 @@ function! s:SaveValue() "{{{
|
|||||||
call EasyMotion#helper#VarReset('&readonly', 0)
|
call EasyMotion#helper#VarReset('&readonly', 0)
|
||||||
call EasyMotion#helper#VarReset('&spell', 0)
|
call EasyMotion#helper#VarReset('&spell', 0)
|
||||||
call EasyMotion#helper#VarReset('&virtualedit', '')
|
call EasyMotion#helper#VarReset('&virtualedit', '')
|
||||||
call EasyMotion#helper#VarReset('&foldmethod', 'manual')
|
if &foldmethod !=# 'expr'
|
||||||
|
call EasyMotion#helper#VarReset('&foldmethod', 'manual')
|
||||||
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
function! s:RestoreValue() "{{{
|
function! s:RestoreValue() "{{{
|
||||||
call EasyMotion#helper#VarReset('&scrolloff')
|
call EasyMotion#helper#VarReset('&scrolloff')
|
||||||
@ -358,7 +360,9 @@ function! s:RestoreValue() "{{{
|
|||||||
call EasyMotion#helper#VarReset('&readonly')
|
call EasyMotion#helper#VarReset('&readonly')
|
||||||
call EasyMotion#helper#VarReset('&spell')
|
call EasyMotion#helper#VarReset('&spell')
|
||||||
call EasyMotion#helper#VarReset('&virtualedit')
|
call EasyMotion#helper#VarReset('&virtualedit')
|
||||||
call EasyMotion#helper#VarReset('&foldmethod')
|
if &foldmethod !=# 'expr'
|
||||||
|
call EasyMotion#helper#VarReset('&foldmethod')
|
||||||
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
function! s:turn_off_hl_error() "{{{
|
function! s:turn_off_hl_error() "{{{
|
||||||
let s:error_hl = EasyMotion#highlight#capture('Error')
|
let s:error_hl = EasyMotion#highlight#capture('Error')
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: autoload/EasyMotion/helper.vim
|
" FILE: autoload/EasyMotion/helper.vim
|
||||||
" AUTHOR: haya14busa
|
" AUTHOR: haya14busa
|
||||||
" Last Change: 22 Feb 2014.
|
" Last Change: 17 Mar 2014.
|
||||||
" License: MIT license {{{
|
" License: MIT license {{{
|
||||||
" Permission is hereby granted, free of charge, to any person obtaining
|
" Permission is hereby granted, free of charge, to any person obtaining
|
||||||
" a copy of this software and associated documentation files (the
|
" 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)
|
if a:0 == 0 && has_key(s:var_reset, a:var)
|
||||||
" Reset var to original value
|
" Reset var to original value
|
||||||
" setbufbar( or bufname): '' or '%' can be used for the current buffer
|
" setbufvar( or bufname): '' or '%' can be used for the current buffer
|
||||||
call setbufvar("", a:var, s:var_reset[a:var])
|
call setbufvar('%', a:var, s:var_reset[a:var])
|
||||||
elseif a:0 == 1
|
elseif a:0 == 1
|
||||||
" Save original value and set new var value
|
" 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)
|
let s:var_reset[a:var] = getbufvar("", a:var)
|
||||||
|
|
||||||
" Set new var value
|
" Set new var value
|
||||||
call setbufvar("", a:var, new_value)
|
call setbufvar('%', a:var, new_value)
|
||||||
endif
|
endif
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user