-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathincline-config.lua
More file actions
42 lines (38 loc) · 1.2 KB
/
incline-config.lua
File metadata and controls
42 lines (38 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
local M = {
'b0o/incline.nvim',
event = 'VeryLazy',
}
M.opts = function()
return {
debounce_threshold = {
rising = 50,
falling = 100
},
window = {
padding = { left = 0, right = 1 },
margin = { horizontal = 0, vertical = 1 },
zindex = 10,
},
render = function(props)
local full_path = vim.api.nvim_buf_get_name(props.buf)
local parent_dir = vim.fn.fnamemodify(full_path, ':h:t')
local filename = vim.fn.fnamemodify(full_path, ':t')
local is_modified = vim.bo[props.buf].modified
local errors = #vim.diagnostic.get(props.buf, { severity = vim.diagnostic.severity.ERROR })
return {
{
is_modified and ' ●' or '',
group = 'DiagnosticWarn'
},
{
(errors > 0) and ' E' .. tostring(errors) or '',
group = 'DiagnosticError'
},
{
filename ~= '' and ' ' .. parent_dir .. '/' .. filename or '[No Name]',
}
}
end,
}
end
return M