summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9bc6698)
raw | patch | inline | side by side (parent: 9bc6698)
author | Max Kellermann <max@duempel.org> | |
Mon, 6 Oct 2008 14:55:35 +0000 (16:55 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 6 Oct 2008 14:55:35 +0000 (16:55 +0200) |
After a byte has been inserted, move the cursor right by just one
byte, not one character. The byte may have been the first one in a
multibyte character.
byte, not one character. The byte may have been the first one in a
multibyte character.
src/wreadln.c | patch | blob | history |
diff --git a/src/wreadln.c b/src/wreadln.c
index 89bcc123ce371de17e06b2d9f529755b76ed3ca4..926f223b7fcdc031347cb811370be1a7fdf920cb 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
wr->line + wr->cursor, rest);
wr->line[wr->cursor] = key;
- cursor_move_right(wr);
+ wr->cursor += length;
+ if (wr->cursor >= (size_t)wr->width &&
+ wr->start < wr->cursor - wr->width + 1)
+ wr->start += length;
}
static void