Bug 93484 - Auto-indent in "C Style" put cursor to a wrong position
Summary: Auto-indent in "C Style" put cursor to a wrong position
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 2.3.1
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-18 01:50 UTC by Jie Gao
Modified: 2007-08-30 10:37 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 Jie Gao 2004-11-18 01:50:41 UTC
Version:           2.3.1 (using KDE KDE 3.3.1)
Installed from:    FreeBSD Ports
Compiler:          gcc-3.4.2 gcc version 3.4.2 [FreeBSD] 20040728
OS:                FreeBSD

In kate (anything that uses kate part), if the Indentation Mode is set to "C Style", auto-indent will put the cursor to a wrong position. When kate tries to indent the text with tab characters, the last tab character is placed AFTER the cursor.

E.g., you type:

Hello[enter]
[tab]world![enter]

After that, you will find in the third line, the cursor is at the beginning of the line while a tab character is inserted AFTER the cursor.

This only happens in "C Style" indentation mode. In "Normal" indentation mode there is no such error.

This was also in KDE-3.3's kate.

Another FreeBSD user has confirmed this problem.
Comment 1 Richard Smith 2004-11-18 02:00:48 UTC
On Thursday 18 November 2004 00:50, Jie Gao wrote:
> In kate (anything that uses kate part), if the Indentation Mode is set to
> "C Style", auto-indent will put the cursor to a wrong position.

I had this problem in csands. I can't remember how I fixed it, but it might be 
a good place to look for inspiration.

Comment 2 Dominik Haumann 2004-11-19 15:59:41 UTC
CVS commit by dhaumann: 

fix bug #93484.
CCBUG: 93484


  M +0 -1      kateautoindent.cpp   1.23.2.3


--- kdelibs/kate/part/kateautoindent.cpp  #1.23.2.2:1.23.2.3
@@ -485,5 +485,4 @@ void KateCSmartIndent::processNewline (K
     {
       KateAutoIndent::processNewline (begin, needContinue);
-      begin.setCol(begin.col() - 1);
     }
 


Comment 3 Dominik Haumann 2004-11-19 16:01:26 UTC
CVS commit by dhaumann: 

fix bug #93484: C Style indenter puts cursor to a wrong position.
BUG: 93484


  M +0 -1      kateautoindent.cpp   1.44


--- kdelibs/kate/part/kateautoindent.cpp  #1.43:1.44
@@ -529,5 +529,4 @@ void KateCSmartIndent::processNewline (K
     {
       KateAutoIndent::processNewline (begin, needContinue);
-      begin.setCol(begin.col() - 1);
     }