add an example of incrementally printing markdown
This is a minimum code example for incrementally printing markdown. This should close #42
There's a problem: the save/restore thing breaks as soon as there's a scrollbar.
I can run it with clear & cargo run --example incremental_print_markdown but otherwise it doesn't work.
I think it's fine. It's an MVP after all. Otherwise, I guess we need to do something like you did in render_input_markdown, which is to use Area. But I haven't tried out to embed one Area in the current terminal instead of opening up a new alternate screen.
BTW, do you know why this happens? I'm not very familiar with nitty gritty of terminals. From my view, the code logic is fine regardless scrollbar. I tested it on my Mac default terminal and iTerm2 and Warp. Former 2 have this issue, but Warp seems to handle it pretty well.
There's a problem: the save/restore thing breaks as soon as there's a scrollbar.
I fixed this in commit fb5b0eb by calculating where the anchored cursor should be instead of storing a fixed cursor position.