Closed samtay closed 4 years ago
I do reproduce it.
Smaller example:
use std::io::Write;
use termimad::*;
static MD: &str = r#"
Note that the "before" code is basically the [implementation of today's `poll_fn` function](https://github.com/rust-lang-nursery/futures-rs/blob/0.3.1/futures-util/src/future/poll_fn.rs#L48-L56)
"#;
fn main() {
let skin = MadSkin::default();
skin.print_text(MD);
}
This should have been fixed. Can you please confirm it's OK @samtay ?
Yes, I just tried out master
and it's working on my end. Thanks for such a quick fix!
Someone has observed
thread 'main' panicked at 'attempt to subtract with overflow'
coming from askin.print_text
call (ref samtay/so#8), and also found that such panic goes away when usingskin.print_inline
.Unfortunately I couldn't repo this myself, but the relevant details from that issue are:(190, 51)
Note the markdown input is quite large, so I put it in a gist. I also embedded it within the
./examples/text/main.rs
file so that it would be easier to run.EDIT: I was able to repro this. At terminal width
112
there is no panic. If the terminal width is greater than or equal to117
, you can observe this panic.I think if you make sure your terminal width is that wide (e.g. go full screen), and run this:
you should be able to observe it.