From 6df6386c3af1420d9b0d676d5b9da660ab6f99d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 12 Sep 2014 11:29:28 +0200 Subject: Restore cursor position after an undo/redo --- editor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'editor.c') 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) { -- cgit v1.2.3