Clever indentation of brackets (brackets) in sublime text 2

I have a pretty nice tweak to edit and run maxscript from within sublime text 2.

The only thing I recently wanted was to emulate or copy the behavior of curly braces using regular parentheses

EDIT: Sorry - Chrome decided that I finished editing there when I was not :(

If I type if (x) then {, then enterI will get a beautifully formatted block, with a carriage now with an arrow

if(x) then {
    <-
}

but I can’t find the place where the text hides it.

I want to copy this behavior to regular parentheses ()instead of getting

if (x) then (
    <-)
+5
source share
1 answer

, , . "keys": ["enter"] "(" "{".

AddLineInBraces.sublime-macro {"command": "left_delete" }, :

[
    {"command": "insert", "args": {"characters": "\n\n"} },
    {"command": "left_delete" },
    {"command": "move", "args": {"by": "lines", "forward": false} },
    {"command": "move_to", "args": {"to": "hardeol", "extend": false} },
    {"command": "reindent", "args": {"single_line": true} }
]

, . !

MXS , .

Ghoul Fool , , , .

FrozenKiwi , maxscript Max ST2. . , , .

- ST2: shift + enter , ctrl + e , ( ) , . "" + tab format "var: %\n" (var as string)

, , . , .

maxscript ST2, , , , , . , Maxscript - , ++ SDK, ++ . , , .

+6

Source: https://habr.com/ru/post/1016630/


All Articles