<div dir="ltr">Yeah, there are a number of variables that seem to be reset on edit-sequences. Another one that may or may not be related to this same variable is when esc;y works.<div><br></div><div>Robby</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, Sep 14, 2013 at 4:03 PM, Neil Toronto <span dir="ltr"><<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I appreciate your work on this, and also how tiny the test case is. :)<br>
<br>
If it helps - and it may just confirm your theories - I've noticed that when the bad behavior happens, CTRL-Z undoes single keystrokes.<div><div class="h5"><br>
<br>
On 09/14/2013 02:00 PM, Robby Findler wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
A little more progress: it turns out that simply turning on and turning<br>
off an edit-sequence in a text% object clears some internal state in a<br>
text% object (the extend-streak? field) and, when the search bars are<br>
open, more edit sequences are flying around. That seems wrong to me<br>
(that starting and ending an edit-sequence would clear this state), but<br>
I'm not sure if the answer can be as simple as avoiding this<br>
state-clearing action or not. Anyways, here's some simple code that<br>
demonstrates how far I've gotten.<br>
<br>
<br>
#lang racket/base<br>
(require rackunit racket/class racket/gui/base)<br>
<br>
(check-equal? (let ()<br>
(define t (new text%))<br>
(send t insert "abcdef")<br>
(send t set-position 3 3)<br>
(send t move-position 'right #t)<br>
(send t move-position 'left #t)<br>
(list (send t get-start-position)<br>
(send t get-end-position)))<br>
(list 3 3))<br>
<br>
<br>
(check-equal? (let ()<br>
(define t (new text%))<br>
(send t insert "abcdef")<br>
(send t set-position 3 3)<br>
(send t move-position 'right #t)<br>
(send t begin-edit-sequence)<br>
(send t end-edit-sequence)<br>
(send t move-position 'left #t)<br>
(list (send t get-start-position)<br>
(send t get-end-position)))<br>
(list 3 3))<br>
<br>
Robby<br>
<br>
<br>
<br>
On Sat, Sep 14, 2013 at 12:43 PM, Neil Toronto <<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a><br></div></div><div><div class="h5">
<mailto:<a href="mailto:neil.toronto@gmail.com" target="_blank">neil.toronto@gmail.com</a><u></u>>> wrote:<br>
<br>
Yes! You figured it out! This has been bugging me for months.<br>
<br>
Here's more info, in case it helps. In addition to SHIFT+Left,<br>
SHIFT+Right, SHIFT+Up and SHIFT+Down always expanding the selection<br>
when Replace is shown, so does SHIFT-End, and all the SHIFT+ALT<br>
arrow combos and SHIFT+CTRL combos. SHIFT-Home only works when the<br>
selection doesn't span multiple lines.<br>
<br>
If the Search box is empty, selection works as expected. (That is,<br>
getting in this always-expanding-selection or<br>
caret-position-forgetting state requires the Replace box to be shown<br>
and the Search box to have text in it.) If the Search box has text<br>
in it, it doesn't matter whether it's found. I'm guessing there's<br>
some caret-wrangling code for the search bar that causes the editor<br>
to forget the caret position while selecting.<br>
<br>
Selection in the REPL also seems to be affected by Search and<br>
Replace in exactly the same way. (I haven't tested it thoroughly.)<br>
<br>
We should have Eli test this because he's had the same problem.<br>
IIRC, he uses Linux, and so do I: I've seen this on Ubuntu 12.04 and<br>
13.04.<br>
<br>
Neil ⊥<br>
<br>
<br>
On 09/14/2013 08:20 AM, bhrgunatha wrote:<br>
<br>
After lots of head scratching and experimenting I have a<br>
consistent cause.<br>
<br>
It seems like the Search and Replace bar causes some problem.<br>
It is only happening when the Replace text box is visible.<br>
<br>
This weird behaviour disappears if the I click the Hide Replace<br>
button<br>
or choose Hide Replace from the Edit menu.<br>
<br>
I've also noticed that S:C:R stops working after the Replace<br>
text box<br>
and buttons have disappeared. That is I can't Hide, then Re show the<br>
Replace text box.<br>
<br>
I hope that helps you fix the problem, but I'm pretty happy now<br>
I know<br>
how to get the correct operation back again.<br>
<br>
Thanks,<br>
Bhrgunatha<br>
<br>
<br>
On 14/09/13 20:04, Robby Findler wrote:<br>
<br>
This sounds like a bug in the implementation of the<br>
shift-left and<br>
shift-right keybindings.<br>
<br>
If you can give some kind of a step by step procedure to get<br>
into the<br>
bad state, then I think we can probably fix it.<br>
<br>
Robby<br>
<br>
<br>
<br>
On Sat, Sep 14, 2013 at 6:16 AM, bhrgunatha<br>
<<a href="mailto:bhrgunatha@hotmail.com" target="_blank">bhrgunatha@hotmail.com</a> <mailto:<a href="mailto:bhrgunatha@hotmail.com" target="_blank">bhrgunatha@hotmail.com</a><u></u>><br></div></div>
<mailto:<a href="mailto:bhrgunatha@hotmail.com" target="_blank">bhrgunatha@hotmail.com</a><div><div class="h5"><br>
<mailto:<a href="mailto:bhrgunatha@hotmail.com" target="_blank">bhrgunatha@hotmail.com</a><u></u>>__>> wrote:<br>
<br>
I'm having a problem editing programs using DrRacket.<br>
This happened<br>
once before but went away after re-installing. [1].<br>
<br>
I'm having the same issue again. Basically the<br>
behaviour of text<br>
selection is changes while I open and edit different<br>
files running a<br>
single instance of DrRacket.<br>
<br>
If I select some text and then press SHIFT+Left instead<br>
of altering<br>
the selection based on the current cursor position, the<br>
selection is<br>
extended left from the beginning of the text currently<br>
selected.<br>
<br>
Similarly for SHIFT+Right - it extends the text<br>
selection one<br>
character to the right from the end of the selection<br>
rather than the<br>
current cursor position. Same for SHIFT+Down, SHIFT+Up.<br>
<br>
Is there some key binding or setting in DrRacket that<br>
controls the<br>
way text selection is handled that I am accidentally<br>
hitting?<br>
<br>
It doesn't happen in any other editor - it's specific<br>
to DrRacket.<br>
<br>
If I quit DrRacket and re-open it normal operation<br>
continues for a<br>
while again. I don't know if it's a bug or some setting<br>
in DrRacket<br>
that I am unaware of.<br>
<br>
My current specs are:<br>
Arch Linux 64 bit:<br>
Linux 3.10.10-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux<br>
<br>
DrRacket 5.3.6.<br>
(This is a version I compiled myself - but it's the<br>
same using the<br>
Arch binary package - racket 5.3.6-1)<br>
<br>
Can someone offer any advice?<br>
<br>
Bhrgunatha<br>
<br>
[1]<br>
<br></div></div>
<a href="http://article.gmane.org/____gmane.comp.lang.racket.user/____17034/match=bhrgunatha" target="_blank">http://article.gmane.org/____<u></u>gmane.comp.lang.racket.user/__<u></u>__17034/match=bhrgunatha</a><br>
<<a href="http://article.gmane.org/__gmane.comp.lang.racket.user/__17034/match=bhrgunatha" target="_blank">http://article.gmane.org/__<u></u>gmane.comp.lang.racket.user/__<u></u>17034/match=bhrgunatha</a>><div class="im">
<br>
<br>
<br>
<<a href="http://article.gmane.org/__gmane.comp.lang.racket.user/__17034/match=bhrgunatha" target="_blank">http://article.gmane.org/__<u></u>gmane.comp.lang.racket.user/__<u></u>17034/match=bhrgunatha</a><br>
<<a href="http://article.gmane.org/gmane.comp.lang.racket.user/17034/match=bhrgunatha" target="_blank">http://article.gmane.org/<u></u>gmane.comp.lang.racket.user/<u></u>17034/match=bhrgunatha</a>>><br>
<br>
____________________<br>
Racket Users list:<br></div>
<a href="http://lists.racket-lang.org/____users" target="_blank">http://lists.racket-lang.org/_<u></u>___users</a><br>
<<a href="http://lists.racket-lang.org/__users" target="_blank">http://lists.racket-lang.org/<u></u>__users</a>><div class="im"><br>
<<a href="http://lists.racket-lang.org/__users" target="_blank">http://lists.racket-lang.org/<u></u>__users</a><br>
<<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a>>><br>
<br>
<br>
<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/__users" target="_blank">http://lists.racket-lang.org/_<u></u>_users</a><br>
<<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a>><br>
<br>
<br>
____________________<br>
Racket Users list:<br></div>
<a href="http://lists.racket-lang.org/__users" target="_blank">http://lists.racket-lang.org/_<u></u>_users</a><br>
<<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a>><br>
<br>
<br>
</blockquote>
<br>
</blockquote></div><br></div>