From 7d099b903f4b609cec76ac80c62a30e912221efb Mon Sep 17 00:00:00 2001 From: Johannes Larsen Date: Sun, 17 May 2020 03:00:52 +0200 Subject: [PATCH] Dynamically set TabWidth style based on tabstop configuration --- autoload/clang_format.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/clang_format.vim b/autoload/clang_format.vim index ac9c49a..54483be 100644 --- a/autoload/clang_format.vim +++ b/autoload/clang_format.vim @@ -75,9 +75,10 @@ endfunction function! s:make_style_options() abort let extra_options = s:build_extra_options() - return printf("{BasedOnStyle: %s, IndentWidth: %d, UseTab: %s%s}", + return printf("{BasedOnStyle: %s, IndentWidth: %d, TabWidth: %d, UseTab: %s%s}", \ g:clang_format#code_style, \ (exists('*shiftwidth') ? shiftwidth() : &l:shiftwidth), + \ (exists('*tabstop') ? tabstop() : &l:tabstop), \ &l:expandtab==1 ? 'false' : 'true', \ extra_options) endfunction