Trim all whitespace from end of line, except for last line and
only use '\r' to terminate the pasted lines as expected by TTY.
Submitted by: Ivan Quitschal <tezeka@hotmail.com>
MFC after: 1 week
Sponsored by: NVIDIA Networking
Differential D35552
vt: Fix contents of paste buffer for newcons. • hselasky on Jun 22 2022, 4:40 PM. Authored by Tags None Referenced Files
Details Trim all whitespace from end of line, except for last line and Submitted by: Ivan Quitschal <tezeka@hotmail.com>
Diff Detail
Event TimelineComment Actions Make sure to zero-fill the remainder of the paste buffer, which will be skipped during paste. Comment Actions Fix some bugs.
Comment Actions Worked "almost" as expected. *No unneeded '\0' pasted. *Proper newline. *Pasted wanted last-line trailing space. *But unfortunately, IDEOGRAPHIC (Full-width) SPACE (E38080, U+3000) seems to be treated as regular character, not as space. Anyway, thanks in advance! Comment Actions Updated patch with support for more unicode word separators. Patches will be split before commit. Comment Actions Thanks! *Trailing spaces only listed in switch() of tchar_is_word_separator() are deleted on non-last lines. *Space (tried U+3000 only, though) before U+2007, which is not listed and untouched, on non-last line is sanely kept. If any others having objection to handled spaces pop in, only the switch() part is needed to be re-considererd. |