Bug 359840 - Incorrect smartTab indentation mode implementation
Summary: Incorrect smartTab indentation mode implementation
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: part (other bugs)
Version First Reported In: 5.0.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2016-02-26 21:41 UTC by lampus.lapin
Modified: 2019-05-25 08:10 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 lampus.lapin 2016-02-26 21:41:58 UTC
It's not a bug actually, but very strange behavior for advanced text editor.
Accordingly to source code radio button "Increase indentations level if in leading blank space" enables so called "Smart Tab Mode":
KateDocumentConfig::global()->setTabHandling(KateDocumentConfig::tabSmart);

But it works in absolutely opposite way than expected.
When we say about "Smart Tabs" usually is mentioned something like described here: https://www.emacswiki.org/emacs/SmartTabs

Short quote from link above: "There is a semantic way of using tab characters in source code: tabs for indentation, spaces for alignment. This ensures that the code is displayed correctly everywhere, regardless of the viewer’s tab size."

Reproducible: Always

Steps to Reproduce:
1. Start any application based on ktexteditor component (e.g. kate)
2. Go to Indentation Config dialog (Kate-specific example: Settings -> Configure Kate... -> Editing -> Indentation)
3. Select Default indentation mode: Normal
Check radio button "Tabulators and spaces" in "Indent using:" group box.
Check radio button "Increase indentations level if in leading blank space"
4. Press "Tab"
5. Input some keyword
6. Press "Tab" again

Actual Results:  
String "....keyword\t", where
'.' - space symbol,
\t - tabulator;


Expected Results:  
String "\tkeyword...."

ktexteditor version 5.19.0
Comment 1 Edward Kigwana 2019-05-25 08:10:23 UTC
The reporter prefers first indention to be a tab and subsequent tabs to be replaced with equivalent number of spaces.

The "Indent using" option is clear for (1) Tabulators, (2) Spaces, (3) Tabulators and spaces.

The value of a fourth option (4) Tabulator and spaces is debatable since you might as well just indent with (2) spaces.