Bug 48315 - unused whitespaces don't get removed
Summary: unused whitespaces don't get removed
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-26 14:57 UTC by Felix Seeger
Modified: 2004-03-13 18:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Seeger 2002-09-26 14:57:37 UTC
Version:           2.1 (using KDE 3.0.8 (KDE 3.1 beta2))
Installed from:    compiled sources
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease)
OS:          Linux (i686) release 2.4.20-pre5

enter a tab, enter text, press return, press return
delete the spaces or the tab in your line (line3)
enter text, press enter

The tab or the spaces in line 2 dont get removed


thanks
have fun
Felix
Comment 1 Philipp Müller 2002-10-23 14:06:59 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.
Comment 2 Philipp Müller 2002-11-18 11:06:09 UTC
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
Comment 3 Felix Seeger 2002-11-18 16:12:09 UTC
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-----

Comment 4 Philipp Müller 2002-11-18 18:38:36 UTC
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 
Comment 5 Anders Lund 2002-11-25 23:40:38 UTC
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. 
Comment 6 John Firebaugh 2002-12-02 00:53:47 UTC
The fact that this no longer works is simply a bug. 
Comment 7 Hamish Rodda 2003-01-20 05:03:21 UTC
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 );


Comment 8 Samir M. Nassar 2003-05-02 17:43:06 UTC
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
Comment 9 Philippe A 2004-03-11 03:52:29 UTC
I am using KDE 3.2.1 and I have this bug.
Comment 10 Philippe A 2004-03-13 18:36:32 UTC
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).