[evolution/wip/webkit-composer: 283/372] Move caret to right place when return is pressed.



commit 8842de10a2ab1d0909db36155d356e7cc6de5833
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Jul 12 14:32:48 2013 +0200

    Move caret to right place when return is pressed.

 e-util/e-editor-selection.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/e-util/e-editor-selection.c b/e-util/e-editor-selection.c
index 7e8c79c..d9409bb 100644
--- a/e-util/e-editor-selection.c
+++ b/e-util/e-editor-selection.c
@@ -3183,9 +3183,13 @@ e_editor_selection_wrap_lines (EEditorSelection *selection,
                        /* If there is less than word_wrap_length characters do nothing */
                        if (g_utf8_strlen (e_editor_selection_get_string (selection), -1) < 
selection->priv->word_wrap_length) {
                                if (return_pressed) {
+                                       WebKitDOMNode *next_sibling =
+                                               webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE 
(caret_position));
+
+                                       if (WEBKIT_DOM_IS_ELEMENT (next_sibling))
+                                               move_caret_into_element (document, WEBKIT_DOM_ELEMENT 
(next_sibling));
+
                                        e_editor_selection_clear_caret_position_marker (selection);
-                                       move_caret_into_element (document, WEBKIT_DOM_ELEMENT (paragraph));
-                                       webkit_dom_dom_selection_modify (window_selection, "move", "forward", 
"character");
                                } else {
                                        e_editor_selection_restore_caret_position (selection);
                                }


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