Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Selecting a line from the gutter causes the view to scroll #6722

Closed

Description

@almostearthling

Selecting a line from the gutter causes the view to scroll

When a line is selected from the gutter near enough to the end of the view, the view unwantedly scrolls up some lines.

Gutter line selection and scroll

This also happens when the line is selected in the upper part of the view, when the user selects either the first or the second visible line. This behaviour can lead to multiline selection in some cases and when the user modifies the text in a destructive way (e.g. deletion or replacement) it can lead to errors.

Repro Steps

  1. Open a file that does not fit in the view
  2. Select the first or last fully visible line by clicking on the line number

Expected: The line is selected and the view does not scroll
Actual: The view scrolls up or down respectively when selecting the last line or the first line

Command History

     -0:21.0 editor:detached (atom-text-editor.editor)
     -0:21.0 editor:will-be-removed (atom-text-editor.editor)
     -0:06.5 cursor:moved (atom-text-editor.editor.is-focused)
     -0:06.5 selection:changed (atom-text-editor.editor.is-focused)
     -0:05.8 cursor:moved (atom-text-editor.editor.is-focused)
     -0:05.8 selection:changed (atom-text-editor.editor.is-focused)
     -0:05.1 cursor:moved (atom-text-editor.editor.is-focused)
     -0:05.1 selection:changed (atom-text-editor.editor.is-focused)
     -0:04.5 cursor:moved (atom-text-editor.editor.is-focused)
     -0:04.5 selection:changed (atom-text-editor.editor.is-focused)
     -0:00.0 bug-report:open (atom-text-editor.editor.is-focused)

Versions

  • Atom: 0.198.0
  • Atom-Shell: 0.22.3
  • OS: linux 3.13.0-52-generic
  • Misc
    • apm 0.166.0
    • npm 2.5.1
    • node 0.10.35
    • python 2.7.6
    • git 1.9.1

This report was created in and posted from the Atom editor using the package bug-report v0.7.0.

Activity

  1. almostearthling commented on May 10, 2015

    @almostearthling
    Author

    I don't know whether or not it could be merged with this one.

    #6675

    F.

  2. winstliu commented on May 11, 2015

    @winstliu
    Contributor

    @almostearthling can you reproduce this in safe mode (atom --safe)?

  3. almostearthling commented on May 11, 2015

    @almostearthling
    Author

    Yes, in safe mode it's much the same thing. I'm on a different workstation now with almost the same configuration. The behaviour is identical. I'll also try to verify it on a Windows machine ASAP, in safe mode.

    Please tell me if there is more I can do to help locate the problem, in case you cannot reproduce it.

    F.

  4. izuzak commented on May 11, 2015

    @izuzak
    Contributor

    Thanks for the detailed feedback, @almostearthling.

    You should see the same auto-scrolling behavior when you click within the last few lines (not in the gutter). Do you see that behavior and do you think that behavior is problematic as well (and if not -- why not)? The gutter-click is causing the view to auto-scroll as well because that action places the cursor on that line you clicked (try clicking on the gutter and then pressing the right arrow).

    You said:

    This behaviour can lead to multiline selection in some cases and when the user modifies the text in a destructive way (e.g. deletion or replacement) it can lead to errors.

    Can you try describing at least one specific case where this can cause errors (in as many details as possible) and share a GIF which demonstrates that? I think that would be very helpful for explaining why the current behavior is problematic.

    I don't know whether or not it could be merged with this one. #6675

    That report sounds a bit different -- it points out a specific case where auto-scrolling is problematic, not that auto-scrolling is problematic is general.

    Also cc @nathansobo for more 💭.

  5. almostearthling commented on May 11, 2015

    @almostearthling
    Author

    In fact when you click in a part of the editor near the top or the bottom to put the cursor there, the view scrolls enough moving the line containing the cursor towards the center of the screen. Indeed, like it or not (I actually like it when not selecting a line), this is easily recognizable as a feature.

    I'll try to reproduce this on a GIF when I'll have a screencast recorder on this workstation (hopefully soon!), but the annoying point is when one inadvertently clicks to select a line and multiple lines are selected. I think that in order to have multiple lines selected the mouse has to be slightly moved, but the movement can also be "imperceptible" or unwanted. I'm quite used to old editors that sported the gutter as a means to select one or more lines, as Atom does, and it wasn't uncommon for me to select a whole line and overwrite (by writing other code) or just delete it. In this case I have to pay some more attention to how the editor behaves - or change my behaviour, which wouldn't be overkill considering that most programming environments already forced me to get used to something different each time in the past. :-)

    However as soon as I have a screencast at hand, I'll post it. Also, if it happens again (because it happened at least until 0.197) that also selecting a whole line from the gutter more towards the center of the view causes such scrolling, I'll document it as well.

    Thank you for answering so quickly, @izuzak (and @nathansobo as suggested)!

    F.

  6. almostearthling commented on May 11, 2015

    @almostearthling
    Author

    @izuzak and @nathansobo, here is an example of what is reproducible: I click a line near the bottom, inadvertently move the mouse slightly, and start to code overwriting without thinking too much. I lose some lines instead of one. Sometimes it happens (although I try to avoid it now, really!):

    multisel

    Well, I've stretched it a bit, but sometimes I might have lost three or four lines of code and had to repeatedly Undo to recover it. After some time spent on the editor it happens quite often, that's why I tried to change my habits first instead of raising an issue.

    [EDIT] Also, as I said above, it's possible to reproduce an erratic behaviour that can be more confusing, either selecting a single line or selecting multiple lines from the gutter (be it intentional or not): clicking on a line number as shown in the screencast causes the view to scroll. This only happens when the panes are split. In my case, to reproduce:

    1. Open a long enough file
    2. Split the pane right and then split the rightmost pane down
    3. In the upper right pane (not just it, but for reference) scroll to the end of file
    4. Position the cursor on the last line
    5. Click on a line number just around the center of the view.

    multiview

    This was taken in safe mode, in order to avoid any interferences. Now I'd better give up with these screenies, or I'll be kicked away from Github before I even begin to enjoy it.

    F.

  7. parlayvu commented on Jun 4, 2015

    @parlayvu

    Same problem here. This is a big kink in my workflow. I can't click and drag along to select multiple lines like other editors. Wasting so much time with manual selections. Is there a way to turn off this click on scroll?

    Mac 10.9.5
    v0.205.0

  8. lock commented on Jan 20, 2019

    @lock

    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!

  9. locked as resolved and limited conversation to collaborators on Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions