mvllow / modes.nvim

Prismatic line decorations for the adventurous vim user
550 stars 13 forks source link

refactor: don't manage guicursor and highlight for `ignore_filetypes` #39

Closed fitrh closed 1 year ago

fitrh commented 1 year ago

Previously, we called disable_manage_ui for ignore_filetypes to set 'guicursor' and 'cursorline', now, we completely ignore it.

@treatybreaker @Frydac, sorry for ping, but could you test this?

Using the following config, hopefully fix the previous issue

ignore_filetypes = {
    'neo-tree',
    'neo-tree-popup',
    'neo-tree-preview',
    'NvimTree',
    'TelescopePrompt',
},

I might update ignore_filetypes with the following filetypes if desired

Because in my experience, with those file types, the expected UX is to have cursor line in the window, e.g. symboltree from ldelossa/litee-symboltree.nvim, I expect the window shows the cursor line for the symbol under my current cursor

UPDATE:

In addition, this changes also ignores non-normal and unlisted buffer, the rationale is that most of the non-normal buffers are not intended to be used as text editing buffers, which makes it nonsense to change the mode in them, see :h 'buftype', :h special-buffers.

Plugins that utilize window to display information, mostly set their 'buftype' to nofile, ignoring such buffers keeps modes.nvim from unintentionally alter the UX of the plugins.

Fixes #28 Fixes #34

mvllow commented 1 year ago

Not sure the status of this, but I just published a new release if you wanted to merge this :)

fitrh commented 1 year ago

Thanks, will merge this, note that I'm not a neo-tree or nvim-tree user (uses those plugins just to test this change), my use case for those plugins is pretty basic, and I haven't had any issue with this change