Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check for utils.disabled when changing signcolumn when leaving window #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evertonse
Copy link

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
image

After

Corectly keeps the signcolumn padding when cursor leaves NvimTree window
image

@cryptomilk
Copy link
Collaborator

Thank you very much for your contribution. Could you please add a test for it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants