Version: SVN (using Devel) OS: Linux Certain individuals I have to work with have trouble a: accepting that trailing spaces are bad, and b: coping with their removal in any manner. Because I consider it unacceptable to make my editor "broken" to appease such people, I want to use .kateconfig to disable the cleanup in certain directories. However this doesn't work. It seems that kate strips trailing spaces on load (since I never see them after opening a file). While this is okay and desirable if they should be stripped, ISTM kate needs to defer remove-trailing-space-load until after modelines (both in the file and .kateconfig) have been processed, rather than relying solely on the global setting for cleanup-on-load. Reproducible: Always Steps to Reproduce: - Create a file with trailing spaces - Create a .kateconfig in its directory - Make sure global 'remove trailing space on load/save' option is enabled - Open the file Actual Results: No trailing spaces Expected Results: kate reads .kateconfig and leaves trailing spaces alone
proposed patch here: http://reviewboard.kde.org/r/4456/
SVN commit 1158818 by mwoehlke: delay trailing-space-removal until config/variables are parsed Move removal of trailing spaces from KateTextBuffer::load to KateDocument::openFile, after config and variable parsing (which might tell us not to remove trailing space!) has been performed. Note that the removal also now goes into the undo stack; for now we're considering this a good thing. BUG: 239077 M +0 -10 buffer/katetextbuffer.cpp M +2 -0 document/katebuffer.cpp M +10 -0 document/katedocument.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1158818
This change introduced report #306926. Matthew, can you please comment on this?
Are you sure? Based on my previous comment (and seems to match my recollection), it was always the case that trailing spaces are stripped immediately. Probably because it looks better? If you're asking an opinion on behavior and not for me to remember a two-year-old code change :-), I would say it is probably okay to not strip on load at all. I guess this means you also have to modify the file before you can save it to affect trailing space stripping; again, okay. (The trick, and I think this might have something to do with the current behavior, is trailing space should be visible on open, then stripped in the internal buffer also on save. ISTR that being problematic at some point, i.e. the file on disk was stripped but kate was still showing trailing spaces. I could be imagining that, though.)
Git commit 01253aadd7337694644bd43dea5aab2ab02dd0f4 by Dominik Haumann. Committed on 25/10/2012 at 16:59. Pushed by dhaumann into branch 'master'. never remove trailing spaces on load This was discussed over the years again and again, and we get bug reports that criticize that files are modified directly after opening. From now on, Kate only supports the removal of trailing spaces on save, and not on load. Related: bug 306926 M +2 -2 part/dialogs/opensaveconfigwidget.ui M +2 -4 part/document/katebuffer.cpp M +0 -10 part/document/katedocument.cpp http://commits.kde.org/kate/01253aadd7337694644bd43dea5aab2ab02dd0f4