aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-24 09:01:26 +0000
committerBlaž Hrastnik2021-03-24 09:01:26 +0000
commit8657c57cf2d56b9a89e2f780675426f4c78df48b (patch)
treecbcda261837dc2bcd3be1e060a6452186fd0acc9 /helix-term/src/commands.rs
parent4b176cadedfe47fe542e9c6e2defd34b3af984df (diff)
Trivial jumplist implementation.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 7a1643fe..24fb1709 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1642,3 +1642,25 @@ pub fn match_brackets(cx: &mut Context) {
};
}
}
+
+//
+
+pub fn jump_forward(cx: &mut Context) {
+ let count = cx.count;
+ let view = cx.view();
+
+ if let Some((id, selection)) = view.jumps.forward(count) {
+ view.first_line = 0;
+ view.doc = *id;
+ };
+}
+
+pub fn jump_backward(cx: &mut Context) {
+ let count = cx.count;
+ let view = cx.view();
+
+ if let Some((id, selection)) = view.jumps.backward(count) {
+ view.first_line = 0;
+ view.doc = *id;
+ };
+}