aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2020-12-07 16:53:55 +0100
committerGitHub <noreply@github.com>2020-12-07 16:53:55 +0100
commit576876b4756ee44cfbf084a0a20f3c07dee8ad73 (patch)
treee955045957818d40c27166ec9c688f51f5c6dff2 /src
parentfix(compatibility): do not offset first scroll region line (#82) (diff)
downloadsl0ppij-576876b4756ee44cfbf084a0a20f3c07dee8ad73.tar.gz
sl0ppij-576876b4756ee44cfbf084a0a20f3c07dee8ad73.tar.xz
sl0ppij-576876b4756ee44cfbf084a0a20f3c07dee8ad73.zip
fix(compatibility): acknowledge scroll region even if the cursor is not shown (#84)
Diffstat (limited to 'src')
-rw-r--r--src/terminal_pane/scroll.rs25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/terminal_pane/scroll.rs b/src/terminal_pane/scroll.rs
index 4a1600ed..e9801ef0 100644
--- a/src/terminal_pane/scroll.rs
+++ b/src/terminal_pane/scroll.rs
@@ -394,20 +394,17 @@ impl Scroll {
pub fn add_canonical_line(&mut self) {
let current_canonical_line_index = self.cursor_position.line_index.0;
if let Some((scroll_region_top, scroll_region_bottom)) = self.scroll_region {
- if self.show_cursor {
- // scroll region should be ignored if the cursor is hidden
- if current_canonical_line_index == scroll_region_bottom {
- // end of scroll region
- // when we have a scroll region set and we're at its bottom
- // we need to delete its first line, thus shifting all lines in it upwards
- // then we add an empty line at its end which will be filled by the application
- // controlling the scroll region (presumably filled by whatever comes next in the
- // scroll buffer, but that's not something we control)
- self.canonical_lines.remove(scroll_region_top);
- self.canonical_lines
- .insert(scroll_region_bottom, CanonicalLine::new());
- return;
- }
+ if current_canonical_line_index == scroll_region_bottom {
+ // end of scroll region
+ // when we have a scroll region set and we're at its bottom
+ // we need to delete its first line, thus shifting all lines in it upwards
+ // then we add an empty line at its end which will be filled by the application
+ // controlling the scroll region (presumably filled by whatever comes next in the
+ // scroll buffer, but that's not something we control)
+ self.canonical_lines.remove(scroll_region_top);
+ self.canonical_lines
+ .insert(scroll_region_bottom, CanonicalLine::new());
+ return;
}
}