aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-25 02:10:48 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-25 02:10:48 +1300
commit2bcf57aab5f98c5006da5a638c968f08f4fc63ce (patch)
tree5270eb918a13f32c2de12a1c94dc133f3d2e9cc2
parentMerge branch 'hotfix/v1.77.1' into develop (diff)
downloaddotfiles-2bcf57aab5f98c5006da5a638c968f08f4fc63ce.tar.gz
dotfiles-2bcf57aab5f98c5006da5a638c968f08f4fc63ce.zip
Undo shell script dialect flags from filetype.vim
These local buffer variable flags weren't being cleared correctly on a filetype change.
-rw-r--r--vim/after/ftplugin/sh.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim
index 766994b7..fdc42ccc 100644
--- a/vim/after/ftplugin/sh.vim
+++ b/vim/after/ftplugin/sh.vim
@@ -33,6 +33,16 @@ if exists('b:is_posix')
let g:is_posix = 1
endif
+" Queue up undo commands to clear the shell language flags that we set for
+" this buffer during filetype detection in filetype.vim
+if exists('b:is_bash')
+ let b:undo_ftplugin .= '|unlet b:is_bash'
+elseif exists('b:is_kornshell')
+ let b:undo_ftplugin .= '|unlet b:is_kornshell'
+elseif exists('b:is_posix')
+ let b:undo_ftplugin .= '|unlet b:is_posix'
+endif
+
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_sh_maps')
finish