Skip to content
Commit e8f77101 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Do not count trailing empty cells on selections

When selecting, the last line gets an added newline if the characters
returned from copyLineToStream() are less than the cells selected on that
last line.

A weird behaviour was that after running:

printf '                   v\n'
printf '\e[KSELECT ME\n'
printf '\e[31m\e[Kselect me\n'
printf '\e[0m                   ^\n'

selecting "SELECT ME          " would add a newline, while
selecting "select me          " would not add a newline.

This is a side-effect of clearImage() resizing lines which end with
spaces with the default rendition, so selecting the "SELECT ME" line
would get a count of 9 characters, which would make selecting more than
the initial 9 characters add a newline, while the "select me" line would
have additional spaces with isRealCharacter == false and a non-default
rendition.

Solve it but making copyLineToStream() not count and not pass to
PlainTextDecoder trailing characters where isRealCharacter == false.
parent 4e0bcd4e
Pipeline #179801 passed with stage
in 2 minutes and 33 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment