More straightforward newline handling#241
Conversation
|
Hey, just checking in on the status of this PR since I have another one I would like to submit that stacks on this one :D |
|
Thanks @tempoz, I'm a bit busy lately, haven't been able to give this the time it deserves. From a quick skim this looks good though. I'll aim to do a proper review this week. |
|
No problem; I greatly appreciate your time and consideration whenever you have the bandwidth to give it. |
DrJosh9000
left a comment
There was a problem hiding this comment.
Apologies for the delay in getting around to it, but this looks great! Thanks!
|
Would you mind rebasing this / merging from main? I would do it if GitHub showed me the button (I probably don't have rights to make changes directly to your repo.) |
1edadd9 to
abd2508
Compare
|
done! |
|
Hi! I noticed that the first line rendered into the screen gets truncated under circumstances that I'm not fully sure yet how to describe... but I found an easy minimal repro that I'm curious what you both think about:
$ go build cmd/terminal-to-html
$ for i in $(seq -w 0 50); do echo "[$i] hello world hello world hello world hello world hello world hello world hello"; done | \
./terminal-to-html --window-max-cols=80 --buffer-max-lines=50 --window-cols=80 --window-lines=50
[26] hello world hello world hello world hello world hello world hello world hello
[27] hello world hello world hello world hello world hello world hello world hello
[28] hello world hello world hello world hello world hello world hello world hello
[29] hello world hello world hello world hello world hello world hello world hello
[30] hello world hello world hello world hello world hello world hello world hello
[31] hello world hello world hello world hello world hello world hello world hello
[32] hello world hello world hello world hello world hello world hello world hello
[33] hello world hello world hello world hello world hello world hello world hello
[34] hello world hello world hello world hello world hello world hello world hello
[35] hello world hello world hello world hello world hello world hello world hello
[36] hello world hello world hello world hello world hello world hello world hello
[37] hello world hello world hello world hello world hello world hello world hello
[38] hello world hello world hello world hello world hello world hello world hello
[39] hello world hello world hello world hello world hello world hello world hello
[40] hello world hello world hello world hello world hello world hello world hello
[41] hello world hello world hello world hello world hello world hello world hello
[42] hello world hello world hello world hello world hello world hello world hello
[43] hello world hello world hello world hello world hello world hello world hello
[44] hello world hello world hello world hello world hello world hello world hello
[45] hello world hello world hello world hello world hello world hello world hello
[46] hello world hello world hello world hello world hello world hello world hello
[47] hello world hello world hello world hello world hello world hello world hello
[48] hello world hello world hello world hello world hello world hello world hello
[49] hello world hello world hello world hello world hello world hello world hello
[50] hello world hello world hello world hello world hello world hello world hello%
$ go build cmd/terminal-to-html
$ for i in $(seq -w 0 50); do echo "[$i] hello world hello world hello world hello world hello world hello world hello"; done | \
./terminal-to-html --window-max-cols=80 --buffer-max-lines=50 --window-cols=80 --window-lines=50
lo
[27] hello world hello world hello world hello world hello world hello world hello
[28] hello world hello world hello world hello world hello world hello world hello
[29] hello world hello world hello world hello world hello world hello world hello
[30] hello world hello world hello world hello world hello world hello world hello
[31] hello world hello world hello world hello world hello world hello world hello
[32] hello world hello world hello world hello world hello world hello world hello
[33] hello world hello world hello world hello world hello world hello world hello
[34] hello world hello world hello world hello world hello world hello world hello
[35] hello world hello world hello world hello world hello world hello world hello
[36] hello world hello world hello world hello world hello world hello world hello
[37] hello world hello world hello world hello world hello world hello world hello
[38] hello world hello world hello world hello world hello world hello world hello
[39] hello world hello world hello world hello world hello world hello world hello
[40] hello world hello world hello world hello world hello world hello world hello
[41] hello world hello world hello world hello world hello world hello world hello
[42] hello world hello world hello world hello world hello world hello world hello
[43] hello world hello world hello world hello world hello world hello world hello
[44] hello world hello world hello world hello world hello world hello world hello
[45] hello world hello world hello world hello world hello world hello world hello
[46] hello world hello world hello world hello world hello world hello world hello
[47] hello world hello world hello world hello world hello world hello world hello
[48] hello world hello world hello world hello world hello world hello world hello
[49] hello world hello world hello world hello world hello world hello world hello
[50] hello world hello world hello world hello world hello world hello world hello%I'm not sure what the correct fix for this - any idea? |
This PR ensures that every
newline: truecorresponds to an actual newline character, and conversely that every newline character has anewline: truefield somewhere.This:
huge-line.sh)