SF.net SVN: geany:[4309] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Wed Oct 14 11:46:57 UTC 2009


Revision: 4309
          http://geany.svn.sourceforge.net/geany/?rev=4309&view=rev
Author:   ntrel
Date:     2009-10-14 11:46:56 +0000 (Wed, 14 Oct 2009)

Log Message:
-----------
Don't include trailing newlines when using reflow command.

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-10-13 17:14:25 UTC (rev 4308)
+++ trunk/ChangeLog	2009-10-14 11:46:56 UTC (rev 4309)
@@ -1,3 +1,9 @@
+2009-10-14  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c:
+   Don't include trailing newlines when using reflow command.
+
+
 2009-10-13  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/notebook.c, src/plugindata.h, src/plugins.c, src/ui_utils.c,

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2009-10-13 17:14:25 UTC (rev 4308)
+++ trunk/src/keybindings.c	2009-10-14 11:46:56 UTC (rev 4309)
@@ -2086,8 +2086,15 @@
 
 static void split_lines(GeanyEditor *editor, gint column)
 {
-	gint start, indent, linescount, i;
+	gint start, indent, linescount, i, end;
+	gchar c;
+	ScintillaObject *sci = editor->sci;
 
+	/* don't include trailing newlines */
+	end = sci_get_selection_end(sci);
+	while ((c = sci_get_char_at(sci, end - 1)) == '\n' || c == '\r') end--;
+	sci_set_selection_end(sci, end);
+
 	start = sci_get_line_from_position(editor->sci,
 		sci_get_selection_start(editor->sci));
 


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