Search highlight is not cleared when there is no match

Open
#5 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
vim
Domain
tooling

Research direction

Start by reproducing the issue with the minimal vimrc in Vim, including the multiple-window case, then inspect the plugin's search-highlight handling. Done means moving the cursor clears stale highlighting after a search with no match, both in a single buffer and when another window has a match.

Written by the indexing model from the issue text.

Description

Recently I experienced an issue multiple times. When I search something and there is no match in the current buffer, then search highlight is not cleared even if I move the cursor.

This is the minimal vimrc to reproduce:

set nocompatible
filetype off

call plug#begin()
Plug 'junegunn/vim-slash'
call plug#end()

Open Vim and search anything, for example, /test. Then we'll see E486: Pattern not found: test error. Just insert that text, test to the buffer. Then it'll be immediately highlighted. If I turn off the search highlight, I need to type :noh or search that term again and move the cursor.

This issue is clearer when there are multiple windows open. One having no match, and the other having one match or more. If the current buffer doesn't have a match, then the search highlight of the other is not cleared when I move the cursor.

Dominant language
Vim Script
Stars
330
Forks
34
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from junegunn/vim-slash

All issues in junegunn/vim-slash

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.