Add count argument to motion functions and add ability to jump to a given line
This commit is contained in:
parent
673041d1f5
commit
d1f1eb9a29
7 changed files with 665 additions and 863 deletions
|
@ -30,11 +30,9 @@ pub fn visual_motion(motion: Motion, times: usize, cx: &mut MutableAppContext) {
|
|||
s.move_with(|map, selection| {
|
||||
let was_reversed = selection.reversed;
|
||||
|
||||
for _ in 0..times {
|
||||
let (new_head, goal) =
|
||||
motion.move_point(map, selection.head(), selection.goal);
|
||||
selection.set_head(new_head, goal);
|
||||
}
|
||||
let (new_head, goal) =
|
||||
motion.move_point(map, selection.head(), selection.goal, times);
|
||||
selection.set_head(new_head, goal);
|
||||
|
||||
if was_reversed && !selection.reversed {
|
||||
// Head was at the start of the selection, and now is at the end. We need to move the start
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue