File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change 1
1
local M = {}
2
2
3
- local fallback_handler = function (msg , level , opts )
3
+ local default_handler = function (msg , level , opts )
4
4
vim .notify (string.format (" [%s] %s" , opts .title , vim .inspect (msg )), level )
5
5
end
6
6
7
7
local config = {
8
8
threshold = vim .log .levels .INFO ,
9
- handler = fallback_handler ,
9
+ handler = default_handler ,
10
10
}
11
11
12
12
local modes = {
35
35
end
36
36
end
37
37
38
- local create_default_handler = function ()
39
- local has_notify , notify_plugin = pcall (require , " notify" )
40
- if has_notify and notify_plugin then
41
- return notify_plugin
42
- else
43
- return fallback_handler
44
- end
45
- end
46
-
47
38
function M .setup (opts )
48
39
opts = opts or {}
49
40
config .threshold = opts .notify .threshold or vim .log .levels .INFO
50
41
if type (opts .notify .handler ) == " function" then
51
42
config .handler = opts .notify .handler
52
- else
53
- config .handler = create_default_handler ()
54
43
end
55
44
end
56
45
You can’t perform that action at this time.
0 commit comments