mirror of
https://github.com/wez/wezterm.git
synced 2024-11-27 12:23:46 +03:00
add ScrollToTop and ScrollToBottom key assignments
refs: https://github.com/wez/wezterm/issues/1360
This commit is contained in:
parent
21170445b7
commit
66908eabb4
@ -179,6 +179,8 @@ pub enum KeyAssignment {
|
|||||||
ScrollByPage(isize),
|
ScrollByPage(isize),
|
||||||
ScrollByLine(isize),
|
ScrollByLine(isize),
|
||||||
ScrollToPrompt(isize),
|
ScrollToPrompt(isize),
|
||||||
|
ScrollToTop,
|
||||||
|
ScrollToBottom,
|
||||||
ShowTabNavigator,
|
ShowTabNavigator,
|
||||||
ShowDebugOverlay,
|
ShowDebugOverlay,
|
||||||
HideApplication,
|
HideApplication,
|
||||||
|
@ -14,6 +14,7 @@ As features stabilize some brief notes about them will accumulate here.
|
|||||||
#### New
|
#### New
|
||||||
|
|
||||||
* unix domains now support an optional `proxy_command` to use in place of a direct unix socket connection. [Read more about multiplexing unix domains](multiplexing.html#unix-domains)
|
* unix domains now support an optional `proxy_command` to use in place of a direct unix socket connection. [Read more about multiplexing unix domains](multiplexing.html#unix-domains)
|
||||||
|
* [ScrollToTop](config/lua/keyassignment/ScrollToTop.md) and [ScrollToBottom](config/lua/keyassignment/ScrollToBottom.md) key assignments [#1360](https://github.com/wez/wezterm/issues/1360)
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|
||||||
|
7
docs/config/lua/keyassignment/ScrollToBottom.md
Normal file
7
docs/config/lua/keyassignment/ScrollToBottom.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# ScrollToBottom
|
||||||
|
|
||||||
|
*Since: nightly builds only*
|
||||||
|
|
||||||
|
This action scrolls the viewport to the bottom of the scrollback.
|
||||||
|
|
||||||
|
|
6
docs/config/lua/keyassignment/ScrollToTop.md
Normal file
6
docs/config/lua/keyassignment/ScrollToTop.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# ScrollToTop
|
||||||
|
|
||||||
|
*Since: nightly builds only*
|
||||||
|
|
||||||
|
This action scrolls the viewport to the top of the scrollback.
|
||||||
|
|
@ -1876,6 +1876,8 @@ impl TermWindow {
|
|||||||
ScrollByPage(n) => self.scroll_by_page(*n)?,
|
ScrollByPage(n) => self.scroll_by_page(*n)?,
|
||||||
ScrollByLine(n) => self.scroll_by_line(*n)?,
|
ScrollByLine(n) => self.scroll_by_line(*n)?,
|
||||||
ScrollToPrompt(n) => self.scroll_to_prompt(*n)?,
|
ScrollToPrompt(n) => self.scroll_to_prompt(*n)?,
|
||||||
|
ScrollToTop => self.scroll_to_top(pane),
|
||||||
|
ScrollToBottom => self.scroll_to_bottom(pane),
|
||||||
ShowTabNavigator => self.show_tab_navigator(),
|
ShowTabNavigator => self.show_tab_navigator(),
|
||||||
ShowDebugOverlay => self.show_debug_overlay(),
|
ShowDebugOverlay => self.show_debug_overlay(),
|
||||||
ShowLauncher => self.show_launcher(),
|
ShowLauncher => self.show_launcher(),
|
||||||
@ -2162,6 +2164,11 @@ impl TermWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn scroll_to_top(&mut self, pane: &Rc<dyn Pane>) {
|
||||||
|
let dims = pane.get_dimensions();
|
||||||
|
self.set_viewport(pane.pane_id(), Some(dims.scrollback_top), dims);
|
||||||
|
}
|
||||||
|
|
||||||
fn scroll_to_bottom(&mut self, pane: &Rc<dyn Pane>) {
|
fn scroll_to_bottom(&mut self, pane: &Rc<dyn Pane>) {
|
||||||
self.pane_state(pane.pane_id()).viewport = None;
|
self.pane_state(pane.pane_id()).viewport = None;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user