Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After connect, vim.highlight.on_yank seems to be triggered automatically (Neovim) #384

Open
formsandlines opened this issue Feb 15, 2022 · 3 comments
Labels
neovim Neovim's behaviors

Comments

@formsandlines
Copy link

After connecting to an nREPL, as soon as I type any character that is not either one of (){}[]'\ (probably some others too), the top-level form (with all its nested forms) gets highlighted as if a yank has occurred.

I have tried to disable all the other plugins that might cause a conflict (even coc, treesitter and my theme), but this seems to be an issue with vim-iced. It also doesn't matter what I set my clipboard to. The highlighting only disappears after I delete my TextYankPost autocommand, which looks like this:

augroup highlight_yank
    autocmd!
    au TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=200}
augroup END

Here is a quick demonstration (wait for the part after :IcedConnect):

220215_vim-iced-highlight-bug

A temporary fix I found is to add on_visual=false to the highlight.on_yank options. It seems that the issue has something to do with visual selection, although it occurs in normal mode.

This is not ideal, since I still want to highlight yanked text in visual mode, but it is a compromise I can live with for now (considering the amazing IDE-ish experience vim-iced has to offer).

@liquidz
Copy link
Owner

liquidz commented Feb 15, 2022

@formsandlines Thanks for your reporting!

Hmm, weird..
g:iced_enable_auto_document can yank the current form on every input (We do have some delays), but it is only up to the current form, not the top-level form.
https://liquidz.github.io/vim-iced/vim-iced.html#g%3Aiced_enable_auto_document

Otherwise, there should be no process that yanks on every input.

I'll have a look some more.

@liquidz liquidz added the neovim Neovim's behaviors label Feb 15, 2022
@liquidz
Copy link
Owner

liquidz commented Feb 16, 2022

@formsandlines I've tested with minimal configuration + vim.highlight.on_yank.
https://liquidz.github.io/vim-iced/#minimal_configuration

Auto indenting may be the cause.
https://liquidz.github.io/vim-iced/#auto_indenting

With the minimal configuration, top level form will be highlighted when <CR> entered.
So I think there is another plugin that is trying to indent every time you type.

@formsandlines
Copy link
Author

Yeah, this makes sense. I tried to disable all my plugins that involve indentation:

  • lukas-reineke/indent-blankline.nvim
  • michaeljsmith/vim-indent-object
    and have also set "let g:iced_enable_auto_indent = v:false", but the problem still remains.

I'll also try the minimal configuration when I have some time, maybe I missed something.

Is there something else I could try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neovim Neovim's behaviors
Projects
None yet
Development

No branches or pull requests

2 participants