aboutsummaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-12 11:29:28 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-12 11:29:28 +0200
commit6df6386c3af1420d9b0d676d5b9da660ab6f99d4 (patch)
treee9b717be17c69d090b9cd1d2fda6841620407819 /editor.c
parentbc8ad2d9e83096685dac4a7af3b1080b012eb24d (diff)
downloadvis-6df6386c3af1420d9b0d676d5b9da660ab6f99d4.tar.gz
vis-6df6386c3af1420d9b0d676d5b9da660ab6f99d4.tar.xz
Restore cursor position after an undo/redo
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor.c b/editor.c
index 455f3ae..ad3da53 100644
--- a/editor.c
+++ b/editor.c
@@ -484,7 +484,8 @@ static void editor_prompt_update(Prompt *prompt) {
static void editor_prompt_clear(Prompt *prompt) {
Text *text = prompt->win->text;
- while (text_undo(text));
+ while (text_undo(text) != (size_t)-1);
+ window_cursor_to(prompt->win->win, 0);
}
void editor_prompt_hide(Editor *ed) {