Bug 449643 - Searched pattern not highlighted when Vi input mode is enabled
Summary: Searched pattern not highlighted when Vi input mode is enabled
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (other bugs)
Version First Reported In: 21.12.1
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-05 09:39 UTC by Om
Modified: 2022-03-02 17:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
sample.txt (90 bytes, text/plain)
2022-02-05 09:39 UTC, Om
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Om 2022-02-05 09:39:17 UTC
Created attachment 146302 [details]
sample.txt

SUMMARY
In Vim, a pattern can be searched for using the keyboard shortcut `/` in normal mode. Although this feature (and subsequent shortcuts like `n` and `N`) nicely works in Kate (or Kwrite), it does not highlight the relevant pattern in the document (the pattern is highlighted only upon __disabling__ Vi input mode and using Kate's builtin search feature). It would be helpful, if the search pattern is also highlighted when using the Vi-mode shortcut.


STEPS TO REPRODUCE
1. Open the attached file `sample.txt` in Kate with Vi input mode enabled.
2. In normal mode, search for the pattern `hello world` using the keyboard shortcut `/`.
3. Search for the pattern again using Edit->Find.
4. Now turn off Vi input mode.
5. Once again search for the pattern using Edit->Find.

OBSERVED RESULT
Although the cursor jumps to the next found pattern in steps 2 and 3, the patterns in these cases are not highlighted. However, the patterns are highlighted after steps 4 and 5.


EXPECTED RESULT
The search pattern ought to be highlighted when Vi input mode is enabled (as well as when using the Vi shortcut `/`).

SOFTWARE/OS VERSIONS
KDE Plasma
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.3
Comment 1 Bug Janitor Service 2022-02-22 17:29:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/293
Comment 2 Christoph Cullmann 2022-03-02 17:21:20 UTC
Git commit 1b08a07265b49be78a55d07904adeaabb7b05ab2 by Christoph Cullmann, on behalf of Martin Seher.
Committed on 02/03/2022 at 17:13.
Pushed by cullmann into branch 'master'.

vimode: implement hlsearch

This adds vim hlsearch functionality to vimode. All matching patterns
found inside the view visible range will be highlighted when a search is
initiated from vimode.
The feature is turned on by default like in vim.

The following commands have been added:
-) set-hlsearch, set-hls to turn it on (vim :set hls[earch])
-) set-nohlsearch, set-nohls to turn it off (vim :set nohls[earch])
-) nohlseach, noh to hide current highlights (vim :noh[lsearch])
Related: bug 449641

M  +13   -0    src/vimode/cmds.cpp
M  +2    -0    src/vimode/emulatedcommandbar/searchmode.cpp
M  +119  -1    src/vimode/searcher.cpp
M  +24   -1    src/vimode/searcher.h

https://invent.kde.org/frameworks/ktexteditor/commit/1b08a07265b49be78a55d07904adeaabb7b05ab2