From e35a52aee718c881bdfa69a47a1068df6ab6c60a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 31 May 2020 19:48:53 +0200 Subject: patch 8.2.0865: syntax foldlevel is taken from the start of the line Problem: Syntax foldlevel is taken from the start of the line. Solution: Add ":syn foldlevel" to be able to use the minimal foldlevel in the line. (Brad King, closes #6087) --- runtime/doc/syntax.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'runtime/doc/syntax.txt') diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index ff9be2e5c..2cff69411 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3636,6 +3636,26 @@ DEFINING CASE *:syn-case* *E390* :sy[ntax] case Show either "syntax case match" or "syntax case ignore" (translated). + +DEFINING FOLDLEVEL *:syn-foldlevel* + +:sy[ntax] foldlevel [start | minimum] + This defines how the foldlevel of a line is computed when using + foldmethod=syntax (see |fold-syntax| and |:syn-fold|): + + start: Use level of item containing start of line. + minimum: Use lowest local-minimum level of items on line. + + The default is 'start'. Use 'minimum' to search a line horizontally + for the lowest level contained on the line that is followed by a + higher level. This produces more natural folds when syntax items + may close and open horizontally within a line. + +:sy[ntax] foldlevel + Show either "syntax foldlevel start" or "syntax foldlevel minimum". + + {not meaningful when Vim was compiled without |+folding| feature} + SPELL CHECKING *:syn-spell* :sy[ntax] spell [toplevel | notoplevel | default] @@ -4099,6 +4119,8 @@ This will make each {} block form one fold. The fold will start on the line where the item starts, and end where the item ends. If the start and end are within the same line, there is no fold. The 'foldnestmax' option limits the nesting of syntax folds. +See |:syn-foldlevel| to control how the foldlevel of a line is computed +from its syntax items. {not available when Vim was compiled without |+folding| feature} -- cgit v1.2.1