Share search-match highlighting across renderers; engine owns its stack policy
SearchHighlight compiles the search pattern once per frame and yields each line's match ranges; the terminal, ImGui and Qt renderers had three copies of this, and Qt compiled a std::regex for every visible line on every frame. Qt now uses kte::Regex like the others. kte::Regex::RunGuarded replaces Command.cc's run_regex_work, which chose the large stack by comparing engine names. ForEachRegexMatch had no callers left and is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015rcVQiiWyTzoNrsvLSaAfB
This commit is contained in:
@@ -197,6 +197,7 @@ set(COMMON_SOURCES
|
||||
ErrorRecovery.cc
|
||||
RegexGuard.cc
|
||||
RegexEngine.cc
|
||||
SearchHighlight.cc
|
||||
TerminalInputHandler.cc
|
||||
TerminalRenderer.cc
|
||||
TerminalFrontend.cc
|
||||
@@ -296,6 +297,7 @@ set(COMMON_HEADERS
|
||||
TestFrontend.h
|
||||
TextSpan.h
|
||||
RegexEngine.h
|
||||
SearchHighlight.h
|
||||
UndoNode.h
|
||||
UndoTree.h
|
||||
UndoSystem.h
|
||||
@@ -413,6 +415,7 @@ if (BUILD_TESTS)
|
||||
ErrorRecovery.cc
|
||||
RegexGuard.cc
|
||||
RegexEngine.cc
|
||||
SearchHighlight.cc
|
||||
KKeymap.cc
|
||||
SwapRecorder.h
|
||||
OptimizedSearch.cc
|
||||
|
||||
Reference in New Issue
Block a user