aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 7978dc8969..fae8e9ecd0 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -3745,8 +3745,10 @@ int build_stl_str_hl(
// Put a `<` to mark where we truncated at
*trunc_p = '<';
- // Advance the pointer to the end of the string
- trunc_p = trunc_p + STRLEN(trunc_p);
+ if (width + 1 < maxwidth) {
+ // Advance the pointer to the end of the string
+ trunc_p = trunc_p + STRLEN(trunc_p);
+ }
// Fill up for half a double-wide character.
while (++width < maxwidth) {