summaryrefslogtreecommitdiff
path: root/test/highlight
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-10-12 14:38:19 +0800
committerMaxime Coste <mawww@kakoune.org>2017-10-12 14:46:15 +0800
commit89f016d871c9ccc516e244e8bc594defe3678daf (patch)
tree6de4767371edb0c424d0e5e8102c4c9b4f81b15c /test/highlight
parent446085d32b8a7562fd35a9fb7105874343d8715e (diff)
Refactor column highlighter to make it more robust
Support arbitrary orders for column highlighters (it was previously failing when column highlighters were not applied in column order). Fix show_matching tab handling at the same time (horizontal scrolling, tab characters and show_matching were behaving badly). Window highlighting now runs user highlighters, then built-ins for each phases, instead of running all phases for user highlighters, then all phases for built-ins. We now consider unprintable character to be 1-column width as we know we will display them as "�". Fixes #1615 Fixes #1023
Diffstat (limited to 'test/highlight')
-rw-r--r--test/highlight/column/multi-columns/cmd0
-rw-r--r--test/highlight/column/multi-columns/display6
-rw-r--r--test/highlight/column/multi-columns/in4
-rw-r--r--test/highlight/column/multi-columns/rc5
4 files changed, 15 insertions, 0 deletions
diff --git a/test/highlight/column/multi-columns/cmd b/test/highlight/column/multi-columns/cmd
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/highlight/column/multi-columns/cmd
diff --git a/test/highlight/column/multi-columns/display b/test/highlight/column/multi-columns/display
new file mode 100644
index 00000000..1caf4399
--- /dev/null
+++ b/test/highlight/column/multi-columns/display
@@ -0,0 +1,6 @@
+{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "1│" }, { "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "a" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }, { "face": { "fg": "default", "bg": "red", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "blue", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "green", "attributes": [] }, "contents": " " }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "2│" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "red", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "blue", "attributes": [] }, "contents": "a" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "b" }, { "face": { "fg": "default", "bg": "green", "attributes": [] }, "contents": "\u000a" }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "3│" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "ab" }, { "face": { "fg": "default", "bg": "red", "attributes": [] }, "contents": "c" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "\u000a" }, { "face": { "fg": "default", "bg": "blue", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "green", "attributes": [] }, "contents": " " }], [{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "4│" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "ab" }, { "face": { "fg": "default", "bg": "red", "attributes": [] }, "contents": "c" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "d" }, { "face": { "fg": "default", "bg": "blue", "attributes": [] }, "contents": "\u000a" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "default", "bg": "green", "attributes": [] }, "contents": " " }]], { "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": " - unnamed0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "attributes": [] }] }
+{ "jsonrpc": "2.0", "method": "set_cursor", "params": ["buffer", { "line": 0, "column": 2 }] }
+{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }
diff --git a/test/highlight/column/multi-columns/in b/test/highlight/column/multi-columns/in
new file mode 100644
index 00000000..a70bc8f5
--- /dev/null
+++ b/test/highlight/column/multi-columns/in
@@ -0,0 +1,4 @@
+a
+ ab
+abc
+abcd
diff --git a/test/highlight/column/multi-columns/rc b/test/highlight/column/multi-columns/rc
new file mode 100644
index 00000000..01eb14f6
--- /dev/null
+++ b/test/highlight/column/multi-columns/rc
@@ -0,0 +1,5 @@
+add-highlighter number_lines
+set window tabstop 4
+add-highlighter column 3 default,red
+add-highlighter column 7 default,green
+add-highlighter column 5 default,blue