Better auto-indentation

Komodo have pretty poor auto-indentation now. For example, when you add if statement around some block of code, it doesn’t move code inside one tab forward after pressing } bracket.

Also, if you have a multi-line snippet and you insert it, it doesn’t add needed tabs too. You have to add them manually all the time.

IDE should provide more intelligent auto-indentation in my opinion. It should be triggered when pressing enter or type ending bracket or finishing line with ; or pasting. Is there any plans to make this improves in Komodo?

2 Likes

File enhancements for these, please :slight_smile:

Hi, Komodo will not take it upon itself to re-indent blocks of code like the case in your first screenshot. For snippets, make sure you check the “maintain indentation context after insertion” in the snippet’s properties. Then you’ll have the snippet’s line auto-indented.

For the first case, it’s actually annoying, having this feature would be nice. For the second case, I think “snippet” is not a correct word there. If you insert a multi-line string inside a block with indent in it, it will only indent the first line.

{
[..] | <passed block there, line 1>
<passed block there, line 2..inf>
}

[..] - an indent (tab or spaces, whatever)
| - the cursor
<passed block> - the block from your current buffer inserted with Ctrl+V.

imo auto indenting code based on what you write around it is far too error prone. Better would be that we improve our block selection (which is on the roadmap) so you can easily select blocks to indent.