Closed crackcomm closed 2 weeks ago
I noticed missing last characters even in output w/o indentation. It was some go.sum
file IIRC.
Also running into this this. I couldn't quite deduce in the code where this is rendered/handled (I did look through src/render.rs
).
I'm looking at fixing this so if anyone has any pointers as to where to start reading and/or editing that'd be appreciated!
Also running into this this. I couldn't quite deduce in the code where this is rendered/handled (I did look through src/render.rs).
@firestack I believe that there's nowhere specific in the code that handles tab characters. My guess is that we simply print tab characters to the screen literally, and the terminal emulator does the normal tab behavior, i.e. moves the cursor to the next tabbable column, and continues printing there. This kind of makes sense as we see in the screenshots how random parts of the output seem to be truncated — it would make sense if we just started drawing/overwriting at random later portions of the line.
The easiest fix would be to replace each tab character with several spaces (note that we have to choose a fixed-width representation as we won't be able to calculate where the rest of the line would render, figure out where to truncate text, be able to render text side-by-side, etc.).
Awesome, thank you @arxanas!
I was able to fix the buggy rendering by replacing tabs with the ␉
symbol. But as a user (who loves tabs), I wouldn't be happy with this as a final solution. I'm personally a fan of →
, but I wouldn't expect that to work for everyone.
I briefly looked for some way to make this character configurable but didn't find anything, so any pointers would be appreciated.
I'm thinking on it some more before opening a PR to chat about it, but if there's no immediate objections here and I don't come up with something better, I'll open this diff as a PR "Soon™️"
The arrow seems fine to me. I would prefer to have intuitive iconography to descriptive iconography. We are not trying to have 100% fidelity for the rendered diff anyways. But I would like to see the arrow embedded in some number of spaces for alignment, rather than having the tab itself span only one column.
Issue mentioned on discord. Not sure exactly what happened - not rendered tab or replaced with a different character.
misrendered output (notice last character is missing):
with spaces instead of tabs: