Skip to content

Commit f048cf5

Browse files
wip
Signed-off-by: Christian Parpart <[email protected]>
1 parent 808f5ee commit f048cf5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/vtbackend/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ target_link_libraries(vtbackend PUBLIC
104104
fmt::fmt-header-only
105105
range-v3::range-v3
106106
${LIBUNICODE_LIBS}
107+
regex_dfa
107108
vtparser
108109
vtpty
109110
)

src/vtbackend/TerminalState.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <vtbackend/Terminal.h>
1616
#include <vtbackend/TerminalState.h>
1717

18+
#include <regex_dfa/RegExprParser.h>
19+
1820
namespace terminal
1921
{
2022

@@ -29,9 +31,7 @@ TerminalState::TerminalState(Terminal& terminal):
2931
te->discardImage(*image);
3032
} },
3133
hyperlinks { HyperlinkCache { 1024 } },
32-
urlPattern { settings.urlPattern,
33-
std::regex_constants::ECMAScript | std::regex_constants::optimize
34-
| std::regex_constants::icase },
34+
urlPattern { regex_dfa::RegExprParser {}.parse(settings.urlPattern) },
3535
sequencer { terminal },
3636
parser { std::ref(sequencer) },
3737
viCommands { terminal },

src/vtbackend/TerminalState.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include <vtparser/Parser.h>
3232

33+
#include <regex_dfa/RegExpr.h>
34+
3335
#include <fmt/format.h>
3436

3537
#include <atomic>
@@ -206,7 +208,7 @@ struct TerminalState
206208
// Hyperlink related
207209
//
208210
HyperlinkStorage hyperlinks {};
209-
std::regex urlPattern;
211+
regex_dfa::RegExpr urlPattern;
210212

211213
std::string windowTitle {};
212214
std::stack<std::string> savedWindowTitles {};

0 commit comments

Comments
 (0)