General help to built N++ macros in file "shortcuts.xml"
-
Hi, All,
Recently, some people asked for help in order :
-
To build macros directly from within the
shortcuts.xml
file -
To verify the contents of previous recorded macros, in the
shortcuts.xml
file -
To get general information regarding the generation of macros in the
shortcuts.xml
file
So, I decided to gather some documentation in an unique file, named
KEY_SCI_CMD_List.txt
, which could help some people !You can download it from https://drive.google.com/file/d/1PLhBKhEzeVJiSa99i_4LyzUGUCFJglHo/view?usp=sharing
To make the most of this file, I recommend that you FIRST rename this file as
KEY_SCI_CMD_List.cpp
( C++ file ) !Read the brief explanations to get the full picture and… enjoy !
Best Regards
guy038
-
-
Hi, All,
BTW, at the end of my
KEY_SCI_CMD_List.txt
file, I said the some messages do not work anymore. I would particularly appreciate if we could show/hide the LINE NUMBER margin easily ! Because, presently, this margin is not per file handled but just globally for all files of a N++ session :-((. Generally, I don’t use the line number margin, but, in some cases, the line number margin is quite useful !Before N++
v7.9.2
, the IDM_VIEW_LINENUMBER message (44012
) worked perfectly, but adding the optionsConstant
andDynamic
width, since thev7.9.2
version, breaks down this feature !Of course, I know that this should certainly be done with N++ scripts (
Python
,Lua
orNppExec
). However, does someone have on other idea about this problem ? ( Note that I also tried theCustomize Toobar
plugin, but the lastv5.3
version does not propose anymore to show/hide margins, whatever they are ! )Hum… I’ve just realized that, speaking about plugins myself, should decide me to use a script plugin for this feature !
BR
guy038
-
Hi, All,
So, I tried to follow the right way with script plugins and did some tests with, either, the
NppExec
,Python Script
andLuaScript
plugins.However, I could not get the
Line Number
margin to toogle from visible to invisible status and vice-versa !For instance :
-
On NppExec console (
v0.84
), the two commands :-
npp_sendmsg WM_COMMAND IDM_VIEW_LINENUMBER
-
npp_sendmsg WM_COMMAND 44012
-
do not work
-
On Python console (
v2.0.0.0
- Python2.7.18
), the two commands :-
notepad.menuCommand(MENUCOMMAND.VIEW_LINENUMBER)
-
notepad.menuCommand(44012)
-
do not work, as well
-
On LuaScript console (
v0.12
- Lua5.3
), the two commands :-
npp:MenuCommand(IDM_VIEW_LINENUMBER)
-
npp:MenuCommand(44012)
-
do not work, also
Apparently, adding the options
Constant
andDynamic
width, regarding the Line Number margin, in N++v7.9.2
, breaks down this functionality, since that version :-((I should have realised that before ! If it was impossible to get this fucntionality with a N++ macro, this necessarily meant that NO script plugin could do any better !
To be sure that I correctly used the scripts syntax, I did some tests with two other functions, which worked perfectly :
-
On NppExec console :
-
npp_sendmsg WM_COMMAND IDM_VIEW_REDUCETABBAR
ornpp_sendmsg WM_COMMAND 44005
reduce/enlarge the tabs -
npp_sendmsg WM_COMMAND IDM_FILE_NEW
ornpp_sendmsg WM_COMMAND 41001
open a new file
-
-
On Python console :
-
notepad.menuCommand(MENUCOMMAND.VIEW_REDUCETABBAR)
ornotepad.menuCommand(44005)
reduce/enlarge the tabs -
notepad.menuCommand(MENUCOMMAND.FILE_NEW)
ornotepad.menuCommand(41001)
open a new file
-
-
On Lua console :
-
npp:MenuCommand(IDM_VIEW_REDUCETABBAR)
ornpp:MenuCommand(44005)
reduce/enlarge the tabs -
npp:MenuCommand(IDM_FILE_NEW)
ornpp:MenuCommand(41001)
open a new file
-
So, how to be able to show / hide, easily, the
Line Number
margin ?May be, I need the @astrosofista’s skills as he could provide us with an
AutoHotKey
script to achieve this goal ?Best Regards,
guy038
-