From 157c36ee49f5f8e37ecbe5598ac50166ae814464 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 5 Nov 2017 13:29:24 +1300 Subject: Precisely define 'formatoptions' 'a' flag presence :help version6.txt, /^Patch 6\.1\.142: > Patch 6.1.142 > Problem: Defining paragraphs without a separating blank line isn't > possible. Paragraphs can't be formatted automatically. > Solution: Allow defining paragraphs with lines that end in white > space. Added the 'w' and 'a' flags in 'formatoptions'. > Files: runtime/doc/change.txt, src/edit.c, src/misc1.c, > src/normal.c, src/option.h, src/ops.c, src/proto/edit.pro, > src/proto/ops.pro, src/vim.h --- vim/config/format.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/config/format.vim b/vim/config/format.vim index 61222164..477ad6d2 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -29,7 +29,8 @@ if has('eval') " Figure out if we have the 'a' flag for 'formatoptions', to reapply " 'textwidth' wrapping to the current paragraph on every insertion or " deletion; keep in a script variable - let s:formatoptions_has_a = v:version > 700 + let s:formatoptions_has_a = v:version > 610 + \ || v:version ==# 610 && has('patch142') " 'c' and 't' have both been around since at least 6.1 nnoremap -- cgit v1.2.3 From 6e78aaf23837f7c35b20467e7422276b8edba79b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 5 Nov 2017 13:33:03 +1300 Subject: Move 'formatoptions-a' test near applicable block Just to keep related things together. --- vim/config/format.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vim/config/format.vim b/vim/config/format.vim index 477ad6d2..54d46dc2 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -26,12 +26,6 @@ if has('eval') finish endif - " Figure out if we have the 'a' flag for 'formatoptions', to reapply - " 'textwidth' wrapping to the current paragraph on every insertion or - " deletion; keep in a script variable - let s:formatoptions_has_a = v:version > 610 - \ || v:version ==# 610 && has('patch142') - " 'c' and 't' have both been around since at least 6.1 nnoremap \ c @@ -40,6 +34,12 @@ if has('eval') \ t \ :ToggleOptionFlagLocal formatoptions t + " Figure out if we have the 'a' flag for 'formatoptions', to reapply + " 'textwidth' wrapping to the current paragraph on every insertion or + " deletion; keep in a script variable + let s:formatoptions_has_a = v:version > 610 + \ || v:version ==# 610 && has('patch142') + " 'a' needs testing if s:formatoptions_has_a nnoremap -- cgit v1.2.3