Closed adriangoransson closed 10 years ago
I had the same issue, is there a way to override this mapping?
Did a quick and dirty workaround, add { "keys": ["alt+shift+9"], "command": "insert_snippet", "args": {"contents": "}"}}
to your Keybindings settings
Great, thanks! :smile:
+1. Very annoying bug, had to disable packages at random to find the culprit.
The workaround is not a complete fix, unfortunately. ST intelligently ignores the end brace when you're already before an automatically inserted one. For example, type "{" (which automatically inserts an ending "}"), "}" and you'll end up with "{}". With the workaround, you'll end up with "{}}".
:+1:
Had the same problems with my Norwegian keyboard. Thanks for workaround!
@atombender Next time you can use sublime.log_commands(True)
in the console to easily find the culprit :wink:
That's fantastic. Thanks!
I was lucky it's called better coffescript ... it was the first plugin i looked at.
Sublime has intelligent default keybinds attached to "}". You could attach them to "alt+shift+9" in your user-defined keybinds to override the toggle_parens one, and revert back to the exact behavior you're used to...
{ "keys": ["alt+shift+9"], "command": "move", "args": {"by": "characters", "forward": true}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
]
},
That said, my apologies for overriding your keys. I tried to tie the toggle_parens
command to some key combination that (a) made sense and (b) was unused, but I didn't consider the layout of Swedish/Norwegian keyboards.
This speaks to a larger issue with the plugin, though (see #147). Alt+Shift as the prefix for Better Coffeescript's keybinds has the tendency to step on the toes of various things. For that reason, it's more typical that keybinds are tied to Ctrl/Super. The problem, though, is that there are only so many combinations out there, and everything steps on some toes eventually.
That said, I'm going to add a status message, "Better Coffeescript - unable to toggle parens", when this occurs (and hopefully including that in this comment will lead people to this issue / workaround).
Again, sorry for the inconvenience.
you are excused, no one ever thinks of Swedish/Norwegian/Danish keyboards
For future reference, this post from the Sublime forums helped me with this, I simply removed the keybinding from the file using the PackageResourceViewer package.
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=13303
You can try overriding the package file to remove the keybinding you want. For the sake of simplicity, you can use PackageResourceViewer. Simply open Default/Default (your platform).sublime-keymap. Then remove the entry you want and save. It will create the file in the correct location for the "override" behavior.
Is there actually any need for this keybinding?
The shift+8
already does the same on OS X at least if you wrap around your selection around the function arguments?
Otherwise i would recommend using either:
alt+shift+0
=> ≠
alt+shift+&
=> ¶
Who uses these symbols anyways?
Another vote for fixing this bug asap.
+1
Please move the
toggle_parens
key binding away from the end of the number row. Or give some visual indication in the UI (status bar perhaps) that something has happened. On my Swedish QWERTY board it overrides}
and I spent longer than I care to admit wondering what was wrong with my keyboard.