- The following code snippet safely returns the character at the insertion
- point or the zero character if the point is at the end of the control.
+ Notice that insertion position is, in general, different from the index
+ of the character the cursor position at in the string returned by
+ GetValue(). While this is always the case for the single line controls,
+ multi-line controls can use two characters @c "\\r\\n" as line
+ separator (this is notably the case under MSW) meaning that indices in
+ the control and its string value are offset by 1 for every line.
+
+ Hence to correctly get the character at the current cursor position,
+ taking into account that there can be none if the cursor is at the end
+ of the string, you could do the following: