diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2023-04-03 17:24:51 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2023-04-06 15:47:01 +1200 |
commit | f14965af391b2f89ce26369eec3e333c98fbcdde (patch) | |
tree | b520a20e21938d9c8ea539bd4cd9187b1210dd6d /plugin | |
parent | Add a version guard (diff) | |
download | vim-spellfile-local-f14965af391b2f89ce26369eec3e333c98fbcdde.tar.gz vim-spellfile-local-f14965af391b2f89ce26369eec3e333c98fbcdde.zip |
If OptionSet is available, trigger on 'spelllang'
We have to switch from <afile> to simply expanding % here, because
<afile> doesn't expand to the buffer's filename when OptionSet fires.
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/spellfile_local.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/spellfile_local.vim b/plugin/spellfile_local.vim index 623b148..5e348c0 100644 --- a/plugin/spellfile_local.vim +++ b/plugin/spellfile_local.vim @@ -17,4 +17,8 @@ let loaded_spellfile_local = 1 augroup spellfile_local autocmd BufFilePost,BufNewFile,BufRead,EncodingChanged,FileType * \ call spellfile_local#() + if has('##OptionSet') + autocmd OptionSet spelllang + \ call spellfile_local#() + endif augroup END |