diff --git a/src/highlighters.cc b/src/highlighters.cc index 8ae36b79..2a67375c 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1660,7 +1660,7 @@ void append_matches(const Buffer& buffer, LineCount line, RegexMatchList& matche { auto& m = *it; const bool with_capture = capture and m[1].matched and - m[0].second - m[0].first > std::numeric_limits::max(); + m[0].second - m[0].first < std::numeric_limits::max(); matches.push_back({ line, (int)(m[0].first - l.begin()), diff --git a/test/highlight/regions/in b/test/highlight/regions/in index 8b76db01..95ddb75b 100644 --- a/test/highlight/regions/in +++ b/test/highlight/regions/in @@ -1 +1 @@ -"abcdefgh" hehe ${ youhou{hihi} } +"abcdefgh" hehe ${ youhou{hihi} } hehe diff --git a/test/highlight/regions/rc b/test/highlight/regions/rc index dccc2a89..b92dfb37 100644 --- a/test/highlight/regions/rc +++ b/test/highlight/regions/rc @@ -2,3 +2,4 @@ add-highlighter window/regions_test regions add-highlighter window/regions_test/code default-region fill yellow add-highlighter window/regions_test/string region %{"} %{(?' '' fill blue diff --git a/test/highlight/regions/ui-out b/test/highlight/regions/ui-out index dfbf3205..48e7b3e9 100644 --- a/test/highlight/regions/ui-out +++ b/test/highlight/regions/ui-out @@ -1,5 +1,5 @@ { "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] } -{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "\"" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "abcdefgh\"" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": " hehe " }, { "face": { "fg": "red", "bg": "default", "attributes": [] }, "contents": "${ youhou{hihi} }" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] } +{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "\"" }, { "face": { "fg": "green", "bg": "default", "attributes": [] }, "contents": "abcdefgh\"" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": " hehe " }, { "face": { "fg": "red", "bg": "default", "attributes": [] }, "contents": "${ youhou{hihi} }" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": " hehe\u000a" }]], { "fg": "default", "bg": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "attributes": [] }] } { "jsonrpc": "2.0", "method": "menu_hide", "params": [] } { "jsonrpc": "2.0", "method": "info_hide", "params": [] } { "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "out 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "attributes": [] }, "contents": "" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }