aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-html-editor-view.c
diff options
context:
space:
mode:
authorTomas Popela <tpopela@redhat.com>2014-07-15 17:05:51 +0800
committerTomas Popela <tpopela@redhat.com>2014-07-15 17:10:00 +0800
commit8939217f8dfa8a7031a953deb92597075a73db0d (patch)
tree2ae13333bb76ce6ca568538646df8fca392a065c /e-util/e-html-editor-view.c
parentbf860b3f99d7588469f16acd10f7758889e11fd1 (diff)
downloadgsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar.gz
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar.bz2
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar.lz
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar.xz
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.tar.zst
gsoc2013-evolution-8939217f8dfa8a7031a953deb92597075a73db0d.zip
EHTMLEditor - Fix indent/undent of the block
Diffstat (limited to 'e-util/e-html-editor-view.c')
-rw-r--r--e-util/e-html-editor-view.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 0df32923e2..a1db78ae64 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -2157,10 +2157,23 @@ html_editor_view_key_press_event (GtkWidget *widget,
/* BackSpace in indented block decrease indent level by one */
if (e_html_editor_selection_is_indented (selection)) {
WebKitDOMElement *caret;
+ WebKitDOMNode *prev_sibling;
caret = e_html_editor_selection_save_caret_position (selection);
- if (!webkit_dom_node_get_previous_sibling (WEBKIT_DOM_NODE (caret))) {
+ /* Empty text node before caret */
+ prev_sibling = webkit_dom_node_get_previous_sibling (
+ WEBKIT_DOM_NODE (caret));
+ if (prev_sibling && WEBKIT_DOM_IS_TEXT (prev_sibling)) {
+ gchar *content;
+
+ content = webkit_dom_node_get_text_content (prev_sibling);
+ if (g_strcmp0 (content, "") == 0)
+ prev_sibling = webkit_dom_node_get_previous_sibling (prev_sibling);
+ g_free (content);
+ }
+
+ if (!prev_sibling) {
e_html_editor_selection_clear_caret_position_marker (selection);
e_html_editor_selection_unindent (selection);
return TRUE;