Bug 442469

Summary: Running a external tool on saving.
Product: [Applications] kate Reporter: Derek Christ <christ.derek>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: waqar.17a
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Derek Christ 2021-09-15 09:24:05 UTC
SUMMARY
It would be a nice convenience to be able to run a external tool every time the user saves the current file. For example by saving the file a code formatter tool could run and format all changes.

STEPS TO REPRODUCE
1. Setup a external tool to run on save
2. Every time the user saves, the tool runs

OBSERVED RESULT
Not yet possible, to my understanding.


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210913
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
It's possible to do something similar with hacks. Just assign Ctrl+S on the external tool and config the tool that it will save the current file before running.
But this is not a very nice solution to the problem.
Comment 1 Dominik Haumann 2021-09-18 02:32:26 UTC
This would have to be implemented with care: an external tool can specify to save the current or all documents on execution, that could quickly lead to an infinite loop.

If I understand correctly, it's also the idea to run a tool right before saving and nor after it was already saved.
Comment 2 Waqar Ahmed 2022-01-16 16:41:12 UTC
Closing as dup, but an implementation is in the works.

*** This bug has been marked as a duplicate of bug 406109 ***