Summary: | unused whitespaces don't get removed | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Felix Seeger <felix.seeger> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nassarsa |
Priority: | NOR | ||
Version: | 2.1 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Felix Seeger
2002-09-26 14:57:37 UTC
I can confirm this behaviour, but have to add some more information. I have the option "remove trailing spaces" enabled, but it doesn't seem to have effect at all. This is now about 6 months the situation, so I wonder if it is a local problem or a general one. The behaviour 6 months ago was, that if the option was enabled and I have trailing spaces/tabs, then they are removed when I leave with the cursor the respective line. I have compiled kde/qt from cvs. The bug is still there (cvs 2 days ago). I suggest to remove the option in the configuration dialog for the KDE 3.1 release. Philipp Subject: Re: unused whitespaces don't get removed > ------- Additional Comments From philipp.mueller@gmx.de 2002-11-18 11:06 > ------- The bug is still there (cvs 2 days ago). > > I suggest to remove the option in the configuration dialog for the KDE 3.1 > release. > > Philipp Uh, really, I loved that feature it is very useful, maybe leave it and fix it in 3.1.1 ? thanks have fun Felix -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE92QMDS0DOrvdnsewRAg9bAJwKQ2MNXqMViGJFKOSjKxAjGtI3SwCdGbVi pU59QGk3egQH/lNVcPPxsZ0= =CHSS -----END PGP SIGNATURE----- Maybe a bit drastic said. But at least it should be disabled, as it took me some time to be sure, that it is a bug and not a wrong usage. Of course I want to have this feature. Especially with autoindent, there are much to often unused whitespaces in empty rows (that's why I spent 10 points ;-). Philipp I liked the old behaviour! Was this intentinally changed? If it was changed for seeding up, an alternative options would be removing trailing spaces at save. The fact that this no longer works is simply a bug. Subject: kdelibs/kate/part CVS commit by rodda: Re-instating functionality for "remove trailing spaces" Needs a backport. CCMAIL:48315-done@bugs.kde.org M +11 -0 kateviewinternal.cpp 1.167 --- kdelibs/kate/part/kateviewinternal.cpp #1.166:1.167 @@ -1685,4 +1685,15 @@ void KateViewInternal::updateCursor( con } + // remove trailing spaces when leaving a line + if (m_doc->configFlags() & KateDocument::cfRemoveSpaces && cursor.line != newCursor.line) { + TextLine::Ptr textLine = m_doc->kateTextLine(cursor.line); + int newLen = textLine->lastChar(); + if (newLen == -1) { + textLine->truncate(0); + } else if (newLen != textLine->length()) { + textLine->truncate(newLen + 1); + } + } + // unfold if required TextLine::Ptr l = m_doc->kateTextLine( newCursor.line ); Just adding my vote and mentioning that this bug is still present in KDE 3.1.1a, hopefully this will be fixed in 3.1.2 I am using KDE 3.2.1 and I have this bug. I said in comment 9 above I had this bug in 3.2.1. Please disregard this information. I found unused spaces are gotten rid of when opening a file. I expected spaces to go away when saving, which is what my favorite Windows editor does (Textpad). |