[Github-comments] [geany/geany] Number of selected characters (#745)

Colomban Wendling notifications at xxxxx
Tue Dec 25 01:11:48 UTC 2018


@elextr if it's a matter of counting columns it should be doable as Scintilla gives the column info, it's then a matter of counting how many columns are selected.

However, I'm not sure it makes much sense to count this, as some "characters" take up more than one column -- the most obvious one being the tab character, which even takes a variable amount of columns, but there are others. Counting code points might be slightly better, or rather whatever Scintilla counts as "stops", e.g. "*the number of positions the caret can be at*" (and this should be fairly easy to count, although probably in a fairly expansive way).  Or even the number of actually composited characters.  Meh, displaying symbols is so complicated.
My preference would probably go to counting the code points, regardless of their composition because that's the number of "items" stored in the file, and that's often more interesting to know in a programming context than actual rendered characters on screen; but all these informations (bytes, code points, columns, composited characters) are useful in some situations and not in others.

One fairly important information to take into account here is that Geany uses UTF-8 internally, but that does not have to be the file's encoding.  This means that the byte count in Geany does not necessarily makes sense in the target encoding -- and suggests the current info is kind of irrelevant, yet is often useful as well.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/745#issuecomment-449782788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20181224/e77526d1/attachment.html>


More information about the Github-comments mailing list