Bug 172950 - can't create tab character in kwrite
Summary: can't create tab character in kwrite
Status: RESOLVED DUPLICATE of bug 145664
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 14:06 UTC by Thomas Drillich
Modified: 2015-08-11 10:59 UTC (History)
6 users (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 Thomas Drillich 2008-10-16 14:06:08 UTC
Version:           4.1.69 (using Devel)
Compiler:          gcc 
OS:                Linux
Installed from:    Compiled sources

kwrite inserts always spaces instead of tabs. 
Changes in Configure Kwrite -> Editing -> General -> "Insert spaces instead of tabulators"
doesn't have any effect.

This is really bad cause Makefiles needs \t as separators.
Comment 1 Matthew Woehlke 2008-10-16 22:14:26 UTC
Works here last I checked, unless it broke recently. Is your indent width == your tab width?

Note: you might want to use the "command line" (F7 by default; View->Switch to Command Line) and issue the commands "set-indent-width 4", "set-tab-width 4" and "set-replace-tabs off" (and maybe "set-replace-tabs-save off"). If that works, then the problem is either in the GUI option setting or the filemode default settings.
Comment 2 Thomas Drillich 2008-10-17 12:50:01 UTC
That is unexpected ... when I set tab width == indent with I'm able
to create tabs.

But isn't it a bug if kwrite create space indends instead of \t,
if in configure->editing options->insert spaces instead of tabulators is
off.


BTW. Where could I find docs about the command line commands.
     I did not find a menu entry View->Switch to Command Line
     
Comment 3 Burkhard Lück 2008-10-18 09:41:23 UTC
>
> BTW. Where could I find docs about the command line commands.

In Kate's Handbook Chapter 6. Advanced Editing Tools -> The Editor Component 
Command Line

>      I did not find a menu entry View->Switch to Command Line

It is in the Kwrite Handbook since r607981 (22 months, 3 weeks ago) :
"The Menu Entries
The View menu
The View menu allows you to manage settings specific to the active editor, and 
to manage frames.
[snip]
View->Switch to Command Line (F7) 
Displays the Katepart command line at the bottom of the window. In the command 
line, type help to get help and help list to get a list of commands."
Comment 4 Matthew Woehlke 2008-10-28 01:10:59 UTC
> But isn't it a bug if kwrite create space indends instead of \t, if in configure->editing options->insert spaces instead of tabulators is off. 

Not if you have it configured so tab indents rather than inserting tabulators? If tab-width == indent-width gives you tabs and you've asked the tab key to indent, I think that's correct behavior. Otherwise if you disable indenting with the tab key, I think you should get tabs unless your options are to use spaces instead of tabs.

Clear as mud?
Comment 5 Christoph Cullmann 2009-04-22 16:26:24 UTC
The other bug should be used for adding feature to always be able to force tab insertion.

*** This bug has been marked as a duplicate of bug 145664 ***
Comment 6 gd2shoe 2009-08-01 23:39:02 UTC
Yeah, it's as clear as mud.  It might be working according to design, but I shouldn't need to peruse bug reports to figure out how to make the dang tab key work!

Whoever designed this behavior wasn't thinking.  The default should be tabs, in my opinion.  If it isn't, there should be a quick and intuitive way to fix it.  (ex: a check box "link to indentation width - causes tabs to appear instead of spaces" )
Comment 7 Serge Dundich 2015-08-11 10:30:21 UTC
(In reply to Matthew Woehlke from comment #4)
> > But isn't it a bug if kwrite create space indends instead of \t, if in configure->editing options->insert spaces instead of tabulators is off. 
> 
> Not if you have it configured so tab indents rather than inserting
> tabulators? If tab-width == indent-width gives you tabs and you've asked the
> tab key to indent, I think that's correct behavior. Otherwise if you disable
> indenting with the tab key, I think you should get tabs unless your options
> are to use spaces instead of tabs.

That would be perfectly correct if it would be this way in reality.

Unfortunately I cannot configure KWrite to insert TAB character when I press TAB key and use only spaces for indent at the same time (at least for KWrite 5.0.0 with KDE Frameworks 5.12.0).

In Settings->Editing->Indentation->Tab key action: (1) "Always advance to next tab position", (2) "Always increase indentation level", (3) "Increase indentation level if in leading blank space".

None of them insert TAB character if I set "Indent Using" -> "Spaces".

There must be some option like "Always insert TAB character" (probably instead of "Always advance to next tab position" - that is completely useless if it inserts spaces).
Comment 8 Kåre Särs 2015-08-11 10:59:39 UTC
There is a bit hidden way

There is an action that can be assigned a shortcut for inserting Tabs no mater what the indentation mode is.

Settings -> Configure Shortcuts: "Search for Tab" and assign a shortcut for it. I have assigned the Tab key for this (reassigning from some other action)