1
1
local M = {}
2
2
3
- -- When adding new icons, remember to add an entry to the `filetypes` table, if applicable.
3
+ -- NOTE: When adding new icons, remember to add an entry to the `filetypes` table, if applicable.
4
4
local icons , icons_by_filename , icons_by_file_extension , icons_by_operating_system
5
+ local icons_by_desktop_environment , icons_by_window_manager
5
6
6
7
local default_icon = {
7
8
icon = " " ,
@@ -33,7 +34,17 @@ local function refresh_icons()
33
34
icons_by_filename = theme .icons_by_filename
34
35
icons_by_file_extension = theme .icons_by_file_extension
35
36
icons_by_operating_system = theme .icons_by_operating_system
36
- icons = vim .tbl_extend (" keep" , {}, icons_by_filename , icons_by_file_extension , icons_by_operating_system )
37
+ icons_by_desktop_environment = theme .icons_by_desktop_environment
38
+ icons_by_window_manager = theme .icons_by_window_manager
39
+ icons = vim .tbl_extend (
40
+ " keep" ,
41
+ {},
42
+ icons_by_filename ,
43
+ icons_by_file_extension ,
44
+ icons_by_operating_system ,
45
+ icons_by_desktop_environment ,
46
+ icons_by_window_manager
47
+ )
37
48
icons = vim .tbl_extend (" force" , icons , global_opts .override )
38
49
icons [1 ] = default_icon
39
50
end
@@ -345,22 +356,28 @@ function M.setup(opts)
345
356
local user_filename_icons = user_icons .override_by_filename
346
357
local user_file_ext_icons = user_icons .override_by_extension
347
358
local user_operating_system_icons = user_icons .override_by_operating_system
359
+ local user_desktop_environment_icons = user_icons .override_by_desktop_environment
360
+ local user_window_manager_icons = user_icons .override_by_window_manager
348
361
349
362
icons = vim .tbl_extend (
350
363
" force" ,
351
364
icons ,
352
365
user_icons .override or {},
353
366
user_filename_icons or {},
354
367
user_file_ext_icons or {},
355
- user_operating_system_icons or {}
368
+ user_operating_system_icons or {},
369
+ user_desktop_environment_icons or {},
370
+ user_window_manager_icons or {}
356
371
)
357
372
global_opts .override = vim .tbl_extend (
358
373
" force" ,
359
374
global_opts .override ,
360
375
user_icons .override or {},
361
376
user_filename_icons or {},
362
377
user_file_ext_icons or {},
363
- user_operating_system_icons or {}
378
+ user_operating_system_icons or {},
379
+ user_desktop_environment_icons or {},
380
+ user_window_manager_icons or {}
364
381
)
365
382
366
383
if user_filename_icons then
@@ -372,6 +389,12 @@ function M.setup(opts)
372
389
if user_operating_system_icons then
373
390
icons_by_operating_system = vim .tbl_extend (" force" , icons_by_operating_system , user_operating_system_icons )
374
391
end
392
+ if user_desktop_environment_icons then
393
+ icons_by_desktop_environment = vim .tbl_extend (" force" , icons_by_desktop_environment , user_desktop_environment_icons )
394
+ end
395
+ if user_window_manager_icons then
396
+ icons_by_window_manager = vim .tbl_extend (" force" , icons_by_window_manager , user_window_manager_icons )
397
+ end
375
398
376
399
icons [1 ] = default_icon
377
400
@@ -390,7 +413,9 @@ function M.setup(opts)
390
413
global_opts .override ,
391
414
icons_by_filename ,
392
415
icons_by_file_extension ,
393
- icons_by_operating_system
416
+ icons_by_operating_system ,
417
+ icons_by_desktop_environment ,
418
+ icons_by_window_manager
394
419
)
395
420
end , {
396
421
desc = " nvim-web-devicons: highlight test" ,
0 commit comments