diff options
author | Tomas Popela <tpopela@redhat.com> | 2016-02-12 10:48:35 +0100 |
---|---|---|
committer | Tomas Popela <tpopela@redhat.com> | 2016-02-12 11:00:34 +0100 |
commit | aa11344b4f684fa9288a11e78d55310932e084b4 (patch) | |
tree | d008a42ea25eb69b8e65e80dadeea1ba26f78fd5 | |
parent | fef9944bd5973110b54c66676ae0e54ac5f66747 (diff) | |
download | evolution-aa11344b4f684fa9288a11e78d55310932e084b4.tar.gz |
EHTMLEditorView - Pressing the Return key in the beginning of list item will delete the item
First check if there is something after the selection end, if nothing move to the
selection start, not in reversed order.
-rw-r--r-- | e-util/e-html-editor-view.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 743437e9da..ae08c79ff1 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -5397,6 +5397,19 @@ selection_is_in_empty_list_item (WebKitDOMNode *selection_start_marker) sibling = webkit_dom_node_get_previous_sibling (WEBKIT_DOM_NODE (selection_start_marker)); + /* Selection needs to be collapsed. */ + sibling = webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (selection_start_marker)); + if (!e_html_editor_node_is_selection_position_node (sibling)) + return FALSE; + + /* After the selection end there could be just the BR element. */ + sibling = webkit_dom_node_get_next_sibling (sibling); + if (sibling && !WEBKIT_DOM_IS_HTMLBR_ELEMENT (sibling)) + return FALSE; + + if (sibling && webkit_dom_node_get_next_sibling (sibling)) + return FALSE; + if (!sibling) return TRUE; @@ -5418,19 +5431,6 @@ selection_is_in_empty_list_item (WebKitDOMNode *selection_start_marker) g_free (text); - /* Selection needs to be collapsed. */ - sibling = webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (selection_start_marker)); - if (!e_html_editor_node_is_selection_position_node (sibling)) - return FALSE; - - /* After the selection end there could be just the BR element. */ - sibling = webkit_dom_node_get_next_sibling (sibling); - if (sibling && !WEBKIT_DOM_IS_HTMLBR_ELEMENT (sibling)) - return FALSE; - - if (sibling && webkit_dom_node_get_next_sibling (sibling)) - return FALSE; - return TRUE; } |