Community
    • Login

    General help to built N++ macros in file "shortcuts.xml"

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 1 Posters 655 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • guy038G Offline
      guy038
      last edited by guy038

      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

      1 Reply Last reply Reply Quote 7
      • guy038G Offline
        guy038
        last edited by

        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 options Constant and Dynamic width, since the v7.9.2 version, breaks down this feature !

        Of course, I know that this should certainly be done with N++ scripts ( Python, Lua or NppExec ). However, does someone have on other idea about this problem ? ( Note that I also tried the Customize Toobar plugin, but the last v5.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

        1 Reply Last reply Reply Quote 1
        • guy038G Offline
          guy038
          last edited by guy038

          Hi, All,

          So, I tried to follow the right way with script plugins and did some tests with, either, the NppExec, Python Script and LuaScript 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 - Python 2.7.18 ), the two commands :

            • notepad.menuCommand(MENUCOMMAND.VIEW_LINENUMBER)

            • notepad.menuCommand(44012)

          do not work, as well

          • On LuaScript console ( v0.12 - Lua 5.3 ), the two commands :

            • npp:MenuCommand(IDM_VIEW_LINENUMBER)

            • npp:MenuCommand(44012)

          do not work, also

          Apparently, adding the options Constant and Dynamic 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 or npp_sendmsg WM_COMMAND 44005 reduce/enlarge the tabs

            • npp_sendmsg WM_COMMAND IDM_FILE_NEW or npp_sendmsg WM_COMMAND 41001 open a new file

          • On Python console :

            • notepad.menuCommand(MENUCOMMAND.VIEW_REDUCETABBAR) or notepad.menuCommand(44005) reduce/enlarge the tabs

            • notepad.menuCommand(MENUCOMMAND.FILE_NEW) or notepad.menuCommand(41001) open a new file

          • On Lua console :

            • npp:MenuCommand(IDM_VIEW_REDUCETABBAR) or npp:MenuCommand(44005) reduce/enlarge the tabs

            • npp:MenuCommand(IDM_FILE_NEW) or npp: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

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors