You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Strange selection problem in latest master version #8369
I select some text, press r (or some other key), and the selected text is replaced with r, but the selection stays behind and is now selecting some other text. I'm in safe mode, Atom 1.0.8-469662a, OSX 10.10.4.
@nathansobo@benogle@maxbrunsfeld Any of you seeing the same thing and know what might be up? Doesn't happen on all selections but it seems to always happen when there's some text like foo bar, baz, and then I drag-select bar (up to but not including the ,), and then press a key to replace the selection.
This issue seems very related to #5200 and #5243. I run into this issue a lot, and it's a pretty big inconvenience. I'm surprised that this bug has made it so far.
I've been running into this multiple times an hour lately (but interestingly, I haven't run into this really at home, just at work). Would be awesome if someone could take a look at this soon. 🙇
@mnquintana I can't reproduce it so any information you can give us about the internal state of the editor, sections, the marker index would be helpful. I'll even screen share with you when it happens tomorrow if you have time.
@izuzak Oh, wow. With that example, I'm able to reproduce the issue quite a bit. Out of 25 tries, I was able to reproduce it 16 times.
Actually, while I was testing this over and over again, I noticed a pattern. This tends to occur while the mouse cursor is over the selection while replacing the selected text. I know that might sound stupid, and I'm not really sure what's going on here, but I can reliably reproduce it every single time.
In the examples below, I used the following steps:
Used the lorem snippet to create some content.
Created a selection by "clicking" and dragging over the characters, then "releasing" my mouse (I'm on a MBP trackpad - so not really releasing a mouse button, just removing my fingers).
Typed the letter r (it can be anything).
The only difference between them is mouse placement after the selection (after "releasing" the mouse). Every time the cursor remained over the selection, I observed this bug. See the examples:
Also, if you'll notice in the gifs that were previously posted by @izuzak, his cursor remains over the selection in both.
Here are my specs in case they might be helpful:
Atom 1.0.7
Apple MacBook Pro (2014)
Mac OS X Yosemite 10.10.5
Let me know there is any other helpful information I can give.
I'm still unable to reproduce this by any of the steps people are suggesting. Maybe an obvious question: Is everyone able to reproduce this in safe mode?
@nathansobo I am able to reproduce it in safe mode. See my gif below:
Not sure why, but I tried it a few times in safe mode before recording the gif, and I couldn't get it to happen on "Lorem"... Still, though, you can see it happening on even larger chunks of text.
@izuzak Do you have time to screen share tomorrow during the morning US mountain time? I can't reproduce this but obviously it's a huge problem. Maybe I can get some insight from your machine.
It's interesting that you're having trouble reproducing this. I just played with this a bit more and perhaps you're not hitting a key quickly enough after dragging the selection? Or perhaps you're not selecting by dragging but by double-clicking? If I wait too long after selecting or if I select by double-clicking -- the problem doesn't manifest itself.
Okay, after screen sharing with @izuzak, we've narrowed this down.
There seems to be a several hundred millisecond pause before the mouseup event is fired when dragging with a trackpad on OS X Yosemite. So what's happening is that Atom thinks you're still dragging during the text input, which causes the selection to extend from the end of the inserted text to the location of the mouse cursor. I'm still on Mavericks (believe it or not), which doesn't exhibit this behavior.
I'll need to investigate the reason for this mouseup delay when dragging. One possible workaround we could implement is to force the mouseup handler to fire no matter what when there's a textInput event if we're still dragging.
Ah that makes a lot of sense - at work I use a trackpad, but at home I use an external mouse, which would explain why I was only experiencing this at work.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!
Activity
mnquintana commentedon Aug 13, 2015
@izuzak I've run into this quite a lot with 1.0.6 and 1.0.7. Haven't found precise repro steps yet though.
izuzak commentedon Aug 13, 2015
@mnquintana I'm able to reliably reproduce using the steps I described above. Does that reproduce the issue for you as well?
mnquintana commentedon Aug 13, 2015
@izuzak I was able to reproduce this with those steps, but interestingly, after a few undos the steps didn't work anymore.
izuzak commentedon Aug 13, 2015
Sweet, thanks for confirming, @mnquintana. 🙇
sethlopezme commentedon Aug 13, 2015
This issue seems very related to #5200 and #5243. I run into this issue a lot, and it's a pretty big inconvenience. I'm surprised that this bug has made it so far.
mnquintana commentedon Aug 18, 2015
I've been running into this multiple times an hour lately (but interestingly, I haven't run into this really at home, just at work). Would be awesome if someone could take a look at this soon. 🙇
nathansobo commentedon Aug 18, 2015
@mnquintana I can't reproduce it so any information you can give us about the internal state of the editor, sections, the marker index would be helpful. I'll even screen share with you when it happens tomorrow if you have time.
izuzak commentedon Aug 18, 2015
@nathansobo I can reliably reproduce this. Open a new tab, trigger the
loremsnippet, then drag selectametfrom left to right, then pressr:You don't see that?
nathansobo commentedon Aug 18, 2015
Sorry, I hadn't tried. I'll be back at my computer later today and will focus on this until it's fixed assuming I can reproduce it. Thanks!
nathansobo commentedon Aug 18, 2015
I should say: I hadn't realized we had consistent reproduction steps.
sethlopezme commentedon Aug 18, 2015
@izuzak Oh, wow. With that example, I'm able to reproduce the issue quite a bit. Out of 25 tries, I was able to reproduce it 16 times.
Actually, while I was testing this over and over again, I noticed a pattern. This tends to occur while the mouse cursor is over the selection while replacing the selected text. I know that might sound stupid, and I'm not really sure what's going on here, but I can reliably reproduce it every single time.
In the examples below, I used the following steps:
loremsnippet to create some content.r(it can be anything).The only difference between them is mouse placement after the selection (after "releasing" the mouse). Every time the cursor remained over the selection, I observed this bug. See the examples:
Also, if you'll notice in the gifs that were previously posted by @izuzak, his cursor remains over the selection in both.
Here are my specs in case they might be helpful:
Let me know there is any other helpful information I can give.
nathansobo commentedon Aug 18, 2015
I'm still unable to reproduce this by any of the steps people are suggesting. Maybe an obvious question: Is everyone able to reproduce this in safe mode?
sethlopezme commentedon Aug 18, 2015
@nathansobo I am able to reproduce it in safe mode. See my gif below:
Not sure why, but I tried it a few times in safe mode before recording the gif, and I couldn't get it to happen on "Lorem"... Still, though, you can see it happening on even larger chunks of text.
luishdez commentedon Aug 19, 2015
Same problem with selection. using OS X
Also when I "double-click" a word it won't select last char
nathansobo commentedon Aug 19, 2015
@izuzak Do you have time to screen share tomorrow during the morning US mountain time? I can't reproduce this but obviously it's a huge problem. Maybe I can get some insight from your machine.
izuzak commentedon Aug 19, 2015
@nathansobo Yeah, for sure -- I'll be here. 👍
It's interesting that you're having trouble reproducing this. I just played with this a bit more and perhaps you're not hitting a key quickly enough after dragging the selection? Or perhaps you're not selecting by dragging but by double-clicking? If I wait too long after selecting or if I select by double-clicking -- the problem doesn't manifest itself.
nathansobo commentedon Aug 19, 2015
Okay, after screen sharing with @izuzak, we've narrowed this down.
There seems to be a several hundred millisecond pause before the
mouseupevent is fired when dragging with a trackpad on OS X Yosemite. So what's happening is that Atom thinks you're still dragging during the text input, which causes the selection to extend from the end of the inserted text to the location of the mouse cursor. I'm still on Mavericks (believe it or not), which doesn't exhibit this behavior.I'll need to investigate the reason for this
mouseupdelay when dragging. One possible workaround we could implement is to force themouseuphandler to fire no matter what when there's atextInputevent if we're still dragging.mnquintana commentedon Aug 19, 2015
Ah that makes a lot of sense - at work I use a trackpad, but at home I use an external mouse, which would explain why I was only experiencing this at work.
izuzak commentedon Sep 1, 2015
This can still be reproduced by using the
deletekey, see the discussion in #8446 (comment).lock commentedon Jan 20, 2019
This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!