[Lazarus] Tab/Shift tab and block indentation

Martin Frb lazarus at mfriebe.de
Sun Apr 19 23:40:46 CEST 2020


On 19/04/2020 23:22, Florian Klämpfl via lazarus wrote:
> When completing code, lazarus takes the Block indent value from the 
> editor options for indentions, so for proper indention one sets this 
> value to two spaces normally. However, this has the effect that 
> tab/shift+tab also un/indents by two spaces. This is often not useful 
> when reorganizing code. Is there any way to decouple these two 
> behaviors: so that code completion idents by 2, tab/shift+tab by 1? Or 
> do I need to adapt lazarus sources?
I don't think there is a 2nd setting for codetools.

But instead of using tab to (un-)indent selected lines, you can use the 
multi-caret feature.
Go to the left most column, on the first line. Then shift-alt-down until 
you have a caret in front of each line you wish to change. Now either 
delete spaces, or insert spaces.

Of course for un-indent that does not work, if there is a line with no 
spaces at the front. You can over-unindent it (block + shift tab), then 
shift-ctrl left click at the end of a line in the selection, to convert 
the selection into multi carets, hit home-key to get the carets to the 
front of lines, and insert a space.

The un-indent will work with empty lines in the range. "del" on 
multicaret will not remove line-ends. (backspace will remove line ends).


More information about the lazarus mailing list