diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H index f548f1e4e..e30979fb0 100644 --- a/FL/Fl_Text_Buffer.H +++ b/FL/Fl_Text_Buffer.H @@ -735,19 +735,13 @@ public: */ const Fl_Text_Selection* highlight_selection() const { return &mHighlight; } - /** - Returns the index of the previous character. - \param ix index to the current character - */ - int prev_char(int ix) const; - int prev_char_clipped(int ix) const; + // Returns the index of the previous character. + int prev_char(int pos) const; + int prev_char_clipped(int pos) const; - /** - Returns the index of the next character. - \param ix index to the current character - */ - int next_char(int ix) const; - int next_char_clipped(int ix) const; + // Returns the index of the next character. + int next_char(int pos) const; + int next_char_clipped(int pos) const; /** Align an index into the buffer to the current or previous UTF-8 boundary. diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 70d55728e..22b667d39 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -2092,14 +2092,16 @@ int Fl_Text_Buffer::prev_char_clipped(int pos) const /** - Returns the index of the previous character. - This function processes an emoji sequence (see \ref fl_utf8_next_composed_char) as a single character. - Returns -1 if the beginning of the buffer is reached. - \param pos index to the current character - */ -int Fl_Text_Buffer::prev_char(int pos) const -{ - if (pos==0) return -1; + Returns the index of the previous character. + This function processes an emoji sequence (see \ref fl_utf8_next_composed_char) + as a single character. + \param[in] pos index of the current character + \return index of the previous character + \retval -1 if the beginning of the buffer is reached. +*/ +int Fl_Text_Buffer::prev_char(int pos) const { + if (pos == 0) + return -1; return prev_char_clipped(pos); }