SF.net SVN: geany: [2309] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Thu Mar 6 15:47:44 UTC 2008


Revision: 2309
          http://geany.svn.sourceforge.net/geany/?rev=2309&view=rev
Author:   eht16
Date:     2008-03-06 07:47:43 -0800 (Thu, 06 Mar 2008)

Log Message:
-----------
Apply patch from Jeff Pohlmeyer (thanks) to fix toggle case with rectangular selections (works only for Ascii characters).      

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-03-05 18:18:19 UTC (rev 2308)
+++ trunk/ChangeLog	2008-03-06 15:47:43 UTC (rev 2309)
@@ -1,3 +1,10 @@
+2008-03-06  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/callbacks.c:
+   Apply patch from Jeff Pohlmeyer (thanks) to fix toggle case with
+   rectangular selections (works only for Ascii characters).
+
+
 2008-03-05  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * src/filetypes.c, src/filetypes.h, src/symbols.c:

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2008-03-05 18:18:19 UTC (rev 2308)
+++ trunk/src/callbacks.c	2008-03-06 15:47:43 UTC (rev 2309)
@@ -931,24 +931,43 @@
 
 	if (sci_can_copy(sci))
 	{
-		gchar *result;
+		gchar *result = NULL;
+		gint cmd;
 		gint text_len = sci_get_selected_text_length(sci);
+		gboolean rectsel = scintilla_send_message(sci, SCI_SELECTIONISRECTANGLE, 0, 0);
 
 		text = g_malloc(text_len + 1);
 		sci_get_selected_text(sci, text);
 
 		if (utils_str_has_upper(text))
-			result = g_utf8_strdown(text, -1);
+        {
+			if (rectsel)
+				cmd = SCI_LOWERCASE;
+			else
+				result = g_utf8_strdown(text, -1);
+
+		}
 		else
-			result = g_utf8_strup(text, -1);
+		{
+			if (rectsel)
+				cmd = SCI_UPPERCASE;
+			else
+				result = g_utf8_strup(text, -1);
 
-		sci_replace_sel(sci, result);
+		}
 
-		g_free(result);
+		if (result != NULL)
+		{
+			sci_replace_sel(sci, result);
+			g_free(result);
+			if (keep_sel)
+				sci_set_selection_start(sci, sci_get_current_position(sci) - text_len + 1);
+		}
+		else
+			sci_cmd(sci, cmd);
+
 		g_free(text);
 
-		if (keep_sel)
-			sci_set_selection_start(sci, sci_get_current_position(sci) - text_len + 1);
 	}
 }
 


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