diff --git a/src/highlighters.cc b/src/highlighters.cc index 11c4558b..8e1c35f4 100644 --- a/src/highlighters.cc +++ b/src/highlighters.cc @@ -1722,8 +1722,7 @@ struct RegionMatches if (beg_pos != end_it->end_coord()) beg_pos = end_it->end_coord(); - else - ++end_it; + ++end_it; } } }; diff --git a/test/highlight/regions-recurse/cmd b/test/highlight/regions-recurse/cmd new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/test/highlight/regions-recurse/cmd @@ -0,0 +1 @@ + diff --git a/test/highlight/regions-recurse/in b/test/highlight/regions-recurse/in new file mode 100644 index 00000000..f890e435 --- /dev/null +++ b/test/highlight/regions-recurse/in @@ -0,0 +1 @@ +foo(bar '()') diff --git a/test/highlight/regions-recurse/rc b/test/highlight/regions-recurse/rc new file mode 100644 index 00000000..94244158 --- /dev/null +++ b/test/highlight/regions-recurse/rc @@ -0,0 +1,3 @@ +add-highlighter window/regions_test regions +add-highlighter window/regions_test/code default-region fill yellow +add-highlighter window/regions_test/argument region '\w+\h*\(\K' '(?=\))' '\(' fill red diff --git a/test/highlight/regions-recurse/ui-out b/test/highlight/regions-recurse/ui-out new file mode 100644 index 00000000..da7dd594 --- /dev/null +++ b/test/highlight/regions-recurse/ui-out @@ -0,0 +1,7 @@ +{ "jsonrpc": "2.0", "method": "set_ui_options", "params": [{}] } +{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "f" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": "oo(" }, { "face": { "fg": "red", "bg": "default", "attributes": [] }, "contents": "bar '()'" }, { "face": { "fg": "yellow", "bg": "default", "attributes": [] }, "contents": ")\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": [] }] } +{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 0 }] } +{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }