[evolution/wip/webkit2] EHTMLEditorView - Redoing unquoting does not work



commit 925af12367775f25799f29d7aa30c0c1c7376935
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Aug 3 15:22:19 2016 +0200

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

 .../web-extension/e-editor-undo-redo-manager.c     |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c 
b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
index 9f2ef7b..10aa8ed 100644
--- a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
+++ b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
@@ -2094,8 +2094,7 @@ undo_redo_unquote (EEditorPage *editor_page,
 
        document = e_editor_page_get_document (editor_page);
 
-       if (undo)
-               restore_selection_to_history_event_state (editor_page, event->after);
+       restore_selection_to_history_event_state (editor_page, undo ? event->after : event->before);
 
        e_editor_dom_selection_save (editor_page);
        element = webkit_dom_document_get_element_by_id (
@@ -2138,9 +2137,9 @@ undo_redo_unquote (EEditorPage *editor_page,
                e_editor_dom_move_quoted_block_level_up (editor_page);
 
        if (undo)
-               restore_selection_to_history_event_state (editor_page, event->before);
-       else
                e_editor_dom_selection_restore (editor_page);
+       else
+               restore_selection_to_history_event_state (editor_page, event->after);
 
        e_editor_dom_force_spell_check_for_current_paragraph (editor_page);
 }


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