Version: (using KDE 4.1.3) OS: Linux Installed from: SuSE RPMs To reproduce, just create a new file, write "Hello KDE World", select the word KDE, and then press tab. A new tab is added at the beginning of the line, while I would expect the word KDE to be replaced by a tab between Hello and World.
Confirmed. It seems despite the note (if no selection exists) of the "Tab key action" kate considers the selected type of tab-key-action even when a selection exists.
I believe this is by design, if you want tab key to indent, it also indents a selection.
But shouldn't the indentation at least start at the beginning of the selection and not at the beginning of the line? I think the word not being deleted is not that big a problem, but the tab should appear before the word, "Hello \tKDE World" is acceptable too I think.
Well, if you select multiple lines TAB indents, no matter where the selection starts. Right now, this is also the case if (part of) a single line is selected. I heavily disagree that the indentation should be inserted right before the selected text. I'd be fine with this: - if multiple lines selected -> indent - if single line / part of a line selected -> remove selected text and insert a TAB (or equivalent amount of spaces) Maybe in block selection mode it should work as Ivo said, i.e. always insert TAB in front of each line that is selected...
I'm with Dominik on this one, though I can't comment on the Block-Selection Mode as I don't use it.
SVN commit 1093175 by cullmann: make indent smarter, if you have activated, that tab key indents but only part of line is selected, it will only indent if in leading whitespace, otherwise will insert tab or what is configured BUG: 175588 M +6 -3 kateviewinternal.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1093175
Hello, I was about to report a bug on Kate for this, because while in Block selection mode, I cannot enter a tab at the same position for multiple lines in one shot, which was super handy in my use case. I could enter any other character and have it applied to all the lines affected by the block selection, AT THE position of my selection. Only tab behaves differently, and now I see why. I think that the condition to use tab for indentation here should be made stronger: only use tab for indent if the entire line(s) (i.e. from char 0 to length-1) is/are selected. If only part of it is selected, the user probably expects tab to just insert a \t character. I'm reopening this to further review the behavior that was implemented. Thanks
Created attachment 149395 [details] Tab behavior inconsistent with respect to other entries
Use multiple cursors instead.