-
Notifications
You must be signed in to change notification settings - Fork 8.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
Add ability to select all text in the buffer #13045
Conversation
Clever, with the existing selection being a requirement for selecting all. It might be hard for somebody to discover this, unfortunately. I somewhat wonder if we should just make the default Ctrl+Shift+A, always select all even if there is no selection, and then enable Ctrl+A in Mark Mode |
Ack. Especially since there's no way to start a selection with the keyboard ATM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed!
I'm ok with this, but if that's the case, we should make it a configurable keybinding. My main reasoning for that is that I really want to separate mark mode stuff and keybindings. For now, I don't want mark mode to be configurable. We'd be introducing a ton of keybindings that are conditional on a selection being present, and that's spooky. If
works for me, I'll move this logic over to my mark mode branch then. |
FYI Most of the new changes were just plumbing the action through, so I'm explicitly not re-requestion a review from @lhecker. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#shipit
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
Adds the `selectAll` action to the schema...because I forgot to do that in #13045.
🎉 Handy links: |
Adds the
selectAll
action which can be used to select all text in the buffer (regardless of whether a selection is present).References
#3663 - Mark Mode
#4993 - [Scenario] Keyboard selection
PR Checklist
Detailed Description of the Pull Request / Additional comments
I've made it such that selecting the "entire buffer" really just selects up to the mutable viewport. This seems like a nice QOL improvement since there's generally nothing past that.
When the user selects all, the viewport does not move. This is consistent with CMD behavior and is intended to allow the user to not lose context when selecting everything.
A minor change had to be made to the DxRenderer because this uncovered an underflow issue. Basically, the selection rects were handed to the DxEngine relative to the viewport (which means that some had a negative y-value). At some point, those rects were stored into
size_t
s, resulting in an underflow issue. This caused the renderer to behave strangely when rendering the selection. Generally, these kinds of issues weren't really noticed because selection would always modify a portion of the viewport.Funny enough, in a way, this satisfies the "mark mode" scenario because the user now has a way to initiate a selection using only the keyboard. Though this isn't ideal, just a fun thing to point out (that's why I'm not closing the mark mode issue).
Validation Steps Performed