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 5
5
" cast-type-mismatch" ,
6
6
" missing-fields"
7
7
],
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
114
114
}
115
115
end
116
116
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 )
119
119
local hlattr = M .HlAttribute
120
120
121
121
--- @param name string Syntax group name.
@@ -242,7 +242,7 @@ function M.hi_spec_to_def_map(spec)
242
242
end
243
243
244
244
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 , " ," ))
246
246
247
247
for _ , attr in ipairs (style_attrs ) do
248
248
res [attr ] = spec_attrs [attr ] ~= nil
Original file line number Diff line number Diff line change 199
199
--- @return boolean
200
200
function M .is_buf_in_use (bufnr , ignore )
201
201
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 )
203
203
204
204
for _ , view in ipairs (M .views ) do
205
205
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
+
1
4
local fmt = string.format
2
5
3
6
local M = {}
10
13
--- @param t T
11
14
--- @return T
12
15
function M .enum (t )
13
- vim . tbl_add_reverse_lookup (t )
16
+ utils . add_reverse_lookup (t )
14
17
return t
15
18
end
16
19
Original file line number Diff line number Diff line change @@ -1346,4 +1346,11 @@ end
1346
1346
1347
1347
M .path_sep = path_sep
1348
1348
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
+
1349
1356
return M
You can’t perform that action at this time.
0 commit comments