summaryrefslogtreecommitdiff
path: root/src/regex.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-07 10:43:21 +0800
committerMaxime Coste <mawww@kakoune.org>2017-11-01 14:05:14 +0800
commit52ee62172a8573352dd62121c70de81117db782a (patch)
treee8fd68fd6781abedf7f5c0418a698396855b8102 /src/regex.cc
parentc375268c2d3493d4dc51699eef783c406c167b93 (diff)
Regex: remove use of buffer_utils.hh from regex_impl.cc
Diffstat (limited to 'src/regex.cc')
-rw-r--r--src/regex.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/regex.cc b/src/regex.cc
index a622269b..25ace466 100644
--- a/src/regex.cc
+++ b/src/regex.cc
@@ -11,8 +11,14 @@ using Utf8It = RegexUtf8It<const char*>;
Regex::Regex(StringView re, flag_type flags) try
: RegexBase{Utf8It{re.begin(), re}, Utf8It{re.end(), re}, flags}, m_str{re.str()}
{
- if (auto compiled_regex = compile_regex(re))
- m_impl = new CompiledRegex{std::move(compiled_regex)};
+ try
+ {
+ m_impl = new CompiledRegex{compile_regex(re)};
+ }
+ catch (runtime_error& err)
+ {
+ write_to_debug_buffer(err.what());
+ }
} catch (std::runtime_error& err) { throw regex_error(err.what()); }
String option_to_string(const Regex& re)