SublimeText / AdvancedNewFile

File creation plugin for Sublime Text
MIT License
829 stars 93 forks source link

AltGr+n issue and resolution #136

Closed mabasic closed 4 years ago

mabasic commented 9 years ago

I'm having issues with AltGr+n keymap binding.

Whenever I click AltGr+n it invokes this { "keys": ["ctrl+alt+n"], "command": "advanced_new_file_new"}, but that key combo on my keyboard usually closes }. As you can imagine it is very frustrating to not be able to close the brackets.

I have found the solution:

If I place the above keymap in my user keymap file it does not work for some reason.

Now it works, but could you just delete that binding and let people add it if needed?

skuroda commented 9 years ago

Hi, unfortunately I won't be removing the behavior as it's the established default. The key bindings that are there now were part of the plugin when I inherited it. As to not break it for any existing users, I chose to leave it in. All the new commands I have added do not include a default key binding. I'm glad you found the solution leveraging the override functionality.

If I may make a suggestion though, rather than extracting the entire package, simply open the key binding file using PackageResourceViewer. Then, edit the keybinding file and save. When the file is saved, it will place it in the appropriate location to override the packaged file. This will allow you to uptake new functionality and bug fixes when they are pushed. If you extract the entire file, you won't receive these updates.

Thank you for using AdvancedNewFile (and PackageResourceViewer)!

FichteFoll commented 8 years ago

Instead of changing default files (using PackageResourceViewer), it is usually better to re-override things whenever possile. For keybindings, this would be inside your user keybindings.

The reason is that if there ever are changes to the file in the package the changes will not go through, you will not notice and not be notified.

However, for elementary input characters this won't do because other key bindings that hook the } key directly (notably in the default bindings to not insert another } if there already is one following) do not receive the original character event, so ... yeah, you have to change the override the file, sadly.