Bug 321135 - [PATCH] Add option to disable swap files
Summary: [PATCH] Add option to disable swap files
Alias: None
Product: kate
Classification: Unclassified
Component: application (show other bugs)
Version: 3.10.3
Platform: Archlinux Packages Linux
: NOR normal with 61 votes (vote)
Target Milestone: ---
Assignee: KWrite Developers
: 318452 (view as bug list)
Depends on:
Reported: 2013-06-14 03:58 UTC by Duy Truong
Modified: 2015-06-19 07:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0

Patch for KDE 4.11.4: Add ComboBox allowing swap files to be disabled completely (8.07 KB, patch)
2013-12-04 13:53 UTC, Felix W

Note You need to log in before you can comment on or make changes to this bug.
Description Duy Truong 2013-06-14 03:58:07 UTC
This is a feature request. I'm not sure if it's the right place, but a user on bug #317799 suggested filing a report here with this info.

Kate doesn't always recognize that it's editing a file on a networked filesystem (on gnome, on autofs, custom fusefs, etc.). In these cases, there will be a network transaction for every character typed; and Kate UI will lag. Furthermore, on flash devices, this can wear down the device pretty quickly.

One seemingly easy solution would be to either add a user-configurable option to disable swap files completely, or have the swap file be saved somewhere local (like /tmp).

Reproducible: Always

Steps to Reproduce:
1. Use sshfs to mount something on an oversea host
2. Use Kate to open a file on that mount
3. Try to type something
Actual Results:  
Kate lags on every character typed.

Expected Results:  
Kate UI should be smooth.

I'm choosing severity = Normal, since there is no "easy workaround" that I can find.
Comment 1 Felix W 2013-07-15 16:25:43 UTC
Though I don't use sshfs this is still _really_ annoying if the edited text files are in shared folders of cloud storage applications, e.g. Dropbox. Every time I edit a text file using KWrite, I have to disable cloud syncing or the swap file will be uploaded on each key press, which then shows a nice "file changed" notification to my coworkers...

Maybe one could re-introduce the behaviour removed when fixing bug #309751 as an additional option or change the .swp file storage to /tmp as suggested in the above comment. This would be also nice to have when using a SSD to decrease disk writes.
Comment 2 Dominik Haumann 2013-09-12 06:37:28 UTC
*** Bug 318452 has been marked as a duplicate of this bug. ***
Comment 3 Michael D 2013-11-17 19:23:34 UTC
Status should be CONFIRMED. I'm observing this bug as well on KDE 4.11.3, Kubuntu 13.10. If you edit a text file you can see (e.g. in Dolphin with hidden files showing) the swp file being modified.
Comment 4 Felix W 2013-12-04 13:53:56 UTC
Created attachment 83922 [details]
Patch for KDE 4.11.4: Add ComboBox allowing swap files to be disabled completely
Comment 5 Dominik Haumann 2013-12-04 14:46:32 UTC
This patch removes the option that the swap file is synced every 15 seconds. It should be an additional option.

Michal currently works on this, too. See review request: https://git.reviewboard.kde.org/r/114229/
Comment 6 Felix W 2013-12-04 14:54:42 UTC
Thanks, didn't see that review request.

Can you explain why it would remove the option to sync the swap file every 15 seconds?
The ComboBox which I added has 3 options:
- Sync every 15s
- Disable syncing
- Disable completely
Comment 7 Dominik Haumann 2013-12-04 15:03:01 UTC
Oh right, I messed that up: Your patch still includes it, sorry :-)

Michal, since this also touches the code of how swap files work: Can you take care of this?
Comment 8 Dominik Haumann 2013-12-04 15:06:14 UTC
@Felix, best if you post your patches on reviewboard.kde.org :-)

Btw, I like having these options in the combo box.
Comment 9 Felix W 2013-12-04 16:52:56 UTC
I uploaded the patch to reviewboard, modified for the current git revision:

Hope I've done that right ;-)
Comment 10 Michal Humpula 2013-12-28 14:48:27 UTC
Git commit 5bc16f7edf1fda6db33cdd8cbe96122f595c510b by Michal Humpula.
Committed on 23/12/2013 at 17:59.
Pushed by michalhumpula into branch 'frameworks'.

add posibility to change swap file location

REVIEW: 114229
Related: bug 328244

M  +67   -4    part/dialogs/katedialogs.cpp
M  +1    -0    part/dialogs/katedialogs.h
M  +132  -26   part/dialogs/opensaveconfigadvwidget.ui
M  +4    -3    part/document/katedocument.cpp
M  +21   -8    part/swapfile/kateswapfile.cpp
M  +73   -14   part/utils/kateconfig.cpp
M  +22   -4    part/utils/kateconfig.h

Comment 11 Michael D 2014-12-11 08:02:11 UTC
The option does nothing for me in Kate 3.14.1 on Kubuntu 14.10, KDE version 4.14.1.

Whether I check or uncheck the option to disable the swap file, swap syncing is ALWAYS enabled.
Comment 12 Michael D 2015-06-19 07:27:05 UTC
I tested this in Plasma 5/KF5 (Kubuntu 15.04) a couple months back and it still doesn't work. Whether or not the option is set to disable syncing, syncing takes place. This means constant dropbox activity even when I'm not saving a file, requiring that I constantly pause and resume syncing when I'm working on a text file.

Can this bug be reopened, assuming nothing has changed in the last couple of months?