[geary] Composer address bar: prevent doubling spaces after address autocomplete



commit 5045ff044309b0f82831fabd2fbb75b74c670b85
Author: Timo Kluck <tkluck infty nl>
Date:   Thu Sep 24 22:21:11 2015 +0200

    Composer address bar: prevent doubling spaces after address autocomplete
    
    The composer splits addresses on "," and later joins them on ", ". This means
    that separating spaces are doubled after every autocomplete. This patch fixes
    that by stripping whitespace after splitting. We do this in a separate loop at
    the end of the function as opposed to directly after splitting in order not to
    upset the cursor positioning logic.
    
    This does not fix the problem that an address like
    
        "Kluck, Timo" <tkluck infty nl>
    
    are split on the comma. Before this patch, the space would be doubled.  After
    this patch, it will always be reduced to a single space. A better solution
    would ideally leave the quoted part as-is. I think this will also lead to
    better auto-complete behaviour when the cursor is in the quoted part.  Better
    parsing of the quoted part is beyond the scope of this patch.

 src/client/composer/contact-entry-completion.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/client/composer/contact-entry-completion.vala 
b/src/client/composer/contact-entry-completion.vala
index faced54..3685711 100644
--- a/src/client/composer/contact-entry-completion.vala
+++ b/src/client/composer/contact-entry-completion.vala
@@ -130,6 +130,9 @@ public class ContactEntryCompletion : Gtk.EntryCompletion {
             }
             bytes_seen_so_far += token_bytes;
         }
+        for (int i = 0; i < addresses.size; i++) {
+            addresses[i] = addresses[i].strip();
+        }
         
         return addresses;
     }


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