Bug 188632

Summary: Tab always creates two spaces when editing Ruby (and I want a real Tab)
Product: [Applications] kate Reporter: Iñaki Baz Castillo <ibc>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: robinpeder
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Iñaki Baz Castillo 2009-04-02 01:04:34 UTC
Version:           3.2.1 (using 4.2.1 (KDE 4.2.1), Kubuntu packages)
Compiler:          cc
OS:                Linux (x86_64) release 2.6.27-11-generic

In KDE 3.X I could edit Ruby files and use the Tab key to create a real Tab (instead of spaces).

In KDE 4.2.1, when editing a Ruby file with Kate, Tab just creates a Tab in empty lines, or when pressing Enter so the new line is aligned based on the number of tabs present in the previous line.
But in case I press Tab tu increase indentation of a line (containing text) I get two spaces.

Also, when I select some lines and press Tab they are deleted instead of indentated (it didn't occur in KDE 3.X), but I suspect this is another issue.

I've checked and re-checked that my Kate configuration doesn't use spaces instead of Tab and so.
Comment 1 Iñaki Baz Castillo 2009-04-02 01:13:17 UTC
Sorry, a bug in the report:

> In KDE 4.2.1, when editing a Ruby file with Kate, Tab just creates a 
> Tab in empty lines

That's false, it also adds two spaces in that case.
Comment 2 Robin Pedersen 2009-04-02 09:04:09 UTC
Check that you have tab width (Editing->General->Tab Width) set to the same as indent width (Editing->Indentation->Indentation Width)
Comment 3 Iñaki Baz Castillo 2009-04-02 20:26:25 UTC
Ok thanks, changing that it works as usual.
But I wonder if it's the desirable behaviour. I see no reason for setting Tab width and also indentation width ¿?
Comment 4 Matthew Woehlke 2009-04-30 00:13:45 UTC
> I see no reason for setting Tab width and also indentation width?

GNU coding style is tab-width=8, indent-width=3 (and uses mixed indentation).

IOW, the amount you indent by is not always the same as what you want tab width to be. (In fact, I'd even venture that tab-width=8 and indent-width=4 (or 2) may be the most common combination.)