SublimeText / AdvancedNewFile

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

Doesn't work on Linux at all #126

Closed Suor closed 9 years ago

Suor commented 9 years ago

With both default key binding (which is problematic due super) or other one.

skuroda commented 9 years ago

If the default key binding isn't working (window + alt + n), are there any errors in the ST log? If there are not any errors, it's possible another plugin is also using the same key binding. You can enter sublime.log_commands(True) in the ST console, followed by the key binding to see what is being executed.

You may also try manually running the command from the ST console by entering window.run_command("advanced_new_file_new"). This would verify that the plugin is loaded properly.

Please let me know the results of the above action as it will help in narrowing down the issue.

Suor commented 9 years ago

window + alt + n causes unity bar to appear, nothing happens in sublime, nothing logged even with sublime.log_commands(True). This is expected as unity doesn't allow rebinding anything with super in it.

I added this to my user keybindings:

    { "keys": ["ctrl+alt+n"], "command": "advanced_new_file_new"},

But when I press ctrl+alt+n nothing happens, no error in sublime console.

This is console log with logging turned on:

>>> sublime.log_commands(True)
command: drag_select {"event": {"button": 1, "x": 707.5, "y": 580.5}}
command: advanced_new_file_new # I pressed ctrl+alt+n here
command: advanced_new_file_new # and here
command: drag_select {"event": {"button": 1, "x": 551.5, "y": 1012.5}}
command: paste
>>> window.run_command("advanced_new_file_new")

After last call nothing happened and nothing was printed to console.

I am on Ubuntu 14.10, Sublime Text 3 Build 3065.

skuroda commented 9 years ago

Hmm interesting, how did you install the plugin? It's possible something went wrong during the install process.

When you start ST, you should see something similar to the following in the ST console. reloading plugin AdvancedNewFile.AdvancedNewFile. It should be in the list of all the plugins being loaded. Do you see such an entry? If not, it's possible that AdvancedNewFile did not get installed, or was installed improperly. You may also see error messages following the command. If you do, please post those.

If you use Package Control to install the plugin, you can also look for the "Package Control: List Packages" command to see what is installed on your system.

Suor commented 9 years ago

Hmm, during startup Sublime Text 3 says:

ignored packages updated to: [..., AdvancedNewFile, ...]

So, it ended up ignored. I probably disabled it by accident, since I can't remember doing it. Many thanks for walking me through this and sorry for filing this issue.

For anyone, who googled this:

  1. Hit Ctrl+Shift+P.
  2. Type "enable" and choose "Package Control: Enable Package".
  3. Select "AdvancedNewFile".
skuroda commented 9 years ago

Interesting, it's possible package control did something in the background and hit some sort of error. Anyways, glad the issue is resolved. Thanks for using AdvancedNewFile.

froy001 commented 9 years ago

I got this figured out (I think). The issue is that for some reason 'super+alt' is misinterpreted by ubuntu. What I did was change 'super' to 'ctrl' in Preferences -> Package Settings -> AdvancedFileNew-> key binding -user :

[ { "keys": ["ctrl+alt+n"], "command": "advanced_new_file_new"}, { "keys": ["shift+ctrl+alt+n"], "command": "advanced_new_file_new", "args": {"is_python": true}}, { "keys": ["tab"], "command": "insert", "args": {"characters": "\t"}, "context": [{ "key": "setting.anf_panel" }] } ]

Suor commented 9 years ago

You can't use Super as part of user-defined key bindings in Ubuntu, it's use is reserved for system.

froy001 commented 9 years ago

@sour when one installs AdvancedNewFile the default key bindings are: { "keys": ["super+alt+n"], "command": "advanced_new_file_new"} and { "keys": ["shift+super+alt+n"], "command": "advanced_new_file_new", "args": {"is_python": true}}.....

thats why one needs to change it in the user defined key nindings