Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use cols not rows for left margin bound #5871

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading