mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
157 stars 65 forks source link

Trailing new line is missing when editing or copying to clipboard #589

Open baryluk opened 3 years ago

baryluk commented 3 years ago

So, apparently having a trailing newline in the file, then opening it in pluma, makes pluma display it different than most other editors.

This messes up copy and paste.

Way to reproduce the issue:

Execute echo First > a.txt to create example file with a trailing newline.

Open in pluma:

It will show like this:

Screenshot at 2020-12-05 12-00-33

(showing witespace characters enabled in options for clarity).

Press Ctrl+A to select whole file content. Then Ctrl+C to copy it to cliboard.

In a webbrower, navigate to https://gist.github.com/

Paste the content into main window, using 'Ctrl+V', then press "Create secret gist".

Click on "RAW".

Use the URL, to download (i.e. using wget) it to local storage.

Compare the downloaded file with a.txt.

Downloaded file will miss the trailing newline.

(You can use other methods to reproduce the same issue).

As a side note. Clicking File -> New, then File -> Save as..., with "empty" file, will create a file with zero bytes, but pluma will still display in editor that there is a new line at the end, but it doesn't save it. So it might be connected.

Package version

pluma 1.24.1-1 mate 1.24.0-1

Debian testing, amd64