SF.net SVN: geany:[4179] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Sun Sep 13 11:23:14 UTC 2009


Revision: 4179
          http://geany.svn.sourceforge.net/geany/?rev=4179&view=rev
Author:   ntrel
Date:     2009-09-13 11:23:14 +0000 (Sun, 13 Sep 2009)

Log Message:
-----------
Fix 'Reflow block' command when at the last paragraph and there's
no last newline (patch by Eugene Arshinov, thanks).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/keybindings.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-09-12 17:39:49 UTC (rev 4178)
+++ trunk/ChangeLog	2009-09-13 11:23:14 UTC (rev 4179)
@@ -1,3 +1,10 @@
+2009-09-13  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c:
+   Fix 'Reflow block' command when at the last paragraph and there's
+   no last newline (patch by Eugene Arshinov, thanks).
+
+
 2009-09-12  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/keybindings.c, src/sciwrappers.c, src/sciwrappers.h,

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2009-09-12 17:39:49 UTC (rev 4178)
+++ trunk/src/keybindings.c	2009-09-13 11:23:14 UTC (rev 4179)
@@ -2101,8 +2101,12 @@
 		/* deselect last line break */
 		pos = sci_get_selection_end(sci);
 		line = sci_get_line_from_position(sci, pos);
-		pos = sci_get_line_end_position(sci, line - 1);
-		sci_set_selection_end(sci, pos);
+		if (line < sci_get_line_count(sci) - 1)
+		{
+			/* not last line */
+			pos = sci_get_line_end_position(sci, line - 1);
+			sci_set_selection_end(sci, pos);
+		}
 	}
 	split_lines(editor);
 	if (!sel)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list