diff src/structs.h @ 20623:99b6e6bf48bf v8.2.0865

patch 8.2.0865: syntax foldlevel is taken from the start of the line Commit: https://github.com/vim/vim/commit/e35a52aee718c881bdfa69a47a1068df6ab6c60a Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 31 19:48:53 2020 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 31 May 2020 20:00:04 +0200
parents d30b16692ce0
children d91b8d1e5198
line wrap: on
line diff
--- a/src/structs.h
+++ b/src/structs.h
@@ -2266,6 +2266,10 @@ typedef struct
 #define SYNSPL_TOP	1	// spell check toplevel text
 #define SYNSPL_NOTOP	2	// don't spell check toplevel text
 
+// values for b_syn_foldlevel: how to compute foldlevel on a line
+#define SYNFLD_START	0	// use level of item at start of line
+#define SYNFLD_MINIMUM	1	// use lowest local minimum level on line
+
 // avoid #ifdefs for when b_spell is not available
 #ifdef FEAT_SPELL
 # define B_SPELL(buf)  ((buf)->b_spell)
@@ -2360,6 +2364,7 @@ typedef struct {
     int		b_syn_slow;		// TRUE when 'redrawtime' reached
 # endif
     int		b_syn_ic;		// ignore case for :syn cmds
+    int		b_syn_foldlevel;	// how to compute foldlevel on a line
     int		b_syn_spell;		// SYNSPL_ values
     garray_T	b_syn_patterns;		// table for syntax patterns
     garray_T	b_syn_clusters;		// table for syntax clusters