iswalnum() vs iswspace()



Dear Sirs,

In functions of GTK+ 1.2.7

  gtkentry.c: gtk_text_move_backward_word(), gtk_move_forward_word()
  gtktext.c:  gtk_text_move_backward_word(), gtk_move_forward_word()

I propose to use    gdk_iswspace() and isspace()

instead of          gdk_iswalnum() and isalnum()

The reasons:

1. Currently UNICODE locales are supported poorly enough or
   not supported at all, so using iswspace() is safer than
   using of iswalpnum() for those whose native language is,
   for instance, Greek, Russian, etc.

2. Even if you use only pure 7-bit ascii, it looks rather clumsy to
   try double-click selecting of something like "@#$%" in the entry or
   text widget with the contents "foo foo BigFOO -- !! @#$% Next foo"
   and finding that it is "BigFOO" that is selected, not "@#$%".

So I think it would be better to treat words as something with
space delimiters.

Patches attached to this letter.

-- 
Gene

gtktext.c.diff.gz

gtkentry.c.diff.gz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]