As you may have noticed, when cursor is in the "virtual space" (beyond eoln), our status bar always shows the last "real" column. This small patch adds a new %v (and %V) format specification, which displays a "virtual" column number, as if the line extends to the cursor position.
sci_get_cursor_virtual_space() isn't included the plugins interface for now, though it may be useful.
Since the virtual position normally requires 3 SSM()-s, and is less likely to be used than the line and column, the calls to sci_get_cursor_virtual_space() are into add_statusbar_statistics() instead of ui_update_statusbar().
applies against 1.22, +17 loc, 0 changed/removed
Added %n for selected chars, since %s now shows the selected chars-or-lines.
for 2012-12-17+
Added %n for selected characters.
For Geany 2013-09-26+
Hi Dimitar, that looks ok, can you add doco in geany.txt to the patch as well.
Added documentation. Feel free to change it, I'm not an Englisher.
For Geany 2015-02-22+
Looks mostly good, but:
%c
and%C
work so they behave like your%v
and%V
? I don't see no real use case where they wouldn't agree and someone wouldn't prefer the virtual space value?On 25 February 2015 at 11:57, Colomban Wendling colombanw@users.sf.net wrote:
We have three virtual space options:
off - %c and %v are the same
rectangular selections only (default) - %c and %v are different, %v
is indeed useful for ensuring your selection is wide enough if you
can't see the first line in the range, at all other times %c and %v
are the same
always - %c and %v are different if the cursor is in virtual
territory, I don't use this mode but I am not sure why you would want
%c as well as %v
So to me just having %c being the column the cursor is in, virtual or
real is fine, and it makes better logical sense too.
And finally a warning that Scintilla gets it wrong in the case of
combining chars, compare (assuming the utf-8 gets through correctly):
Trögar
Trögar
Cheers
Lex
Related
Patches:
#10I'm working under Windows now, and have trouble pasting the sample "Trogar" texts. Did you mean that the SCI column fails generally, or only when displaying position in the virtual space?
On 27 February 2015 at 05:34, Dimitar Zhekov sheckley@users.sf.net wrote:
Thought that might happen :)
Scintilla gets the column count different between the two since the
first uses U+00F6 while the second uses U+006F U+0308 for the o with
diaresis
I don't think there is anything we can do with it, it was just a note
that Scintilla does not handle it properly. Also not sure it handles
double wide chars properly.
Cheers
Lex
Related
Patches:
#10Hmm, yes, I got the subject from another patch.
I, too, do not see a case where somebody will work with virtual space, but want the current %c and %C instead.
Though whoever altered %s to display the # of selected lines if entire lines are selected must thought the same, and that's why this patch contains %n... :)
Anyway, I'll post a newer version sometime after I finish with the spawn effort...
Fixed subject, moved %v / %V into %c / %C and updated the documentation.
Looks nice, but as I'm a very annoying people, I'll ask you if you don't think that as now %v is in %c, the column should be computed only once (e.g. revert the argument you had in the 1st message here, as it's now always used):
Looks better to me, and since and create_statusbar_statistics() is static, why not? Please drop me a note whether I should recreate the patch, or you will do so.
I'll merge it in your patch, that's not a problem. (unless you're not happy with this)
Committed with the small reformatting changes as [a5b99dc96dfed95bb08940e33b8ce5153f5069d5]
Related
Commit: [a5b99d]
err, of course I noticed the prototype was not inside GEANY_PRIVATE after pushing… fixed in [87af9597fc66dc87e7a5aea21d9dec91f6d4b684].
Related
Commit: [87af95]
OK, thanks.