Extended search mode does not find escape sequences (\t, \n, \r...)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 87/100
Research direction
Start with src/dialogs/FindReplaceDialog.cpp, especially prepareToPerformSearch(), findOptions(), and findAllInCurrentDocument(); trace how the extended search text reaches the Finder. Reproduce with \t in Extended mode in a document containing a tab, then verify Find Next, Count, and Find All find it after the text is converted. Check Replace and Replace All too, since the issue says those search paths are affected.
Written by the indexing model from the issue text.
Description
Operating System and Version
Ubuntu 26.04.1 LTS
Distribution
Built from source (master, 75cb19f)
Description
With the "Extended (\n, \r, \t, \0, \x...)" search mode selected, searching for an
escape sequence such as \t never finds anything, although the document contains
tab characters. The search text is used literally instead of being converted.
This affects Find Next, Count, Find All in Current Document, Find All in All Opened
Documents and Mark All. In the Replace tab, the replacement text is converted
correctly, but the text being searched for is not, so Replace / Replace All do not
find extended sequences either.
The cause seems to be in src/dialogs/FindReplaceDialog.cpp:
- prepareToPerformSearch() (line 569) converts the text with
convertToExtended(findText), but findText is a local variable that is never used
afterwards. - It then calls finder->options() = findOptions(), and findOptions() (line 703)
takes the raw text again with options.text = findString(). - findAllInCurrentDocument() (line 285) also overwrites the text with
finder->options().text = findString(), without any conversion.
A possible fix would be to give the converted text to the Finder in
prepareToPerformSearch(), and to stop overwriting it in findAllInCurrentDocument().
Steps to Reproduce
- Create a new document and type: col1col2
- Open Search > Find... (Ctrl+F)
- Select the "Extended" search mode
- Type \t in the Find field
- Click "Find Next", "Count" or "Find All in Current Document"
-> "No matches found." / 0 matches, while a tab character is present - Switch to "Normal" mode and type an actual tab character (or select the tab in the
editor before opening the dialog) -> the tab is found
Debug Information
Notepad Next v0.15
Build Date/Time: Oct 28 2026 21:56:19
Qt: 6.10.2
OS: Ubuntu 26.04.1 LTS
Locale: fr_FR
CPU: x86_64
File Path: /media/Datas3/home/Documents/devs/NotepadNext/build/src/NotepadNext
Arguments: /media/Datas3/home/Documents/devs/NotepadNext/build/src/NotepadNext
Config File: /home/cyril/.config/NotepadNext/NotepadNext.ini
Additional Details
Related: #951 mentions that escaped characters work in extended mode for the
replacement string; only the search string is affected here.
- Dominant language
- C++
- Stars
- 14.7k
- Forks
- 942
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 5
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dail8859/NotepadNext
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
dail8859/NotepadNext#1145 · 1 comment ·
Maintainers usually reply within 1 day
-
macos
Difficulty 3/5 Half a day Newbie friendliness 30/100
dail8859/NotepadNext#1164 ·
Maintainers usually reply within 1 day
-
linux
Difficulty 3/5 1-2 days Newbie friendliness 55/100
dail8859/NotepadNext#1161 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
dail8859/NotepadNext#1155 · 6 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
dail8859/NotepadNext#1140 ·
Maintainers usually reply within 1 day
All issues in dail8859/NotepadNext
Similar issues
-
backlog documentation
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
EchoTools/nevr-runtime#1328 ·
Maintainers usually reply within 1 day
-
Component - Build
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Lighthouse#655 ·
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
wazuh/wazuh#40870 · 1 comment ·
Maintainers usually reply within 1 day