Bug 82842 - indent doesn't work correctly when using spaces instead of tabs
Summary: indent doesn't work correctly when using spaces instead of tabs
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-04 18:40 UTC by Stylez Daviz
Modified: 2004-07-06 22:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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');