# HG changeset patch # User Sean Egan # Date 1020560775 0 # Node ID 2215aa4fabdbab512e2554c7a008d24145456a56 # Parent 75912ec1a1cb7630c8acf46036e2c9e2fcd64676 [gaim-migrate @ 3225] Better detection of words in gtkimhtml selection by Ben Miller committer: Tailor Script diff -r 75912ec1a1cb -r 2215aa4fabdb ChangeLog --- a/ChangeLog Sat May 04 19:06:01 2002 +0000 +++ b/ChangeLog Sun May 05 01:06:15 2002 +0000 @@ -12,6 +12,7 @@ (Thanks, Ari Pollak) * Added helpful stuff to the Help menu. * Self-aliasing from the account editor. + * Better selection in GtkIMHtml (Thanks Ben Miller) version 0.57 (04/25/2002): * New authorization method for Yahoo! diff -r 75912ec1a1cb -r 2215aa4fabdb src/gtkimhtml.c --- a/src/gtkimhtml.c Sat May 04 19:06:01 2002 +0000 +++ b/src/gtkimhtml.c Sun May 05 01:06:15 2002 +0000 @@ -1178,14 +1178,32 @@ start = chunk->sel_start; end = chunk->sel_end; - if (start != chunk->text) - while (start > chunk->text && *(start-1) != ' ') - start--; + if (start != chunk->text) { + if (isalnum(*start) || *start == '\'') + while (start > chunk->text && + (isalnum(*(start-1)) || *(start-1) == '\'')) + start--; + else if (isspace(*start)) + while (start > chunk->text && isspace(*(start-1))) + start--; + else if (ispunct(*start)) + while (start > chunk->text && ispunct(*(start-1))) + start--; + } chunk->sel_start = start; - if (end != NULL) - while (*end != '\0' && *end != ' ') - end++; + if (end != NULL) { + if (isalnum(*end) || *end == '\'') + while (*end != '\0' && + (isalnum(*end) || *end == '\'')) + end++; + else if (isspace(*end)) + while (*end != '\0' && isspace(*end)) + end++; + else if (ispunct(*end)) + while (*end != '\0' && ispunct(*end)) + end++; + } chunk->sel_end = end; }