rose-pine / neovim

Soho vibes for Neovim
MIT License
2.3k stars 147 forks source link

bug: cursor "disappears" in indent-blankline situations, with cursorline enabled #247

Closed chrigl closed 8 months ago

chrigl commented 8 months ago

Neovim version (nvim -v)

v0.9.5

Terminal / multiplexer

tmux

Describe the bug

IblWhitespace has the same fg color like CursorLine. Thus, it seems the cursor to disappear as soon as I am somewhere in the beginning of a line.

cursorline enabled: cursorline-enabled

cursorline disabled: cursorline-disabled

Repro

No response

mvllow commented 8 months ago

Could you clarify what your ideal behaviour would be? I'm wondering if you are wanting a different colour for the vertical lines or for the cursor. If the cursor is the issue, that is handled by your terminal (and your cursor does look quite a bit lighter than intended).

Screenshot 2024-03-02 alle 12 13 40
chrigl commented 8 months ago

If I understand it correctly... what might not be the case... CursorLine and IblWhitespace are set to the same color https://github.com/rose-pine/neovim/blob/main/lua/rose-pine.lua#L87, https://github.com/rose-pine/neovim/blob/main/lua/rose-pine.lua#L524.

When I change either one, the cursor is visible. More thing... IblIndent must also be changed, otherwise the same problem happens in the very first column.

e.g. this works:

diff --git a/lua/rose-pine.lua b/lua/rose-pine.lua
index 40ba83e..86130bf 100644
--- a/lua/rose-pine.lua
+++ b/lua/rose-pine.lua
@@ -519,9 +519,9 @@ local function set_highlights()
                WhichKeyValue = { fg = palette.rose },

                -- lukas-reineke/indent-blankline.nvim
-               IblIndent = { fg = palette.overlay },
+               IblIndent = { fg = palette.subtle },
                IblScope = { fg = palette.foam },
-               IblWhitespace = { fg = palette.overlay },
+               IblWhitespace = { fg = palette.subtle },

                -- hrsh7th/nvim-cmp
                CmpItemAbbr = { fg = palette.subtle },

This is a screenshot of v2.0.0 v2-tag

chrigl commented 8 months ago

But you are right as well! On macOS with iterm2, the cursor colors are ignored altogether. No matter where the cursor is, it has the exact same color.

On Linux with blackbox or gnome-terminal the cursor change, depending on where it is. Like, if I am on a "pine" word, the cursor changes to "pine", while the color of the text is "base"-(ish).

mvllow commented 8 months ago

Hmm, I'm not sure if this is "fixable" on our end. I understand on your linux setup that the cursor seems to be implied by certain highlight groups (maybe?) but I'd suggest looking into changing your cursor in those terminals directly. Unless Cursor / lCursor highlight groups change anything. Happy to revisit if we can change only the cursor colour without affecting other groups :)

Edit: My screenshot is using Kitty

chrigl commented 8 months ago

Thanks for your help!

vim.opt.guicursor = "n-v-c-sm:block-Cursor,i-ci-ve:ver25,r-cr-o:hor20" (I added the -Cursor) in my init.lua, forces nvim to use highlight Cursor, rather than the terminal default.

Setting IblIndent and IblWhitespace to other than cursorline is a matter of taste. In v2.0.0 the colors were different, so it worked with this linux-color-inverse-thingy. But no strong feelings here :)

Have a great weekend!