nvim-zh / colorful-winsep.nvim

Make your nvim window separators colorful
MIT License
422 stars 16 forks source link

incorrect divider set on autosession load w/nvimtree #68

Closed Rydwxz closed 3 months ago

Rydwxz commented 4 months ago

It looks like it may be being placed where buffer is before nvim-tree is toggled on. When nvimtree is toggled on without being focused in the post session load hook, the divider isn't updated? scrnsht

minimum reproducible config

denstiny commented 4 months ago
events = { "WinEnter", "BufEnter", "WinResized", "WinClosed", "VimResized", "SessionLoadPost" },
Rydwxz commented 4 months ago

Thank you for your input, but I'm not certain what to do with that. I changed event = { "WinNew"}, to events = { "WinEnter", "BufEnter", "WinResized", "WinClosed", "VimResized", "SessionLoadPost" }, as well as events = { "WinEnter", "SessionLoadPost",}, but the divider still appears in the same spot, only now it is normal fg color instead of the hl I set in the config. I tried these lines with and without the son the end of event and I also tried removing the line entirely.

denstiny commented 4 months ago

Thank you for your input, but I'm not certain what to do with that. I changed event = { "WinNew"}, to events = { "WinEnter", "BufEnter", "WinResized", "WinClosed", "VimResized", "SessionLoadPost" }, as well as events = { "WinEnter", "SessionLoadPost",}, but the divider still appears in the same spot, only now it is normal fg color instead of the hl I set in the config. I tried these lines with and without the son the end of event and I also tried removing the line entirely.

https://github.com/denstiny/dotfiles/blob/eb1216edd268dbc85f9d8597a89c97b67dea36c0/nvim/lua/plugin/ui/init.lua#L51-L59 this is my config.

denstiny commented 4 months ago

Don't forget to check out my require"plugin.ui.winsep" content

timtyrrell commented 4 months ago

I have been experiencing the same issue, although I can trigger the problem without using sessions. Anytime I run :NvimTreeToggle, :NvimTreeFindFile, or :NvimTreeToggle it happens. I tried all of the event configs mentioned above but it had no effect.

denstiny commented 4 months ago

I have been experiencing the same issue, although I can trigger the problem without using sessions. Anytime I run :NvimTreeToggle, :NvimTreeFindFile, or :NvimTreeToggle it happens. I tried all of the event configs mentioned above but it had no effect.

Can you please provide the minimum reproducible configuration and reproduction steps?

timtyrrell commented 4 months ago

@denstiny I figured out it. Removing NvimTree from the no_exec_files array fixed it. Maybe I don't have the same issue here and I apologize. Let me know if you want me to open a new issue and I can copy this over.

Steps to duplicate:

mini.vim set nocompatible filetype plugin indent on syntax on set hidden call plug#begin('~/.config/nvim/plugged') Plug 'nvim-zh/colorful-winsep.nvim' Plug 'kyazdani42/nvim-tree.lua' call plug#end() lua << EOF require("colorful-winsep").setup({ no_exec_files = { "NvimTree" }, -- either one of these events arrays causes the issue -- events = { "VimResume", "WinEnter", "BufEnter", "WinResized", "WinClosed", "VimResized", "SessionLoadPost" }, event = { "WinNew" }, }) require('nvim-tree').setup { } EOF
denstiny commented 4 months ago

@denstiny I figured out it. Removing NvimTree from the no_exec_files array fixed it. Maybe I don't have the same issue here and I apologize. Let me know if you want me to open a new issue and I can copy this over.

Steps to duplicate:

* use mini.vim

* `:e file1`

* `:vsp`

* `:NvimTreeToggle`

mini.vim set nocompatible filetype plugin indent on syntax on set hidden

call plug#begin('~/.config/nvim/plugged')

Plug 'nvim-zh/colorful-winsep.nvim' Plug 'kyazdani42/nvim-tree.lua'

call plug#end()

lua << EOF

require("colorful-winsep").setup({ no_exec_files = { "NvimTree" }, -- either one of these events arrays causes the issue -- events = { "VimResume", "WinEnter", "BufEnter", "WinResized", "WinClosed", "VimResized", "SessionLoadPost" }, event = { "WinNew" }, })

require('nvim-tree').setup { }

EOF Well, this is because after opening the window for nvim-tree, there are other behaviors that exist. The no_exec_files option can fix this. Since I personally use nvim-tree as well as Session, I am quite confused about this issue and have been unable to reproduce the problem

denstiny commented 4 months ago

@timtyrrell Furthermore, for the lazy-loading of this plugin, I believe you should use the WinLeave event rather than the WinNew event.

denstiny commented 4 months ago

https://github.com/nvim-zh/colorful-winsep.nvim/assets/57088952/0b8a52e4-9b63-4b42-8cd5-01d12176fc63