equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.85k stars 171 forks source link

Cant disable cursor styling #1063

Open manungsa opened 1 year ago

manungsa commented 1 year ago

Platform: Endeavour OS Linux (Arch based)

I have a line on my configuration file to disable cursor styling:

vim.o.guicursor = nil
-- or
vim.o.guicursor = ""
-- either way works on regular Neovim on terminal

But it doesn't get sourced when I open nvim-qt. The other configuration option works, so I think it may be a problem on nvim-qt's guicursor implementation. Anyone having the same problem?

jgehrig commented 1 year ago

We should support the guicursor option, however I'm not familiar with setting it via vim.o.guicursor.

I'm only familiar with configuring the cursor via set guicursor=... in init.vim or vimrc.

Can you provide some additional details so I can reproduce (and hopefully fix) the issue?

What do you expect to happen, and what happens instead?


You could also try setting the option to a style-less default, such as: guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20

manungsa commented 1 year ago

These configuration line is basically the same as

set guicursor=

So I expect the cursor to go full block style, but after restarting nvim-qt the cursor still change according to the mode where I'm in, e.g. in Insert mode the cursor changed to thin style, on Replace mode the cursor go underscore style.

jgehrig commented 1 year ago

Okay, I see what is going on here. We do support cursor styling and the lack thereof.

However, when no cursor styling is applied, we use some defaults: https://github.com/equalsraf/neovim-qt/blob/b4ca557cd133eb049cf4c977a81437a23a1fcd06/src/gui/shell.cpp#L695-L714

To get the behavior you're looking for, we would need to set the cursor into block mode whenever styling is disabled.

I don't think what we're doing is strictly wrong, but there is a behavior difference from the TUI.

Generally, we try to match the TUI behavior when possible.


In the meantime, you could explicitly specify how you want the cursor to behave:

guicursor=n-v-c-sm-i-ci-ve-r-cr-o:block

manungsa commented 1 year ago

The guicursor=n-v-c-sm-i-ci-ve-r-cr-o:block worked tbh. I will use it for now. Thanks!.