[geany/geany-plugins] f76f80: pohelper: Properly break all multiline strings on multiple lines

Colomban Wendling git-noreply at xxxxx
Mon Feb 19 06:22:41 UTC 2018


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 19 Feb 2018 06:22:41 UTC
Commit:      f76f801ce19bb24b70b4fd424498a408dec20d67
             https://github.com/geany/geany-plugins/commit/f76f801ce19bb24b70b4fd424498a408dec20d67

Log Message:
-----------
pohelper: Properly break all multiline strings on multiple lines

If a string contains an explicit newline, properly break it onto
multiple lines even if it would fit on a single line.


Modified Paths:
--------------
    pohelper/src/gph-plugin.c

Modified: pohelper/src/gph-plugin.c
5 lines changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -951,8 +951,9 @@ on_kb_reflow (guint key_id)
                               (uptr_t) start, end + 1 - start);
       
       msgstr_kw_len = start - sci_get_position_from_line (sci, sci_get_line_from_position (sci, start));
-      if (msgstr_kw_len + len + 2 <= line_len) {
-        /* if all can go in the msgstr line, put it here */
+      if (msgstr_kw_len + len + 2 <= line_len &&
+          find_line_break (msgstr->str) == NULL) {
+        /* if all can go in the msgstr line and there's no newline, put it here */
         gchar *text = g_strconcat ("\"", msgstr->str, "\"", NULL);
         sci_insert_text (sci, start, text);
         g_free (text);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list