summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-10-04 19:37:43 +0100
committerMaxime Coste <frrrwww@gmail.com>2016-10-04 19:37:43 +0100
commitd2a324d3c4f62b5bab7d9841234029d4cda2c71b (patch)
treea3b52adc816a7853a556a88653414dd4be85f6a8 /src
parenta00e40e151198d221f5f4c2faac11bda6badcc78 (diff)
Treat '\n' as 1 column wide
Fixes #842
Diffstat (limited to 'src')
-rw-r--r--src/unicode.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unicode.hh b/src/unicode.hh
index c809163a..7a33b1fe 100644
--- a/src/unicode.hh
+++ b/src/unicode.hh
@@ -51,7 +51,7 @@ inline bool is_basic_alpha(Codepoint c)
inline size_t codepoint_width(Codepoint c)
{
- return wcwidth((wchar_t)c);
+ return c == '\n' ? 1 : wcwidth((wchar_t)c);
}
enum class CharCategories