Apply patch from Jeff Pohlmeyer (thanks) to fix toggle case with rectangular selections (works only for Ascii characters).
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@2309 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
9dd67b2669
commit
eba6d2c91e
@ -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:
|
||||
|
@ -931,24 +931,43 @@ void on_toggle_case1_activate(GtkMenuItem *menuitem, gpointer user_data)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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(result);
|
||||
g_free(text);
|
||||
|
||||
if (keep_sel)
|
||||
sci_set_selection_start(sci, sci_get_current_position(sci) - text_len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user