[gedit] Fixed moving to next line when iter is at line end



commit c378a5aafca0b9904dec7ab3fb058b1ec4527959
Author: Jesse van den Kieboom <jvanden grijpc10 epfl ch>
Date:   Mon May 11 10:16:38 2009 +0200

    Fixed moving to next line when iter is at line end
    
    forward_line_end will of course move to the _next_
    line if the iter is already at the end of the line
---
 plugins/snippets/snippets/Helper.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/plugins/snippets/snippets/Helper.py b/plugins/snippets/snippets/Helper.py
index 1908527..debd47b 100644
--- a/plugins/snippets/snippets/Helper.py
+++ b/plugins/snippets/snippets/Helper.py
@@ -163,7 +163,9 @@ def buffer_line_boundary(buf):
         iter = buf.get_iter_at_mark(buf.get_insert())
         start = iter.copy()
         start.set_line_offset(0)
-        iter.forward_to_line_end()
+        
+        if not iter.ends_line():
+                iter.forward_to_line_end()
         
         return (start, iter)
 



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