nvim-zh / colorful-winsep.nvim

Make your nvim window separators colorful
MIT License
412 stars 17 forks source link

[Bug] Border height is wrong when using `laststatus=0` #71

Open SirWrexes opened 1 month ago

SirWrexes commented 1 month ago

Context

I'm using winbar to display a discreet status bar atop my various splits, and I like to disable the default status bar altogether for that, using laststatus=0

Bug

The display is kinda wrong when having laststatus set to 0 to hide it in favour of winbar. The vertical end delimiters are offset compared to the horizontal delimiters on bottom horizontal split. image

Minimal reproduction

  1. Paste this into a lua file, e.g. /tmp/repro.lua
    
    ---@diagnostic disable: undefined-global
    --# selene: allow(mixed_table)
    --# selene: allow(unscoped_variables)
    --# selene: allow(undefined_variable)

vim.env.LAZY_STDPATH = ".repro" load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

vim.o.laststatus = 0 vim.o.winbar = [[%n%=%f%m%=L%l/%L:%c (%p%%)]]

require("lazy.minit").repro { spec = { { "nvim-zh/colorful-winsep.nvim", config = true, }, }, }



2. Run `nvim -u /tmp/repro.lua +split +vsplit`
denstiny commented 1 month ago

Friend, I believe you should use laststatus=3, instead of 0. I originally created this plugin to implement laststatus=3

denstiny commented 1 month ago

Can you tell me why to use laststatus=0?

SirWrexes commented 1 month ago

Because I use winbar instead and I don't want an ugly empty bar at the bottom of my screen.¯\_(ツ)_/¯ The thing is I'm most likely not the only person using laststatus=0. The option exists for a reason. I believe you should either mention it in your README that this is not designed for of laststatus=0, or you could just implement a quick check over the value of vim.o.laststatus. :wink:

Sorry lots of edits on that one, I'm working on the side. n_n'

denstiny commented 1 month ago

Because I use winbar instead and I don't want an ugly empty bar at the bottom of my screen.¯_(ツ)_/¯ The thing is I'm most likely not the only person using laststatus=0. The option exists for a reason. I believe you should either mention it in your README that this is not designed for of laststatus=0, or you could just implement a quick check over the value of vim.o.laststatus. 😉

Sorry lots of edits on that one, I'm working on the side. n_n'

Okay, I will fix this issue as soon as possible, so please be patient.

SirWrexes commented 1 month ago

Sweet, thank you very much!

denstiny commented 1 month ago

Sweet, thank you very much!

Sorry, it's a bit complicated. If you're in a hurry, you can fix it yourself; the specific location is here: https://github.com/nvim-zh/colorful-winsep.nvim/blob/93a063e25a78c2a50441f3d1ece548465159aa1f/lua/colorful-winsep/view.lua#L50

denstiny commented 1 month ago

https://github.com/user-attachments/assets/227cdc55-c744-435e-8890-22a915af5440

denstiny commented 1 month ago

2024-07-26_21-25-20.mp4

Please mute before watching; I forgot to mute.

SirWrexes commented 1 month ago

I'll see what I can do if I get the time for it, but no promises. :sweat_smile: In the meantime, I suppose keeping this issue open could reel in some other potential users that have a fix to propose.

I have to confess, though: I recently found a nice plugin for showing current "context" in code to use in my statusbar and I've enabled laststatus=3. :rofl:

denstiny commented 1 month ago

I'll see what I can do if I get the time for it, but no promises. 😅 In the meantime, I suppose keeping this issue open could reel in some other potential users that have a fix to propose.

I have to confess, though: I recently found a nice plugin for showing current "context" in code to use in my statusbar and I've enabled laststatus=3. 🤣

Right choice😂😂😂