b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

[Feature request] Allow specifying a border #13

Closed akinsho closed 6 months ago

akinsho commented 2 years ago

Hi,

Not sure if there's a specific implementation reason to avoid this, but I'm essentially trying to draw a bottom border on the window line to demarcate it a bit better from the buffer content rather than changing the colour of the window, which over time I've found too distracting on a small laptop screen. I tried overwriting the window config in a filetype autocommand (which didn't work), but I personally dislike that way of setting options anyway and think an explicit option would be much nicer.

Screen Shot 2022-05-07 at 08 01 56
b0o commented 2 years ago

I did look into setting borders, but I personally don't think they work very well for this use case. The issue is that it causes incline to take up 2-3 vertical rows which is a lot of space to lose.

Full borders:

2022-05-06_23-12-57_region

Bottom border:

2022-05-06_23-15-37_region

I also don't like how they interact with the cursorline highlight.

If you still think this would be useful, I'm not opposed to adding it. It will require re-working the positioning calculations a bit because a height of 1 is assumed.

milanglacier commented 2 years ago

I think the easiest way is to expose a autocmd User InclineAdjustWinlineConfig, and call doautocmd xxx in the code. and the user can reset the config whatever they want by implementing the autocmd itself. Adjusting the logic of the window position calculation is something tedious, it just requires many live view interactions with the nvim window to figure out the correct logic.

akinsho commented 2 years ago

@b0o I personally would only use the bottom border so would only be loosing a single line, I think the extra demarcation would be nice visually if it doesn't come at too much of a cost on your side. It's definitely not the end of the world, but I do like the bottom border examples you posted, although in my case this will be across the entire window.

Re. the above comment on user autocommands and manually messing with nvim window configs, I think that's quite a messy and potentially error-prone way to expose this sort of functionality and is best done via just a setting in the plugins options

EDIT: regarding the cursorline highlight, I guess in my case I only ever show a window in an inactive buffer, so the cursor never interacts with the window. Although, I guess the cursor would potentially end up underneath the window if it grew taller, but this a problem no matter how tall the window. FWIW I think eventually @.bfred's Winbar PR will get done, and you can switch to using that API

b0o commented 2 years ago

Sounds good to me, I will add support for borders in the near future.

And a bottom border with width = "fill" does look pretty neat!

2022-05-06_23-49-10_region

b0o commented 2 years ago

And yes, cursors getting hidden is an issue. I plan to add a hide.cursorline configuration option for users who keep Incline enabled for the focused win but don't want it showing if their cursor is on the same line.

b0o commented 6 months ago

I've decided not to support this feature.