1

I decided to use NppExec to run my Python files from notepad++, however I encountered a problem. I created a simple script with one line:

python -i $(FULL_CURRENT_PATH)

and added the script to the "Menu items" in nppExec advanced options. The script appears in my macros tab and does what I need when I run it. The problem is I am unable to set a keyboard shortcut to this command. The command appears in my shortcut mapper (under plugin commands) and I can set it to

shift+ctrl+p

but the problem is that it simply does not work when I hit the three keys. The key combination is not the problem, as I was able to create a test macro that ran when I hit shift+ctrl+p.

Edit: More updates: the shortcuts.xml in APPDATA does change when I add the shortcut, the line:

<PluginCommand moduleName="NppExec.dll" internalID="20" Ctrl="yes" Alt="no" Shift="yes" Key="80" />

is added. This is exactly my ctrl+shift+p command, it's there, it just does not fire.

Is anyone else experiencing this strange behaviour? Any help will be greatly appretiated.

5xum
  • 5,250
  • 8
  • 36
  • 56
  • Added observation: Upon adding the python script into NppExec's "Menu items" window, the shortcut mapper adds 2 new commands, of which one is the "real" command, but it also adds one "blank" command with no name and no shortcut set to it that I cannot run. I tried setting the shortcut to this command as the same as the shortcut to my python custom command, but that does not work either. – 5xum Nov 07 '13 at 12:52
  • Did you tried to update to latest Notepad++ and NppExec versions? (latest are 6.5 & 0.5 respectively) – psxls Nov 07 '13 at 13:00
  • Yes. My current notepad++ is 6.5, current nppexec is 0.5. I also tried reinstalling nppexec both manually and from notepad++ itself with no success. I tried it with unicode and ansi versions of the plugin. The strange thing is that when I uninstall nppexec, the shortcut dissapears, and then reappears (along with the script) when i reinstall the plugin, is there some location where Notepad++ stores there scripts? I can't find them. – 5xum Nov 07 '13 at 13:25

1 Answers1

1

Ctrl+Shift+P is by default assigned to Playback command. Notepad++ is buggy when it comes to shortcut mapping, can easily create collisions. See for example open bug #3635.

My suggestion is to try to assign it to something else (personal preference is F5) and double check that it's not already assigned!

psxls
  • 6,807
  • 6
  • 30
  • 50
  • 1
    Oh wow, thank you. I suspected that collisions will be the problem and that they are buggy, that's why I made my own macro with the same shortcut. Oh well, we live and learn. Problem resolved. Do you have any idea how to check if a given key combination is already mapped? – 5xum Nov 07 '13 at 14:15