@@ -8,6 +8,11 @@ local filter_by_included_hlgroups = _local_2_["filter-by-included-hlgroups"]
88local _local_3_ = require (" ex-colors.remap" )
99local remap_hl_opts = _local_3_ [" remap-hl-opts" ]
1010local default_colors = require (" ex-colors.default-colors" )
11+ local function ignored_definition_3f (hl_name , hl_map )
12+ local ignore_default_colors_3f = config .ignore_default_colors
13+ local ignore_clear_3f = config .ignore_clear
14+ return ((ignore_default_colors_3f and vim .deep_equal (hl_map , default_colors [hl_name ])) or (ignore_clear_3f and not next (hl_map )))
15+ end
1116local function extend_sequence_21 (dst , ...)
1217 for i , _3flist in pairs ({... }) do
1318 assert ((" number" == type (i )), (" expected number, got " .. i ))
@@ -76,82 +81,95 @@ local function compose_autocmd_lines(highlights)
7681 end
7782 hl_maps = tbl_16_auto
7883 end
79- local hi_cmds
84+ local filtered_hl_maps
8085 do
81- local tmp_9_auto
86+ local tbl_16_auto = {}
87+ for hl_name , hl_map in pairs (hl_maps ) do
88+ local k_17_auto , v_18_auto = nil , nil
89+ if not ignored_definition_3f (hl_name , hl_map ) then
90+ k_17_auto , v_18_auto = hl_name , hl_map
91+ else
92+ k_17_auto , v_18_auto = nil
93+ end
94+ if ((k_17_auto ~= nil ) and (v_18_auto ~= nil )) then
95+ tbl_16_auto [k_17_auto ] = v_18_auto
96+ else
97+ end
98+ end
99+ filtered_hl_maps = tbl_16_auto
100+ end
101+ if next (filtered_hl_maps ) then
102+ local hi_cmds
82103 do
83- local tbl_21_auto = {}
84- local i_22_auto = 0
85- for hl_name , hl_opts in pairs (hl_maps ) do
86- local val_23_auto
87- if next (hl_opts ) then
88- val_23_auto = (indent .. format_nvim_set_hl (hl_name , hl_opts ))
89- else
90- val_23_auto = nil
91- end
92- if (nil ~= val_23_auto ) then
93- i_22_auto = (i_22_auto + 1 )
94- tbl_21_auto [i_22_auto ] = val_23_auto
95- else
104+ local tmp_9_auto
105+ do
106+ local tbl_21_auto = {}
107+ local i_22_auto = 0
108+ for hl_name , hl_opts in pairs (filtered_hl_maps ) do
109+ local val_23_auto
110+ if next (hl_opts ) then
111+ val_23_auto = (indent .. format_nvim_set_hl (hl_name , hl_opts ))
112+ else
113+ val_23_auto = nil
114+ end
115+ if (nil ~= val_23_auto ) then
116+ i_22_auto = (i_22_auto + 1 )
117+ tbl_21_auto [i_22_auto ] = val_23_auto
118+ else
119+ end
96120 end
121+ tmp_9_auto = tbl_21_auto
97122 end
98- tmp_9_auto = tbl_21_auto
123+ table.sort (tmp_9_auto )
124+ hi_cmds = tmp_9_auto
99125 end
100- table.sort (tmp_9_auto )
101- hi_cmds = tmp_9_auto
102- end
103- local callback_lines = flatten ({" callback = function()" , hi_cmds , " end," })
104- local au_opt_lines
105- if (" *" == au_pattern ) then
106- au_opt_lines = callback_lines
107- else
108- local pattern_line = (" pattern = %s," ):format (__3eoneliner (au_pattern ))
109- au_opt_lines = flatten ({pattern_line , callback_lines })
110- end
111- local _let_14_ = vim .deepcopy (autocmd_template_lines )
112- local first_line = _let_14_ [1 ]
113- local lines = _let_14_
114- local event_arg
115- do
116- local _15_ = type (au_event )
117- if (_15_ == " string" ) then
118- event_arg = (" %q" ):format (au_event )
119- elseif (_15_ == " table" ) then
120- event_arg = au_event
121- elseif (nil ~= _15_ ) then
122- local _else = _15_
123- event_arg = error ((" expected string or table, got " .. _else ))
126+ local callback_lines = flatten ({" callback = function()" , hi_cmds , " end," })
127+ local au_opt_lines
128+ if (" *" == au_pattern ) then
129+ au_opt_lines = callback_lines
124130 else
125- event_arg = nil
131+ local pattern_line = (" pattern = %s," ):format (__3eoneliner (au_pattern ))
132+ au_opt_lines = flatten ({pattern_line , callback_lines })
133+ end
134+ local _let_16_ = vim .deepcopy (autocmd_template_lines )
135+ local first_line = _let_16_ [1 ]
136+ local lines = _let_16_
137+ local event_arg
138+ do
139+ local _17_ = type (au_event )
140+ if (_17_ == " string" ) then
141+ event_arg = (" %q" ):format (au_event )
142+ elseif (_17_ == " table" ) then
143+ event_arg = au_event
144+ elseif (nil ~= _17_ ) then
145+ local _else = _17_
146+ event_arg = error ((" expected string or table, got " .. _else ))
147+ else
148+ event_arg = nil
149+ end
126150 end
151+ lines [1 ] = first_line :format (event_arg )
152+ table.insert (lines , # lines , au_opt_lines )
153+ table.insert (autocmd_list , flatten (lines ))
154+ else
127155 end
128- lines [1 ] = first_line :format (event_arg )
129- table.insert (lines , # lines , au_opt_lines )
130- table.insert (autocmd_list , flatten (lines ))
131156 else
132157 end
133158 end
134159 end
135160 do
136- local function _20_ ( _18_ , _19_ )
137- local cmd_line1 = _18_ [1 ]
138- local cmd_line2 = _19_ [1 ]
161+ local function _23_ ( _21_ , _22_ )
162+ local cmd_line1 = _21_ [1 ]
163+ local cmd_line2 = _22_ [1 ]
139164 return (cmd_line1 < cmd_line2 )
140165 end
141- table.sort (autocmd_list , _20_ )
166+ table.sort (autocmd_list , _23_ )
142167 end
143168 return flatten (autocmd_list )
144169end
145170local function compose_hi_cmd_lines (highlights , dump_all_3f )
146171 local included_patterns = config .included_patterns
147172 local included_hlgroups = filter_by_included_hlgroups (highlights )
148- local ignore_default_colors_3f = config .ignore_default_colors
149- local ignore_clear_3f = config .ignore_clear
150- local ignored_definition_3f
151- local function _21_ (hl_name , hl_map )
152- return ((ignore_default_colors_3f and vim .deep_equal (hl_map , default_colors [hl_name ])) or (ignore_clear_3f and not next (hl_map )))
153- end
154- ignored_definition_3f = _21_
155173 local filtered_hl_maps
156174 if dump_all_3f then
157175 local tbl_16_auto = {}
@@ -197,7 +215,7 @@ local function compose_hi_cmd_lines(highlights, dump_all_3f)
197215 filtered_hl_maps = tbl_16_auto
198216 end
199217 local cmd_list
200- local function _27_ ()
218+ local function _29_ ()
201219 local tbl_21_auto = {}
202220 local i_22_auto = 0
203221 for hl_name , hl_map in pairs (filtered_hl_maps ) do
@@ -210,7 +228,7 @@ local function compose_hi_cmd_lines(highlights, dump_all_3f)
210228 end
211229 return tbl_21_auto
212230 end
213- cmd_list = flatten (_27_ ())
231+ cmd_list = flatten (_29_ ())
214232 table.sort (cmd_list )
215233 return cmd_list
216234end
@@ -263,9 +281,9 @@ local function compose_vim_options_cmd_lines()
263281 for _ , vim_option_name in ipairs (vim_options ) do
264282 local k_17_auto , v_18_auto = nil , nil
265283 do
266- local _33_ = vim .api .nvim_get_option_value (vim_option_name , {scope = " global" })
267- if (nil ~= _33_ ) then
268- local val = _33_
284+ local _35_ = vim .api .nvim_get_option_value (vim_option_name , {scope = " global" })
285+ if (nil ~= _35_ ) then
286+ local val = _35_
269287 if (vim .api .nvim_get_option_info2 (vim_option_name , {}).default ~= val ) then
270288 k_17_auto , v_18_auto = vim_option_name , val
271289 else
0 commit comments