Don't add extra newlines when pasting from GTK applications

Authored by ahmadsamir on Jun 14 2020, 9:40 AM.

Description

Don't add extra newlines when pasting from GTK applications

Due to some internal handling in GTK itself, we end up with text copied
from Firefox where a newline is represented as CRLF (\r\n); since the
doPaste() method replaces each \n with \r, we ended up with \r\r, which
ultimately led to extra newlines in the pasted code. To fix the issue
simply detect the CRLF case and replace each \r\n with \r.

To test, copy some multiline text from Firefox, open vim in konsole and
paste, you end up with two newlines between each block of text. Compare the
results after applying this patch

BUG: 421480
FIXED-IN: 20.04.3
(cherry picked from commit a1022442dc2f59321976fd3456ad97c61300d1f2)

Details

Committed
hindenburgJun 19 2020, 2:49 PM
Parents
R319:bfe9ee031e08: SVN_SILENT made messages (.desktop file) - always resolve ours
Branches
Unknown
Tags
Unknown
References
release/20.04