From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <428709c7c0e009b4dabf5f742afc1b09@kw.quanstro.net> Date: Mon, 19 Apr 2010 17:02:02 +0100 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] +- in acme Topicbox-Message-UUID: 091487c2-ead6-11e9-9d60-3106f5b1d025 this seems like a bug to me - it doesn't follow the description in the manual page. the end of the empty selection at the start of a line is surely within that line. i had a look at the code, and was surprised by the fact that the logic appears to implemented in two places; middle clicking "Edit +" executes lineaddr() where right clicking ":+" goes through number(). in both cases, the code checks whether the character 1 before the end of the selection is '\n' which only works if the selection is non-null. a simple fix in lineaddr might look like this: if(sign=3D=3D0 || addr.r.q1=3D=3D0){ p =3D 0; n =3D 1; }else if(addr.r.q1 > addr.r.q0){ p =3D addr.r.q1-1; n =3D textreadc(f->curtext, p++)=3D=3D'\n'; }else{ p =3D addr.r.q0; n =3D 0; } this issue is made more awkward by the fact that the selection at the start of a line is included when the line before it is entirely selected - in some sense it's actually in both lines. i think it's worth adding a special case for the null selection, but others' mileages may vary. On 19 April 2010 13:59, Rudolf Sykora wrote: >> the idiom is -+ =C2=A0try + then - one-at-a-time and you'll see why. >> >> - erik >> > > Well, ok, -+ works in any case, so it's actually what I usually need. > Still I don't fully understand. > The man page says: > > Some useful idioms: a1+- (a1-+) selects > the line containing the end (beginning) of a1. > > Isn't it that an empty dot has the same beginning and end? > Isn't it that my dot (here place 'just before the beginning 'I' of > this sentence) is on the same line as the 'I' itself? > Moreover, even if the beginning and end wouldn't be identical for my > case, I'd still expect that the beginning is before the end... (so > that +- would have a better chance to match my line!). > > Thanks > Ruda > >