summaryrefslogtreecommitdiff
path: root/src/unicode.hh
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 /src/unicode.hh
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 'src/unicode.hh')
-rw-r--r--src/unicode.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unicode.hh b/src/unicode.hh
index 94b0523a..01fcfb23 100644
--- a/src/unicode.hh
+++ b/src/unicode.hh
@@ -58,7 +58,7 @@ inline ColumnCount codepoint_width(Codepoint c) noexcept
if (c == '\n')
return 1;
const auto width = wcwidth((wchar_t)c);
- return width > 0 ? width : 0;
+ return width >= 0 ? width : 1;
}
enum class CharCategories