incline.nvim
incline.nvim copied to clipboard
Allow dynamic repositioning based on current line
I have my floating status line set to the top right corner of my window. But when my cursor is on line 1, the status line can overlap with code.
Currently, options like window.placement.vertical or window.margin.vertical only take static arguments (e.g., int, str), limiting the ability to update the position dynamically.
So it would be really nice if these options also took functions as values. This way, something like the following might work (to shift the status line down a line if my cursor is on line 1):
margin = {
vertical = function()
local current_line, _ = unpack(vim.api.nvim_win_get_cursor(0))
if current_line == 1 then
return 2
else
return 1
end
end
}