Skip to content

Commit

Permalink
fix: Use cols not rows for left margin bound
Browse files Browse the repository at this point in the history
The location of the left margin should depend on the width, not the
height.

Fixes: #5750
  • Loading branch information
tmccombs authored and wez committed Jul 30, 2024
1 parent 7e8fdc1 commit 03407ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions term/src/terminalstate/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2315,9 +2315,8 @@ impl TerminalState {
// The terminal only recognizes this control function if vertical split
// screen mode (DECLRMM) is set.
if self.left_and_right_margin_mode {
let rows = self.screen().physical_rows as u32;
let cols = self.screen().physical_cols as u32;
let left = left.as_zero_based().min(rows - 1).max(0) as usize;
let left = left.as_zero_based().min(cols - 1).max(0) as usize;
let right = right.as_zero_based().min(cols - 1).max(0) as usize;

// The value of the left margin (Pl) must be less than the right margin (Pr).
Expand Down

0 comments on commit 03407ca

Please sign in to comment.