Skip to content

🚧 fix: inputs get messed up when a line overflows#36

Draft
roele wants to merge 1 commit into
jdx:mainfrom
roele:issues/7
Draft

🚧 fix: inputs get messed up when a line overflows#36
roele wants to merge 1 commit into
jdx:mainfrom
roele:issues/7

Conversation

@roele
Copy link
Copy Markdown
Collaborator

@roele roele commented Jan 31, 2024

overflowing lines need to be calculated seperately of height so we can move the cursor accordingly before clearing. for selects this is much more involved since capacity of options also need to be calculated based on title,description and help which all might be overflowing.

@roele roele linked an issue Jan 31, 2024 that may be closed by this pull request
@roele roele changed the title fix: inputs get messed up when a line overflows 🚧 fix: inputs get messed up when a line overflows Feb 1, 2024
Comment thread src/common.rs
// calculate potential overflow of lines overflowing terminal width
let overflow = output
.lines()
.map(|l| {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. I feel like maybe with "fold" or "reduce" you could make it a tiny bit more concise but honestly I'd probably just do it the way you did

Comment thread src/confirm.rs Outdated
}

fn set_height(&mut self, output: String) -> io::Result<()> {
let height = common::get_height(&self.term, output);
Copy link
Copy Markdown
Owner

@jdx jdx Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let height = common::get_height(&self.term, output);
let (h, o) = common::get_height(&self.term, output);

@jdx
Copy link
Copy Markdown
Owner

jdx commented Feb 1, 2024

this looks like the right approach to me—definitely tough to review this kind of code though

@subdigital
Copy link
Copy Markdown

I'm also seeing the line wrapping bug from mise run output as described in #7 -- assuming this PR fixes it, anything we can do to get this merged? (Happy to help if I can)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inputs get messed up when a line overflows

3 participants