From b89c22fe03a25701ed4e01fd1cf9334e630c2b14 Mon Sep 17 00:00:00 2001 From: mMontu Date: Thu, 8 Jan 2015 11:20:34 -0200 Subject: [PATCH] Use shiftwidth() instead of &shiftwidth Using &shiftwidth makes VimwikiListChangeLvl misbehave when this option is set to 0, which is a default configuration of [DetectIndent](https://github.com/roryokane/detectindent). --- autoload/vimwiki/base.vim | 2 +- autoload/vimwiki/lst.vim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 5adc1b7..f2c7117 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1725,7 +1725,7 @@ function! vimwiki#base#table_of_contents(create) \ '__Header__', '\='."'".g:vimwiki_toc_header."'", '')) let startindent = repeat(' ', vimwiki#lst#get_list_margin()) - let indentstring = repeat(' ', &shiftwidth) + let indentstring = repeat(' ', shiftwidth()) for [lvl, link, desc] in headers let esc_link = substitute(link, "'", "''", 'g') let esc_desc = substitute(desc, "'", "''", 'g') diff --git a/autoload/vimwiki/lst.vim b/autoload/vimwiki/lst.vim index 86c9d74..d108890 100644 --- a/autoload/vimwiki/lst.vim +++ b/autoload/vimwiki/lst.vim @@ -932,9 +932,9 @@ function! s:decrease_level(item) "{{{ else let old_indent = indent(a:item.lnum) if &shiftround - let new_indent = (old_indent - 1) / &shiftwidth * &shiftwidth + let new_indent = (old_indent - 1) / shiftwidth() * shiftwidth() else - let new_indent = old_indent - &shiftwidth + let new_indent = old_indent - shiftwidth() endif call s:set_indent(a:item.lnum, new_indent) let removed_indent = new_indent - old_indent @@ -952,9 +952,9 @@ function! s:increase_level(item) "{{{ else let old_indent = indent(a:item.lnum) if &shiftround - let new_indent = (old_indent / &shiftwidth + 1) * &shiftwidth + let new_indent = (old_indent / shiftwidth() + 1) * shiftwidth() else - let new_indent = old_indent + &shiftwidth + let new_indent = old_indent + shiftwidth() endif call s:set_indent(a:item.lnum, new_indent) let additional_indent = new_indent - old_indent