Merge remote-tracking branch 'EliteTK/fix-show_whitespaces-tab'

This commit is contained in:
Maxime Coste 2017-06-17 14:47:18 +01:00
commit 400f52c438
5 changed files with 9 additions and 1 deletions

View File

@ -941,7 +941,7 @@ void show_whitespaces(const Context& context, HighlightPass, DisplayBuffer& disp
if (cp == '\t') if (cp == '\t')
{ {
int column = (int)get_column(buffer, tabstop, it.coord()); int column = (int)get_column(buffer, tabstop, (it - 1).coord());
int count = tabstop - (column % tabstop); int count = tabstop - (column % tabstop);
atom_it->replace(tab + String(tabpad[(CharCount)0], CharCount{count-1})); atom_it->replace(tab + String(tabpad[(CharCount)0], CharCount{count-1}));
} }

View File

@ -0,0 +1 @@
ithis<tab>is<tab>a<tab>test<esc>

View File

@ -0,0 +1,6 @@
{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "this" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "→ " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "is" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "→ " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "a" }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "→ " }, { "face": { "fg": "default", "bg": "default", "attributes": [] }, "contents": "tes" }, { "face": { "fg": "black", "bg": "white", "attributes": [] }, "contents": "t" }, { "face": { "fg": "default", "bg": "default", "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:14 " }, { "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": 27 }] }
{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }

View File

@ -0,0 +1 @@
add-highlighter show_whitespaces