SUMMARY If an external tool is set to replace the current document with the output of the command, an extra empty line is appended to the original document if you undo using the tool. STEPS TO REPRODUCE 1. In Tools / External Tools / Configure, click Add / Add Tool... 2. Set Output to Replace Current Document. 3. Leave Reload Current Document unchecked. You may add %{Document:Text} as the input of the tool, or you may set Save to Current Document, and have the tool read the file by adding "%{Document:NativeFilePath}" as a parameter; it doesn't seem to matter. Complete the form to add the tool. 4. Invoke the external tool from the Tools / External Tools menu. 5. Undo. OBSERVED RESULT You get back the document as it was before invoking the tool, except with an extra empty line added at the end. EXPECTED RESULT You get back the document as it was. SOFTWARE/OS VERSIONS openSUSE Tumbleweed 20200925 KDE Plasma Version: 5.19.5 KDE Frameworks Version: 5.74.0 Qt Version: 5.15.1
In the Open/Save config page in Kate's config dialog, do you have the "Append newline" at the end of the file if not present checked?
(In reply to Dominik Haumann from comment #1) > In the Open/Save config page in Kate's config dialog, do you have the > "Append newline" at the end of the file if not present checked? I do, but the bug persists even if I uncheck it. Also, the addition of the extra line doesn't get added to the undo stack. The extra line stays there even after further presses of Undo, even while edits made before running the external tool are getting undone.
I just tried again, and cannot reproduce, What do you have as Executable? I used `cat` to output the document contents from Disk via Argument "%{Document:NativeFilePath}". That works exactly as expected.
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!