diff --git a/src/highlighters.cc b/src/highlighters.cc index 107ea9e2..d1159e18 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -458,8 +458,8 @@ HighlighterAndId create_search_highlighter(HighlighterParameters params) auto get_face = [](const Context& context){ return FacesSpec{ { 0, "Search" } }; }; - auto get_regex = [](const Context&){ - auto s = Context().main_sel_register_value("/"); + auto get_regex = [](const Context& context){ + auto s = context.main_sel_register_value("/"); try { return s.empty() ? Regex{} : Regex{s.begin(), s.end()};