From 46f4f3712511114ff7e88f9699b42a79f813835f Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 4 Nov 2021 18:09:11 +0900 Subject: .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. --- .vimrc | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3-70-g09d2