From 45cc08a6bef1e312a45037cb7584635e6b0c3536 Mon Sep 17 00:00:00 2001 From: Tomas Popela Date: Mon, 21 Jul 2014 14:15:28 +0200 Subject: EHTMLEditorView - When writing into the citation rewrap and requote just when it is necessary --- e-util/e-html-editor-view.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c index 30f07af055..493fa74a60 100644 --- a/e-util/e-html-editor-view.c +++ b/e-util/e-html-editor-view.c @@ -738,6 +738,8 @@ body_input_event_cb (WebKitDOMElement *element, length = word_wrap_length - 2 * citation_level; if (element && citation_level > 0) { + gchar *content; + gint text_length; WebKitDOMElement *block; gboolean remove_quoting = FALSE; @@ -762,8 +764,12 @@ body_input_event_cb (WebKitDOMElement *element, block = webkit_dom_node_get_parent_element ( WEBKIT_DOM_NODE (block)); + content = webkit_dom_node_get_text_content (WEBKIT_DOM_NODE (block)); + text_length = g_utf8_strlen (content, -1); + g_free (content); + /* Wrap and quote the line */ - if (!remove_quoting) { + if (!remove_quoting && text_length >= word_wrap_length) { remove_quoting_from_element (block); block = e_html_editor_selection_wrap_paragraph_length ( -- cgit v1.2.3