zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
2.6k stars 184 forks source link

Regex: special case `^` and `$` require special treatment #843

Open lifenjoiner opened 3 weeks ago

lifenjoiner commented 3 weeks ago

a8471540

  1. Continuous search after found, requires one extra move;
  2. Select All does not work yet.
zufuliu commented 3 weeks ago

^ and $ seems is working, what's the test case? image

lifenjoiner commented 3 weeks ago

Yes, your example works, and the special cases are:

  1. only ^ or $, to quickly select the beginning or ending of lines, especially the ending;
  2. ^ and $, to select empty lines.

"Find All" works, other actions don't.

zufuliu commented 3 weeks ago

empty matches are skipped: https://github.com/zufuliu/notepad4/blob/10605475bd597620f0d124a747f36702524e03fa/src/Edit.cpp#L5480-L5489

https://github.com/zufuliu/notepad4/blob/10605475bd597620f0d124a747f36702524e03fa/src/Edit.cpp#L5590-L5595