editor: Add MoveUpByLines and MoveDownByLines actions
This adds four new actions:
editor::MoveUpByLineseditor::MoveDownByLineseditor::SelectUpByLines(bound by default toshift-alt-up)editor::SelectDownByLines(bound by default toshift-alt-up)
They all take a count by which to move the cursor up and down.
Requested by Adam here: https://twitter.com/adamwathan/status/1753017094248018302
Release Notes:
- Added four new actions:
editor::MoveUpByLines,editor::MoveDownByLines,editor::SelectUpByLines(bound by default toshift-alt-upwith 3 lines),editor::SelectDownByLines(bound by default toshift-alt-upwith 3 lines) that move the cursor up by the configured line count.
Demo
https://github.com/zed-industries/zed/assets/1185253/e78d4077-5bd5-4d72-a806-67695698af5d
https://github.com/zed-industries/zed/assets/1185253/0b086ec9-eb90-40a2-9009-844a215e6378
very nice
Added two new actions:
editor::MoveUpByLinesandeditor::MoveDownByLinesthat move the cursor up by the configured line count. Default binding isalt-upandalt-downwith 3 lines.
Don’t we already have actions bound to alt-up and alt-down?
I have them bound to moving single lines up and down, but I think by default they’re bound to Tree-sitter syntax selections.
Don’t we already have actions bound to
alt-upandalt-down?
Yup, sorry! Forgot to update that part of the PR description. I changed it in the code. Will fix PR description now.
@maxbrunsfeld what do you think about this?