mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

autocompletion for local macros #12

Closed andrewzeitlin closed 6 years ago

andrewzeitlin commented 7 years ago

Hi Mattias,

I've been really enjoying using this. One quirk I notice: when you enter the left-single-quote "`" for a local macro, this is auto-completed with a matching right-single-quote "'", which is as it should be. But - by contrast with, say, the behavior for matching parentheses- if you type ' when you arrive to the end of the local macro name, it doesn't skip over the existing ' character, but rather inserts a second one.

Might it be possible to change this? In my user keybindings I have added the following, which is isn't quite right, but yields a more natural behavior more of the time: { "keys": ["'"], "command": "move", "args": {"by": "subword_ends", "forward": true}, "context": [ { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, { "key": "preceding_text", "operator": "regex_contains", "operand": "^", "match_all": true }, ] }

Many thanks! Andrew

bryanwhiting commented 7 years ago

I've created the same keybinding!

mattiasnordin commented 7 years ago

Sounds like a good idea, I'll use it for the next update, thanks!

mattiasnordin commented 7 years ago

I just released version 0.8.0 where this should be fixed. Please let me know if it still does not work.