[Lazarus] Tab/Shift tab and block indentation

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Tab/Shift tab and block indentation

Free Pascal - Lazarus mailing list
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?
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Tab/Shift tab and block indentation

Free Pascal - Lazarus mailing list
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).
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Tab/Shift tab and block indentation

Free Pascal - Lazarus mailing list
Am 19.04.20 um 23:40 schrieb Martin Frb via lazarus:
> 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.

Would be great to have :)

>
> 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.

Problem is, that backspace behaves really uncontrollable in this case:
lines get one char removes others more, I think it does some unindent
operation as well instead of just removing chars.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus