rhysd / clever-f.vim

Extended f, F, t and T key mappings for Vim.
https://rhysd.github.io/clever-f.vim
1.01k stars 44 forks source link

Cursor stuck as underscore after autocompletion #44

Closed BlooJeans closed 5 years ago

BlooJeans commented 5 years ago

First of all, I discovered this plugin today and am really enjoying it so far so thanks!

After installing the plugin I was getting some weird cursor issues and managed to find this related issue, which fixed my problem, but I wanted to open an issue here to point to the solution to help others in the future if they run into the same problem.

I was using all default params for clever-f with Shougo/deoplete.nvim as my autocompleter (not sure if it matters)

Here's a short video that shows the problem. Before my cursor is a block, then goes into underline mode when i enter Insert mode. After I take the autocompletion my cursor is permanently stuck in underline mode (both when in Normal mode and Insert mode).

vokoscreen-2019-02-20_16-48-28

Just add the following to your vimrc let g:clever_f_hide_cursor_on_cmdline = 0 https://github.com/neovim/neovim/issues/6913 credit to @zhou13

rhysd commented 5 years ago

Thank you for creating this issue with detailed info.

What enabling g:clever_f_hide_cursor_on_cmdline does is setting 'guicursor' option and t_ve variable. And they will be restored at finally clause. I'm not understanding why Neovim stucks.

https://github.com/rhysd/clever-f.vim/blob/bc52974b84ca0ee2341370477ee092e1679b620e/autoload/clever_f.vim#L138

rhysd commented 5 years ago

I found following issue.

https://github.com/neovim/neovim/issues/3688

Should I use some other option for Neovim to hide/show cursor? If so, please let me know. I'll update this plugin.

As mitigation, I'll set 0 to g:clever_f_hide_cursor_on_cmdline by default on Neovim.

rhysd commented 5 years ago

I understood the reason of this issue. Let's say we remove chars until x using dfx.

  1. At d, Neovim changes the shape of cursor to underline
  2. At f, clever-f remembers the cursor shape (guicursor value) and change current shape to 'block-NONE'
  3. User enters x
  4. clever-f restores guicursor but the shape is underline

I'll try to fix this.

rhysd commented 5 years ago

If someone is still seeing this issue, please let me know by commenting here.