File tree Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 55 " cast-type-mismatch" ,
66 " missing-fields"
77 ],
8- "workspace.checkThirdParty" : false
9- }
8+ "workspace.checkThirdParty" : false ,
9+ "workspace.library" : [
10+ " $VIMRUNTIME" ,
11+ ]
12+ }
Original file line number Diff line number Diff line change @@ -114,8 +114,8 @@ if HAS_NVIM_0_8 then
114114 }
115115end
116116
117- vim . tbl_add_reverse_lookup (M .HlAttribute )
118- vim . tbl_add_reverse_lookup (style_attrs )
117+ utils . add_reverse_lookup (M .HlAttribute )
118+ utils . add_reverse_lookup (style_attrs )
119119local hlattr = M .HlAttribute
120120
121121--- @param name string Syntax group name.
@@ -242,7 +242,7 @@ function M.hi_spec_to_def_map(spec)
242242 end
243243
244244 if spec .style then
245- local spec_attrs = vim . tbl_add_reverse_lookup (vim .split (spec .style , " ," ))
245+ local spec_attrs = utils . add_reverse_lookup (vim .split (spec .style , " ," ))
246246
247247 for _ , attr in ipairs (style_attrs ) do
248248 res [attr ] = spec_attrs [attr ] ~= nil
Original file line number Diff line number Diff line change 199199--- @return boolean
200200function M .is_buf_in_use (bufnr , ignore )
201201 local ignore_map = ignore and utils .vec_slice (ignore ) or {}
202- vim . tbl_add_reverse_lookup (ignore_map )
202+ utils . add_reverse_lookup (ignore_map )
203203
204204 for _ , view in ipairs (M .views ) do
205205 if view :instanceof (StandardView .__get ()) then
Original file line number Diff line number Diff line change 1+ local lazy = require (" diffview.lazy" )
2+ local utils = lazy .require (" diffview.utils" ) --- @module " diffview.utils"
3+
14local fmt = string.format
25
36local M = {}
1013--- @param t T
1114--- @return T
1215function M .enum (t )
13- vim . tbl_add_reverse_lookup (t )
16+ utils . add_reverse_lookup (t )
1417 return t
1518end
1619
Original file line number Diff line number Diff line change @@ -1346,4 +1346,11 @@ end
13461346
13471347M .path_sep = path_sep
13481348
1349+ --- @param t table
1350+ --- @return table t
1351+ function M .add_reverse_lookup (t )
1352+ for k , v in pairs (t ) do t [v ] = k end
1353+ return t
1354+ end
1355+
13491356return M
You can’t perform that action at this time.
0 commit comments