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

<Plug>(clever-f-reset) doesn't reset highlight #61

Open
ram02z opened this issue Jun 13, 2021 · 4 comments
Open

<Plug>(clever-f-reset) doesn't reset highlight #61

ram02z opened this issue Jun 13, 2021 · 4 comments

Comments

@ram02z
Copy link

ram02z commented Jun 13, 2021

I have the following map in my config:
nmap <Esc> <Plug>(clever-f-reset)

Moving the cursor resets the highlights, but pressing <Esc> doesn't. However, it does reset the searching character.

@macintacos
Copy link

Hack I did was just add :noh<CR> at the end of it. Would be nice to not have to do that though.

@dragon-architect
Copy link

That hack was the exact configuration that I attempted in my own vimrc, before I even saw this open issue, and it didn't work for me. I tried both :noh<CR><Plug>(clever-f-reset) and <Plug>(clever-f-reset):noh<CR>.

@BertrandSim
Copy link
Contributor

BertrandSim commented Jun 24, 2022

I did a little bit of debugging. In my case, I noticed that the function clever_f#reset() in "autoload/clever_f.vim" returns an empty string (''). Changing its return value to a non-empty string that does a no-op, such as return "\<Esc>", works for me.

@BertrandSim
Copy link
Contributor

BertrandSim commented Jun 24, 2022

Alternatively, bypass the <Plug> mapping, and call the reset function directly, that is

nnoremap <Esc> :<C-u>call clever_f#reset()<CR>

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

No branches or pull requests

4 participants