-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix selection in scrollback #1171
Conversation
There was an issue where alacritty tries to convert the lines in a selection to the on-screen lines even when the selection is not on the screen. This results in a crash. To prevent this from happening the selection now is not shown if it is off the screen. There currently still is a bug that when the selection is at the top of the screen but still half visible, it will not show the top line as selected but start in the second line. This bug should be resolved with alacritty#1171. This fixes alacritty#1148.
There was an issue where alacritty tries to convert the lines in a selection to the on-screen lines even when the selection is not on the screen. This results in a crash. To prevent this from happening the selection now is not shown if it is off the screen. There currently still is a bug that when the selection is at the top of the screen but still half visible, it will not show the top line as selected but start in the second line. This bug should be resolved with #1171. This fixes #1148.
This has conflicts on current scrollback branch |
There were a few issues with selection in scrollback that were mainly off-by-one errors. This aims at fixing these issues. This also fixes a bug that currently exists in master where the last cell is not selected when the mouse leaves the window to the right.
When the user selected multiple lines, dragging the selection downwards, and then leaves the cursor to the left side of the first cell, the first cell was still incorrectly selected. This has been fixed. The selection also did not update if the mouse was outside of the window, now all movement events are accpeted even when the mouse is outside of the window. This allows updating the selection when the user is dragging the cursor too far. Mouse movement and click events outside of the window are not propagated, these are only used for updating the selection.
I've rebased on master, fixed a tiny bug with selecting the first cell in a multi-line selection and am now propagating mouse events outside of the window to update selection. The screen does not scroll automatically yet, but this is probably better done in a different PR. |
When scrolling down with a selection on screen the first line was not properly selected. This has been fixed by making sure the selection always starts in the first cell when it is only partially visible.
When selecting to the top and starting in the first cell, alacritty would crash. These cases have been fixed and now selection should be completely working.
Is this ready to go? You mentioned elsewhere about improving the selection clipping behavior in this PR. |
After fixing the edge-cases for the remaining issues, the There definitely are quite a few edge-cases for this, but it might be interesting to try and rewrite this completely with these edge-cases in mind to see if it can be cleaned up. Right now it seems like it's more edge-cases than anything else really. |
The The crux of the problem is that we need to be able to handle single cell selection without triggering a selection on every simple click. If you have ideas on how to approach that without the idea of "sides" of a cell, then that would simplify things dramatically. |
I don't think the idea of I think with my implementation I've got a bit confused by the I think by just rewriting the method from scratch without having to understand what's already there, I might be able to get a better result. Worst-case I'd probably re-implement the same thing again. It's a short method so I think it's worth exploring. For now I'd rather keep this open and I'll get back to it this weekend or earlier when I have the time. If I didn't find any better solution until the other things are fixed, it's probably fine to merge it as-is. |
There was an issue where alacritty tries to convert the lines in a selection to the on-screen lines even when the selection is not on the screen. This results in a crash. To prevent this from happening the selection now is not shown if it is off the screen. There currently still is a bug that when the selection is at the top of the screen but still half visible, it will not show the top line as selected but start in the second line. This bug should be resolved with alacritty#1171. This fixes alacritty#1148.
There was an issue where alacritty tries to convert the lines in a selection to the on-screen lines even when the selection is not on the screen. This results in a crash. To prevent this from happening the selection now is not shown if it is off the screen. There currently still is a bug that when the selection is at the top of the screen but still half visible, it will not show the top line as selected but start in the second line. This bug should be resolved with #1171. This fixes #1148.
There were a few issues with selection in scrollback that were mainly
off-by-one errors. This aims at fixing these issues.
This also fixes a bug that currently exists in master where the last
cell is not selected when the mouse leaves the window to the right.
This fixes #1159 and fixes #1182.