New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number of selected characters #745
Comments
The column counts in glyphs, the selection counts in octets. You do not provide information on what the second entity is, so I'm assuming its code point 1d41a, which has a four octet encoding in UTF-8 which is what the buffer uses. The manual should be updated to not describe the selection as "characters" since that only applys to ASCII. |
Could you please show both bytes and characters counts in the status bar? It is essential for non-english texts. |
@andreysm whats a character? |
One symbol. Let's just count how many positions they occupy, i.e. sum selected columns for each row. |
So glyphs, the Scintilla editing component doesn't supply that to Geany, but if someone wrote the code to request glyph counts from Scintilla and added them up for multiple lines counting/not counting line ends and noting that tab characters count as multiple glyphs then it can be another display item for the status bar. But it would probably be better to make a separate issue rather than hijack a three year old one. |
@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. 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. |
Thats what I said :)
ditto :)
But we are talking about the selection, not anything in a file
Yep, which is the obvious problem with this sort of thing, too many possibilities, but for the selection I'm doubtful any of them are really useful for any common use-case.
or the encoding of whatever you paste the selection into, IIUC it can be re-encoded when pasted, particularly on Windows. And counting code points is fine, but what does it give you? Don't forget those combining characters Europeans like to use for their accented characters, two code points for one glyph :) But if @andreysm has a specific use-case that needs one or other count then it should be no trouble to accept a well written pull request from somebody to add another % code to the status bar, nobody needs to show it if they don't want to. |
When I select one character, the selection count and the column number are correct, but when I extend the selection by one character, the selection increases by 4 not 1, although the column number only increases by the expected value of 1. The information provided in the status bar by Geany is often very useful.
The text was updated successfully, but these errors were encountered: