Bug 82842

Summary: indent doesn't work correctly when using spaces instead of tabs
Product: [Applications] kate Reporter: Stylez Daviz <pol_potsmoker>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdevelop-devel
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stylez Daviz 2004-06-04 18:40:52 UTC
Version:           3.0.3 (using KDE 3.2.2, Gentoo)
Compiler:          gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7)
OS:                Linux (i686) release 2.6.5-gentoo-r1

indent doesn't work as expected within the integrated editor in KDevelop:

I'm using tabsize=4 and spaces instead of tabs (insert 4 spaces)

if you try to indent things like this, using 2 tabs after the data type:

int         x;
float       y;
char        c;

the result is:

int        x;
float        y;
char        c;
   
even when using spaces insted of tabs, the indented position should alsways be a multiple of tabsize.
Comment 1 Dominik Haumann 2004-07-06 22:33:53 UTC
CVS commit by dhaumann: 

fix: tab alignment (in insert-space-mode) by Jesse Yurkovich.
CCMAIL: 82842-done@bugs.kde.org


  M +4 -1      katedocument.cpp   1.734


--- kdelibs/kate/part/katedocument.cpp  #1.733:1.734
@@ -3281,5 +3281,8 @@ void KateDocument::insertIndentChars ( K
   QString s;
   if (config()->configFlags() & KateDocument::cfSpaceIndent)
-    s.fill (' ', config()->indentationWidth());
+  {
+    int width = config()->indentationWidth();
+    s.fill (' ', width - (view->cursorColumnReal() % width));
+  }
   else
     s.append ('\t');