@@ -291,19 +291,15 @@ local function merge_mappings(user_mappings)
291
291
for _ , map in pairs (user_mappings ) do
292
292
if type (map .key ) == " table" then
293
293
for _ , key in pairs (map .key ) do
294
- if type (key ) == " string" then
295
- table.insert (user_keys , key :lower ())
296
- if is_empty (map .action ) then
297
- table.insert (removed_keys , key :lower ())
298
- end
294
+ table.insert (user_keys , key )
295
+ if is_empty (map .action ) then
296
+ table.insert (removed_keys , key )
299
297
end
300
298
end
301
299
else
302
- if type (map .key ) == " string" then
303
- table.insert (user_keys , map .key :lower ())
304
- if is_empty (map .action ) then
305
- table.insert (removed_keys , map .key :lower ())
306
- end
300
+ table.insert (user_keys , map .key )
301
+ if is_empty (map .action ) then
302
+ table.insert (removed_keys , map .key )
307
303
end
308
304
end
309
305
@@ -320,19 +316,14 @@ local function merge_mappings(user_mappings)
320
316
if type (map .key ) == " table" then
321
317
local filtered_keys = {}
322
318
for _ , key in pairs (map .key ) do
323
- if
324
- type (key ) == " string"
325
- and not vim .tbl_contains (user_keys , key :lower ())
326
- and not vim .tbl_contains (removed_keys , key :lower ())
327
- then
319
+ if not vim .tbl_contains (user_keys , key ) and not vim .tbl_contains (removed_keys , key ) then
328
320
table.insert (filtered_keys , key )
329
321
end
330
322
end
331
323
map .key = filtered_keys
332
324
return not vim .tbl_isempty (map .key )
333
325
else
334
- return type (map .key ) ~= " string"
335
- or not vim .tbl_contains (user_keys , map .key :lower ()) and not vim .tbl_contains (removed_keys , map .key :lower ())
326
+ return not vim .tbl_contains (user_keys , map .key ) and not vim .tbl_contains (removed_keys , map .key )
336
327
end
337
328
end , M .mappings )
338
329
@@ -375,17 +366,14 @@ local function filter_mappings(mappings, keys)
375
366
if type (keys ) == " boolean" and keys then
376
367
return {}
377
368
elseif type (keys ) == " table" then
378
- local keys_lower = vim .tbl_map (function (k )
379
- return type (k ) == " string" and k :lower () or nil
380
- end , keys )
381
369
return vim .tbl_filter (function (m )
382
370
if type (m .key ) == " table" then
383
371
m .key = vim .tbl_filter (function (k )
384
- return type ( k ) ~= " string " or not vim .tbl_contains (keys_lower , k : lower () )
372
+ return not vim .tbl_contains (keys , k )
385
373
end , m .key )
386
374
return # m .key > 0
387
375
else
388
- return type ( m . key ) ~= " string " or not vim .tbl_contains (keys_lower , m .key : lower () )
376
+ return not vim .tbl_contains (keys , m .key )
389
377
end
390
378
end , vim .deepcopy (mappings ))
391
379
else
0 commit comments