on windows with geany 0.17
If you select a text with 'special chars' like 'é' you will see in status bar (in french) 'sel: 2' but there is only one char selected !
As far as I know this is a known issue with Unicode files in early versions of Geany. Unicode chars need two bytes for displaying a char. If I remember correctly this got fixed in Geany 0.18, so updating your Geany installation is recommended.
I can confirm this still happens with Geany SVN.
I'm not sure it's worth fixing this.
If we would want ot fix this, we probably would need to analyse the string to check each byte whether it is a full character or part of a multibyte character. While this is quite easy to implement, it would mean to retrieve and iterate over the selection on each status bar update which happens quite often.
Imagine one selects a whole bunch of lines or even the whole file using Edit->Select all, then Geany would have to load this whole string into the memory, analyse it and discard it again, just to get the character count.
While thinking about it, we don't need to copy the selection into the memory but still we would need to iterate over it.
Hmm, I was wrong again. We do need to retrieve the selected text (i.e. copy it into memory) to analyse it.
Maybe this could be implemented in Scintilla itself as there the access to the selected should be cheaper but the basic problem persists.
The cost of retrieving and analysing the text is too great to perform it on every change of selection. Note that not just detection of Unicode code points but characters made with multiple code points is needed.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.