Is it possible to map multiple keys to notepad++ functions?
-
Sorry; you’ll have to wait for someone else to reply on NppExec.
While the contributors to this thread are aware of NppExec, we may not know a lot about it because we’re better at PythonScripting (and thus don’t have much of a need for what NppExec offers). -
@Anthony-Blinco said in Is it possible to map multiple keys to notepad++ functions?:
The problem is It always asks me to cancel the current command before it executes the next one
That means you’ve left some process open. Without seeing your NppExec script, we cannot tell you why it might still have the process open.
The compile-and-run FAQ gives some examples of NppExec scripts that compile source code then run the resulting program, but don’t have a problem of leaving a process still running. You might want to compare your scripts to those.
One trick, which is used in those examples, is to give the executable a new cmd window, instead of having it run directly inside the NppExec console – as called by
npp_run cmd.exe /k "$(NAME_PART)"
, which spawns a new external process (npp_run
), starts the command interpreter (cmd.exe
) in a way that will leave it open after its argument finished (/k
), and runs the compiled program in that new process ($(NAME_PART)
) –npp_run
is basically the NppExec-equivalent of the cmd.exeSTART
command. (The same could also probably be accomplished in NppExec withcmd /c START "$(NAME_PART)"
.)You can also search the forum for @Michael-Vincent posts that contain “NppExec”, as he is a power-user of NppExec (or wait for him to show up, as he might have more advice than I have). And @Vitaliy-Dovgan, the author of NppExec, does come here on occasion
-
Perfect! Problem solved. Great advice once again.
Thank you all so much. You guys really know your stuff! -
Sorry for asking all the stupid questions.
I tried the block comment/uncomment but it doesn’t work with my particular compiler.Can i change the comment/uncomment logic for my language (COBOL)?
or
It is a litle nuanced
- I need to save the character at column 7 (which is where the comment indicator is *). because it could be one of a couple of values and i would need to restore it when they uncomment
- I’m thinking i’m going to have to implement it in python. In which case i need to know how i can replace a line in the editing window
Thanks again for all your awesome advice
Also, i couldn’t find the editor.search() function in the python documentation. Am i looking at the right one
http://npppythonscript.sourceforge.net/docs/latest/scintilla.html#helper-methods -
Regarding: “comment…COBOL”: It’s probably best to start a new thread when you want to ask a totally unrelated question to what has come before in the current thread.
Regarding
editor.search()
– which is proper for this thread since we’ve been discussing PythonScript – why not just move your caret to an instance of that in your text and invokeContext-Help
from thePythonScript
menu, right in Notepad++ ?Am i looking at the right one
http://npppythonscript.sourceforge.net/docs/latest/scintilla.html#helper-methods
I’d give that a “no”.
-
@Alan-Kilborn said in Is it possible to map multiple keys to notepad++ functions?:
Regarding
editor.search()
– which is proper for this thread since we’ve been discussing PythonScript – why not just move your caret to an instance of that in your text and invokeContext-Help
from thePythonScript
menu, right in Notepad++ ?Am i looking at the right one
http://npppythonscript.sourceforge.net/docs/latest/scintilla.html#helper-methods
I’d give that a “no”.
Specifically, the old sourceforge copy of the documentation is severely out of date.
When you install PythonScript, it also installs a local up to date version of the PythonScript documentation, which can be accessed through Notepad++ menu Plugins > PythonScript > Context-Help (and, as @Alan-Kilborn mentioned, if your caret is on the
editor.search()
command, it should open the help to the right place). Use that for all documentation needs on PythonScript. But yes, it is in the helper-methods section of the editor object documentation.