From 610fca5da8e7481a0ac09df9f3c21bde586623b3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 30 Oct 2017 22:32:11 +1300 Subject: Switch on local formatoptions setting, not global The actual option settings performed by the function are local, so the test should be, too. --- vim/config/format.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/config/format.vim b/vim/config/format.vim index b307c4b6..f0cb6af5 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -21,7 +21,7 @@ endif " if has('eval') function! s:ToggleFormatFlag(flag) - let l:operation = (&formatoptions =~ a:flag) ? '-=' : '+=' + let l:operation = (&l:formatoptions =~ a:flag) ? '-=' : '+=' silent! exec 'setlocal formatoptions' . l:operation . a:flag setlocal formatoptions? endfunction -- cgit v1.2.3