summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2023-10-23 12:22:51 +0200
committerLinnnus <[email protected]>2023-10-23 12:22:51 +0200
commit5da6a770efd37fc74386f495ccef30fb808c156b (patch)
treec61a1bf08cee90b2c3569526972b88d265cd4b62
parent7337179b8dff593d2b6f21dc596ec07a45d4c865 (diff)
home/neovim: Recalculate SusWhitespace when 'tw' changes
-rw-r--r--home/neovim/init.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/home/neovim/init.vim b/home/neovim/init.vim
index 2fa6917..9073f00 100644
--- a/home/neovim/init.vim
+++ b/home/neovim/init.vim
@@ -231,6 +231,10 @@ augroup Sus
" Create some persistent syntax highlighting groups.
au Syntax * call s:AddSyntax()
+ " When 'textwidth' changes, we may need to recalculate.
+ au OptionSet textwidth call s:RemoveSyntax()
+ \ | call s:AddSyntax()
+
" Temporarily remove the groups when in insert mode.
au InsertEnter * call s:RemoveSyntax()
au InsertLeave * call s:AddSyntax()