[gedit-plugins] Fix Joinlines to always leave only a single space



commit 0d87182a64dc1b85753db5c180b5e4c71189178f
Author: Daniel Falk <daniel the22nd net>
Date:   Mon Nov 29 20:22:10 2010 -0500

    Fix Joinlines to always leave only a single space

 plugins/joinlines/joinlines.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/plugins/joinlines/joinlines.py b/plugins/joinlines/joinlines.py
index ec90e8f..670d830 100644
--- a/plugins/joinlines/joinlines.py
+++ b/plugins/joinlines/joinlines.py
@@ -103,6 +103,11 @@ def join_lines(window):
     if not start.ends_line():
         start.forward_to_line_end()
 
+    # Include trailing spaces in the chunk to be removed
+    while start.backward_char() and start.get_char() in ('\t', ' '):
+        pass
+    start.forward_char()
+
     while doc.get_iter_at_mark(end_mark).compare(start) == 1:
         end = start.copy()
         while end.get_char() in ('\r', '\n', ' ', '\t'):



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