Skip to content

Commit

Permalink
Fix indent plugin for vimspec
Browse files Browse the repository at this point in the history
'indentexpr` may be changed by user or other plugins.
  • Loading branch information
thinca committed Jun 20, 2021
1 parent 922f81b commit e2e9d95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions indent/vimspec.vim
Expand Up @@ -10,19 +10,19 @@ runtime! indent/vim.vim

let b:did_indent = 1

setlocal indentexpr=GetVimspecIndent()
let &l:indentexpr = 'GetVimspecIndent(' . string(&l:indentexpr) . ')'
setlocal indentkeys+==End

if exists('*GetVimspecIndent')
finish
endif

function GetVimspecIndent() abort
function GetVimspecIndent(orig_indentexpr) abort
try
" Old Vim's indent plugin has a bug that uses =~
let ignorecase_save = &ignorecase
set noignorecase
let indent = GetVimIndent()
let indent = eval(a:orig_indentexpr)
finally
let &ignorecase = ignorecase_save
endtry
Expand Down

0 comments on commit e2e9d95

Please sign in to comment.