summaryrefslogtreecommitdiffstats
path: root/zellij-utils
diff options
context:
space:
mode:
authorSagittarius-a <sagittarius-a@users.noreply.github.com>2021-07-24 21:28:19 +0200
committerSagittarius-a <sagittarius-a@users.noreply.github.com>2021-07-24 21:28:19 +0200
commit7da214fccaaf350e461b4387c5d2d4c4ca7a2372 (patch)
tree347a94af3f8e2f51d29d72d87325c476a7725cd2 /zellij-utils
parentf5734f2bf14212cda4455065222c0593004020bf (diff)
feat(scroll): Restore scroll position on SIGINT
Fixes #606 Currently scroll down to bottom then exits scroll mode.
Diffstat (limited to 'zellij-utils')
-rw-r--r--zellij-utils/assets/config/default.yaml2
-rw-r--r--zellij-utils/src/errors.rs1
-rw-r--r--zellij-utils/src/input/actions.rs2
3 files changed, 5 insertions, 0 deletions
diff --git a/zellij-utils/assets/config/default.yaml b/zellij-utils/assets/config/default.yaml
index d9090a8dc..24ee95f59 100644
--- a/zellij-utils/assets/config/default.yaml
+++ b/zellij-utils/assets/config/default.yaml
@@ -178,6 +178,8 @@ keybinds:
key: [Ctrl: 'p',]
- action: [SwitchToMode: Session,]
key: [Ctrl: 'o',]
+ - action: [ScrollToBottom, SwitchToMode: Normal,]
+ key: [Ctrl: 'c',]
- action: [Quit,]
key: [Ctrl: 'q',]
- action: [ScrollDown,]
diff --git a/zellij-utils/src/errors.rs b/zellij-utils/src/errors.rs
index b32dd337d..6a053038a 100644
--- a/zellij-utils/src/errors.rs
+++ b/zellij-utils/src/errors.rs
@@ -202,6 +202,7 @@ pub enum ScreenContext {
ScrollUpAt,
ScrollDown,
ScrollDownAt,
+ ScrollToBottom,
PageScrollUp,
PageScrollDown,
ClearScroll,
diff --git a/zellij-utils/src/input/actions.rs b/zellij-utils/src/input/actions.rs
index bfd7d2559..431a09bf7 100644
--- a/zellij-utils/src/input/actions.rs
+++ b/zellij-utils/src/input/actions.rs
@@ -48,6 +48,8 @@ pub enum Action {
ScrollDown,
/// Scroll down at point
ScrollDownAt(Position),
+ /// Scroll down to bottom in focus pane.
+ ScrollToBottom,
/// Scroll up one page in focus pane.
PageScrollUp,
/// Scroll down one page in focus pane.