Fix wrong selection handling when using Color Chooser.

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1740 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2007-07-25 08:23:17 +00:00
parent bab11250da
commit 222c4938ed
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2007-07-25 Enrico Tröger <enrico.troeger@uvena.de>
* src/document.c:
Fix wrong selection handling when using Color Chooser.
2007-07-24 Nick Treleaven <nick.treleaven@btinternet.com>
* src/plugindata.h, src/plugins.c:

View File

@ -2297,7 +2297,7 @@ void document_colourise_new()
/* Inserts the given colour (format should be #...), if there is a selection starting with 0x...
* the replacement starts also with 0x... */
* the replacement will also start with 0x... */
void document_insert_colour(gint idx, const gchar *colour)
{
g_return_if_fail(DOC_IDX_VALID(idx));
@ -2311,7 +2311,8 @@ void document_insert_colour(gint idx, const gchar *colour)
sci_get_char_at(doc_list[idx].sci, start + 1) == 'x')
{
sci_set_selection_start(doc_list[idx].sci, start + 2);
replacement++; // skip the leading '#'
sci_set_selection_end(doc_list[idx].sci, start + 8);
replacement++; // skip the leading "0x"
}
else if (sci_get_char_at(doc_list[idx].sci, start - 1) == '#')
{ // double clicking something like #00ffff may only select 00ffff because of wordchars