aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-11-04 18:09:11 +0900
committernsfisis <nsfisis@gmail.com>2021-11-04 18:09:11 +0900
commit46f4f3712511114ff7e88f9699b42a79f813835f (patch)
tree4d3f7c1789565ccdda60c39ebc14c786a06f1c3e
parent34f20b49ff87ba8f5fc37760a138b560b0b2d9fc (diff)
downloaddotfiles-46f4f3712511114ff7e88f9699b42a79f813835f.tar.gz
dotfiles-46f4f3712511114ff7e88f9699b42a79f813835f.tar.zst
dotfiles-46f4f3712511114ff7e88f9699b42a79f813835f.zip
.vimrc: call IndentLinesReset when shiftwidth changes on FileType autocommand
IndentLinesReset is automatically called when OptionSet autocommand for shiftwidth is fired, but the event is not fired while FileType autocommand is processed.
-rw-r--r--.vimrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index 5c59154..dd7d350 100644
--- a/.vimrc
+++ b/.vimrc
@@ -1102,6 +1102,10 @@ function! s:ftplugin_setlocal(qargs) abort
let option_name = substitute(a:qargs, '\L.*', '', '')
+ if option_name ==# 'shiftwidth' && exists(':IndentLinesReset') ==# 2
+ IndentLinesReset
+ endif
+
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= '|setlocal ' . option_name . '<'
else