@@ -131,6 +131,17 @@ local function manage_netrw(disable_netrw, hijack_netrw)
131
131
end
132
132
end
133
133
134
+ --- @param severity vim.diagnostic.Severity
135
+ --- @return string ?
136
+ local function get_diagnostics_icons (severity )
137
+ local config = vim .diagnostic .config () or {}
138
+ local signs = config .signs or {}
139
+ if type (signs ) == " function" then
140
+ signs = signs (0 , 0 )
141
+ end
142
+ return (type (signs ) == " table" and signs .text and signs .text [severity ]) or nil
143
+ end
144
+
134
145
--- @param name string | nil
135
146
function M .change_dir (name )
136
147
if name then
@@ -303,7 +314,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
303
314
special_files = { " Cargo.toml" , " Makefile" , " README.md" , " readme.md" },
304
315
hidden_display = " none" ,
305
316
symlink_destination = true ,
306
- decorators = { " Git" , " Open" , " Hidden" , " Modified" , " Bookmark" , " Diagnostics" , " Copied" , " Cut" , },
317
+ decorators = { " Git" , " Open" , " Hidden" , " Modified" , " Bookmark" , " Diagnostics" , " Copied" , " Cut" },
307
318
highlight_git = " none" ,
308
319
highlight_diagnostics = " none" ,
309
320
highlight_opened_files = " none" ,
@@ -415,10 +426,10 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
415
426
max = vim .diagnostic .severity .ERROR ,
416
427
},
417
428
icons = {
418
- hint = " " ,
419
- info = " " ,
420
- warning = " " ,
421
- error = " " ,
429
+ hint = get_diagnostics_icons ( vim . diagnostic . severity . HINT ) or " " ,
430
+ info = get_diagnostics_icons ( vim . diagnostic . severity . INFO ) or " " ,
431
+ warning = get_diagnostics_icons ( vim . diagnostic . severity . WARN ) or " " ,
432
+ error = get_diagnostics_icons ( vim . diagnostic . severity . ERROR ) or " " ,
422
433
},
423
434
},
424
435
modified = {
@@ -513,8 +524,7 @@ local DEFAULT_OPTS = { -- BEGIN_DEFAULT_OPTS
513
524
default_yes = false ,
514
525
},
515
526
},
516
- experimental = {
517
- },
527
+ experimental = {},
518
528
log = {
519
529
enable = false ,
520
530
truncate = false ,
0 commit comments