Re: rox-edit: Fix for 'x lines selected' message

Bernard Jungen <[email protected]> Sat, 2 May 2009 14:06:11 +0200
Newsgroups gmane.comp.desktop.rox.devel
Message-ID <[email protected]>
On Sat, May 02, 2009 at 12:36:49PM +0100, Thomas Leonard wrote:
> 2009/5/1 Bernard Jungen <[email protected]>:
> > On Fri, May 01, 2009 at 07:50:41PM +0100, Thomas Leonard wrote:
> >> 2009/4/27 Bernard Jungen <[email protected]>:
> >> > At http://repo.or.cz/w/rox-edit/bju.git?a=commit;h=202e2b1945b81818685925db4ac1e8943a4b6a42
> >>
> >> "Number of lines was one too much in some special cases
> >> Added separate message for the one-line case + French translation"
> >>
> >> How can it say one line is selected? If the selection starts and ends
> >> on the same line then it displays the number of characters instead.
> >> What are the special cases where it gets it wrong?
> >
> > The code says it all. What happens if the newline is selected too? Same number
> > of characters selected? No. Two lines selected (as was printed)? No.
> >
> > The bug is obvious when you're used to select entire lines.
> 
> Before, if you selected just the newline character, it would say "2
> lines selected". Now it says "One line selected". Neither is correct,
> I think.

As long as we talk about partial lines, it is correct IMO. There's no better
message for that case.

> Perhaps we should display complete lines and extra characters, e.g.
> "One character selected" in that case, or "35 lines plus 5 characters
> selected", etc?

Perhaps. But IMO, it's not useful to have that much precision. The number of
lines gives a rough idea of what is selected, as well as a hint for block
operations. Talking of block operations, I should have fixed those too. For
instance, indenting a selection of 2 full lines now indents 3 lines, which is
obviously incorrect. And here you can't fix it by using character precision!

B.

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf