[evolution] EHTMLEditorView - Undoing and redoing Return press in the beginning of citation is wrong



commit 364712f69528874fd47620739bc75ec40b39b469
Author: Tomas Popela <tpopela redhat com>
Date:   Sun Dec 6 14:56:55 2015 +0100

    EHTMLEditorView - Undoing and redoing Return press in the beginning of citation is wrong

 e-util/e-html-editor-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 11cfe41..cb4e2c5 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -14267,7 +14267,7 @@ undo_redo_citation_split (EHTMLEditorView *view,
 
                parent = get_parent_block_element (WEBKIT_DOM_NODE (selection_start));
 
-               if (event->data.fragment &&
+               if (!event->data.fragment ||
                    !webkit_dom_node_get_first_child (WEBKIT_DOM_NODE (event->data.fragment))) {
                        remove_node (WEBKIT_DOM_NODE (parent));
                        merge_siblings_if_necessary (document, NULL);
@@ -14346,6 +14346,8 @@ undo_redo_citation_split (EHTMLEditorView *view,
 
                e_html_editor_view_force_spell_check_in_viewport (view);
        } else {
+               restore_selection_to_history_event_state (view, event->before);
+
                if (in_situ) {
                        WebKitDOMElement *selection_start_marker;
                        WebKitDOMNode *block;


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