[evolution] EHTMLEditorView - Redoing unquoting does not work



commit 2e149a8091a594bc6cadeaad9752a2febea6f38a
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Aug 3 15:15:37 2016 +0200

    EHTMLEditorView - Redoing unquoting does not work
    
    Correctly restore caret position before and after the undo and redo actions.

 e-util/e-html-editor-view.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 178965c..02f32fe 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -14954,8 +14954,7 @@ undo_redo_unquote (EHTMLEditorView *view,
        selection = e_html_editor_view_get_selection (view);
        document = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view));
 
-       if (undo)
-               restore_selection_to_history_event_state (view, event->after);
+       restore_selection_to_history_event_state (view, undo ? event->after : event->before);
 
        e_html_editor_selection_save (selection);
        element = webkit_dom_document_get_element_by_id (
@@ -14998,9 +14997,9 @@ undo_redo_unquote (EHTMLEditorView *view,
                move_quoted_block_level_up (view);
 
        if (undo)
-               restore_selection_to_history_event_state (view, event->before);
-       else
                e_html_editor_selection_restore (selection);
+       else
+               restore_selection_to_history_event_state (view, event->after);
 
        e_html_editor_view_force_spell_check_for_current_paragraph (view);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]