Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling sticks to top when "cursor_blink": false set #13720

Closed
1 task done
baldwindavid opened this issue Jul 1, 2024 · 13 comments · Fixed by #13867 or #14829
Closed
1 task done

Scrolling sticks to top when "cursor_blink": false set #13720

baldwindavid opened this issue Jul 1, 2024 · 13 comments · Fixed by #13867 or #14829
Labels
defect [core label] gpui GPUI rendering framework support mouse interaction Feedback for mouse interaction states, actions, etc workspace Feedback for workspace management, layout, interactions, etc

Comments

@baldwindavid
Copy link
Contributor

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

This is the strangest thing, but just in the last weeks I've noticed that scrolling to the very top of a pane and then attempting to scroll down (via touchpad) results in a delay before scrolling down takes place. It takes multiple times before it reacts and the delay is up to a second. I originally assumed it was something related to my vim settings, but removed all settings except this and still get the behavior...

{
    "cursor_blink": false
}

If I set that to true, regardless of settings, the problem disappears.

Environment

Zed: v0.142.3 (Zed Preview)
OS: macOS 14.4.1
Memory: 32 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@baldwindavid baldwindavid added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Jul 1, 2024
@notpeter
Copy link
Member

notpeter commented Jul 2, 2024

I can reproduce the scroll sticking independent of the cursor_blink setting. I just over-scroll with trackpad gestures (keep scrolling after the top is reached) and then try to scroll the other direction.

Interestingly this does not occur when I first open a project (e.g. while rust-analyzer loads the zed workspace). Only once rust-analyzer is done indexing does the scroll lag behavior begin.

@notpeter notpeter added mouse interaction Feedback for mouse interaction states, actions, etc workspace Feedback for workspace management, layout, interactions, etc gpui GPUI rendering framework support and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Jul 2, 2024
@baldwindavid
Copy link
Contributor Author

I wonder if #11244 that @alygin and @SomeoneToIgnore were discussing is related.

@baldwindavid
Copy link
Contributor Author

I can reproduce the scroll sticking independent of the cursor_blink setting.

@notpeter Yes, I think I can too. It's just that it is a tiny delay for me as compared to an unusable near one second delay with cursor_blink: false.

@WeetHet
Copy link
Contributor

WeetHet commented Jul 4, 2024

Okay, so I'm not going insane and scrolling is indeed broken. That is nice to know, I guess. For me, scrolling breaks not only when over-scrolling, but also when I change focused panes or try to scroll a non focused pane. cursor_blink: false does not seem to fix it a lot, though it make the situation a bit better

@WeetHet
Copy link
Contributor

WeetHet commented Jul 4, 2024

@notpeter, good news, I've found the breaking PR (if I did bisect correctly):
#13368

@WeetHet
Copy link
Contributor

WeetHet commented Jul 4, 2024

I guess we need @as-cii or @rtfeldman help here, because I have no idea what is going on in that pull request

@WeetHet
Copy link
Contributor

WeetHet commented Jul 5, 2024

Continuing on with my investigation, a bug is somewhere in the one of the two files: crates/editor/src/element.rs or crates/editor/src/scroll/autoscroll.rs because restoring them to c58a8f1a04ba7ff56ec20ac0ad6fe909e3d3cf72 fixed the problem

WeetHet added a commit to WHForks/zed that referenced this issue Jul 5, 2024
WeetHet added a commit to WHForks/zed that referenced this issue Jul 5, 2024
@WeetHet
Copy link
Contributor

WeetHet commented Jul 5, 2024

I went and found the exact lines causing the issue:

if scroll_position != current_scroll_position {
editor.scroll(scroll_position, axis, cx);
cx.stop_propagation();
}

Before #13368 they would execute even if scroll_position was equal to current_scroll_position. I don't know why they are equal in this case, so this might indicate a larger issue then I initially thought

@WeetHet
Copy link
Contributor

WeetHet commented Jul 5, 2024

@notpeter could you please reopen this issue, as it is not fixed for me yet (I've compiled zed from your branch and still experience scrolling sticking to the top)

notpeter added a commit that referenced this issue Jul 5, 2024
@notpeter notpeter reopened this Jul 5, 2024
WeetHet added a commit to WHForks/zed that referenced this issue Jul 5, 2024
WeetHet added a commit to WHForks/zed that referenced this issue Jul 5, 2024
WeetHet added a commit to WHForks/zed that referenced this issue Jul 5, 2024
osiewicz added a commit that referenced this issue Jul 9, 2024
The problem seemingly was that scrolling only started after autoscroll
has finished. I have added a function to forcefully stop it, which I
call when scroll event happens
Release Notes:

- Fixed delay when changing scrolling direction (#13720)

---------

Co-authored-by: Piotr <[email protected]>
@ChristoferMendes
Copy link

@notpeter could you please reopen this issue, as it is not fixed for me yet (I've compiled zed from your branch and still experience scrolling sticking to the top)

I'm with the same problem here on Linux (with the build of the project available on curl), i.e.,

curl https://zed.dev/install.sh | sh  

@WeetHet
Copy link
Contributor

WeetHet commented Jul 10, 2024

@notpeter could you please reopen this issue, as it is not fixed for me yet (I've compiled zed from your branch and still experience scrolling sticking to the top)

I'm with the same problem here on Linux (with the build of the project available on curl), i.e.,

curl https://zed.dev/install.sh | sh  

Are you on Preview or Stable?

@ChristoferMendes
Copy link

ChristoferMendes commented Jul 10, 2024

@notpeter could you please reopen this issue, as it is not fixed for me yet (I've compiled zed from your branch and still experience scrolling sticking to the top)

I'm with the same problem here on Linux (with the build of the project available on curl), i.e.,

curl https://zed.dev/install.sh | sh  

Are you on Preview or Stable?

Stable. The scroll doesn't work at all. Not even clicking the scroll bar

@notpeter
Copy link
Member

Stable. The scroll doesn't work at all. Not even clicking the scroll bar

@ChristoferMendes Can you open a new issue, I believe you are experiencing something distinct from this issue. This is about a delay where scrolling lags temporarily after scrolling to the top of a file. Sounds like your scrolling is completely broken.

Separately, the fix for this issue went out in Zed Preview today (thanks @WeetHet for your help with #13874) and will be in Zed Stable next week (2024-07-17).

ConradIrwin added a commit that referenced this issue Jul 19, 2024
ConradIrwin added a commit that referenced this issue Jul 19, 2024
Fixes: #13720

Co-Authored-By: <[email protected]>



Release Notes:

- vim: Fixed `gv` after `y`, `d`, etc.
([#13760](#13760)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] gpui GPUI rendering framework support mouse interaction Feedback for mouse interaction states, actions, etc workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
4 participants