summaryrefslogtreecommitdiff
path: root/Src/Zle/zle_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/zle_misc.c')
-rw-r--r--Src/Zle/zle_misc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c
index d3a9413f3..554830244 100644
--- a/Src/Zle/zle_misc.c
+++ b/Src/Zle/zle_misc.c
@@ -59,10 +59,16 @@ doinsert(ZLE_STRING_T zstr, int len)
* (i.e. even if control, or double width, or with combining
* characters) is treated as 1 for the purpose of replacing
* what's there already.
+ *
+ * This can cause inserting of a combining character in
+ * places where it should overwrite, such as the start
+ * of a line. However, combining characters aren't
+ * useful there anyway and this doesn't cause any
+ * particular harm.
*/
for (i = 0, count = 0; i < len; i++) {
- int width = wcwidth(zstr[i]);
- count += (width != 0) ? 1 : 0;
+ if (!IS_COMBINING(zstr[i]))
+ count++;
}
/*
* Ensure we replace a complete combining character