Sublime Forum

Macro for paren indenting doesn't work since update to 3.2

#1

I’ve been using the solution here along with here to get behavior so that when I press ( I get ((cursor here)), i.e. the same auto indentation that you get with braces.

	{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/User/Add Line in Braces.sublime-macro"}, "context":
	    [
	        { "key": "setting.auto_indent", "operator": "equal", "operand": true },
	        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
	        { "key": "preceding_text", "operator": "regex_contains", "operand": "\\($", "match_all": true },
	        { "key": "following_text", "operator": "regex_contains", "operand": "^\\)", "match_all": true }
	    ]
	},
	{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Add Line in Braces.sublime-macro"}, "context":
	    [
	        { "key": "setting.auto_indent", "operator": "equal", "operand": true },
	        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
	        { "key": "preceding_text", "operator": "regex_contains", "operand": "\\[$", "match_all": true },
	        { "key": "following_text", "operator": "regex_contains", "operand": "^\\]", "match_all": true }
	    ]
	},

Is what i have in my keymap. But now when I type ( I get an error, “Unable to open res://Packages/User/Add Line in Braces.sublime-macro”.

Does anyone know what’s going on / how to fix? Thanks!

0 Likes

#2

Actually I was able to get it to work by randomly renaming the file to just “Paren”, I dunno if spaces are an issue or what but it works now…

0 Likes

#3

Does it fail again if you add a space in the file name? try something different than before like Paren Test.sublime-macro

To help the devs fix this likely regression, what OS & version are you on?

0 Likes

#4

Huh I can’t get it to fail again now. I tried restarting ST and renaming back to the original name even but it just works now. Last night I’d also tried restarting everything and nothing worked until I renamed the file. I also tried in files with different syntax highlighting (both now and last night). If I encounter the issue again I’ll go back to this thread and re-document.

0 Likes