focus.nvim
focus.nvim copied to clipboard
fix: check for utils.disabled when changing signcolumn when leaving window
Check if focus is disabled when changing signcolumn when leaving (WinLeave).
This solves the signcolumn getting changed upon lost focus of NvimTree window in floating mode despite being sure that NvimTree is in the ignore_filetypes.
local ignore_filetypes = { 'neo-tree', 'NvimTree' }
vim.api.nvim_create_autocmd('FileType', {
group = augroup,
callback = function(_)
local is_floating = vim.api.nvim_win_get_config(0).relative ~= ''
if vim.tbl_contains(ignore_filetypes, vim.bo.filetype) or is_floating then
vim.b.focus_disable = true
print('recognized focus filetype = ' .. vim.bo.filetype)
else
vim.b.focus_disable = false
end
end,
desc = 'Disable focus autoresize for FileType',
})
Before
Signcolumn disappear after losing focus
After
Corectly keeps the signcolumn padding when cursor leaves NvimTree window
Thank you very much for your contribution. Could you please add a test for it?
Ping!
Superseded by #177 which includes a test. Thanks.