Fix documentation of Fl_Input_::word_start() and word_end().

Documentation changes in svn r10383 (STR #3014) said that this would skip
"space-separated" words, which is not true.

Note: The set of word separators is currently not documented, it is
inconsistent with Fl_Text_Display/Fl_Text_Editor, and not UTF-8-aware.
Also, word selection and the above methods use different word delimiters.
This should be fixed in a later release (after 1.3.3).


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10394 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2014-10-27 12:49:47 +00:00
parent ffdc36dcb6
commit 6b6f375af0

View File

@ -419,7 +419,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
/** \internal
Simple function that determines if a character could be part of a word.
\todo This function is not ucs4-aware.
\todo This function is not UTF-8-aware.
*/
static int isword(char c) {
return (c&128 || isalnum(c) || strchr("#%&-/@\\_~", c));
@ -428,9 +428,10 @@ static int isword(char c) {
/**
Finds the end of a word.
Returns the index after the last byte of a space-separated word. This
first skips spaces, and then non-spaces, so if you call it repeatedly
you will move forwards to the end of the text.
Returns the index after the last byte of a word.
If the index is already at the end of a word, it will find the
end of the following word, so if you call it repeatedly you will
move forwards to the end of the text.
Note that this is inconsistent with line_end().
@ -447,8 +448,8 @@ int Fl_Input_::word_end(int i) const {
/**
Finds the start of a word.
Returns the index of the first byte of a space-separated word.
If the index is already at the beginning of the word, it will find the
Returns the index of the first byte of a word.
If the index is already at the beginning of a word, it will find the
beginning of the previous word, so if you call it repeatedly you will
move backwards to the beginning of the text.