• Macros to find foward the next character

    7
    0 Votes
    7 Posts
    143 Views
    PeterJonesP

    @Ivan-Garnizov said in Macros to find foward the next character:

    the question refers to your source of information,
    Where do you find and most importantly interpret these codes?

    My source of information is the User Manual and the Notepad++ source code, both of which are publically available.

    User Manual: Generic info on macros = https://npp-user-manual.org/docs/macros/ User Manual: Details on the macro syntax in the shortcuts.xml file = https://npp-user-manual.org/docs/config-files/#macros Source Code: Values for the message="###" on the type="0" and type="1" commands = https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.h Each of those command names (with their numbers) listed in Scintila.h is documented by the Scintilla project = https://scintilla.org/ScintillaDoc.html Source Code: Values for the wParam="###" on the type="2" commands = https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/menuCmdID.h The menuCmdID.h was not intended primarily for human-readability, so here is an example cheat sheet for how to read it: If we wanted to look up the Search > Select and Find Next, and already knew it was IDM_SEARCH_SETANDFINDNEXT:#define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48) That says that IDM_SEARCH_SETANDFINDNEXT is defined as the value of IDM_SEARCH + 48. So then you look for IDM_SEARCH:#define IDM_SEARCH (IDM + 3000) So that means that IDM_SEARCH_SETANDFINDNEXT is IDM + 3000 + 48 = IDM + 3048. Looking for the definition of IDM:#define IDM 40000 So that means that IDM_SEARCH_SETANDFINDNEXT is 40000 + 3000 + 48 = 43048 But that required knowing beforehand what the internal IDM_XYZ name for the menu-command was that you wanted was. There are two good ways for finding that: In the menuCmdID.h, it is mostly organized by Notepad++ menu, so it’s not that hard to say “I want the Find (Volatile) Next command from the Search menu”, and then to look in menuCmdID.h for the Search menu entries – they start here at IDM_SEARCH, which isn’t that hard to find (for example, look in the file for SEARCH, which is the name of the menu). Once in the right section, the IDM_<section>_<command_name> is reasonably easy to map to the entries in the default English menu system in Notepad++. But that’s still a bit of effort. I make use of the NppUISpy plugin (installed from Plugins Admin), which allows you to look up what the command ID (and thus wParam="###" value) is for every built-in and currently-installed plugin command is. Once you know the ID, you can use it directly. But you can also look up the IDM_xyz name by looking for the last digit or two, and finding the ones that end in that last digit until the name makes sense for the given menu command. This Forum’s FAQs: Automating Notepad++ = https://community.notepad-plus-plus.org/topic/25400/faq-automating-notepad This has a lot about macros, and how to dig in to find even the right menu command IDs for plugin commands (plugin commands are not recordable, but the FAQ explains how to hack the recorded macro to run plugin commands with certain limitation)

    @deleelee , there is no published reference of which commands aren’t recordable – there are thousands of commands, and it’s hard to piece together the information(*). The general rule is “any command that requires user input (launches a dialog, renames a file, etc) cannot be recorded or played back; any other built-in command that can be accessed through a menu can at least be played back by a macro, though an arbitrary list of them cannot be recorded even though they can be played back; almost any normal ‘editing’ command, like copy/paste/select etc, which are handled by the scintilla component, should be recordable”. As the Automating Notepad++ FAQ explains, there is no list of which commands are specifically recordable vs not. Essentially, my recommendation is to try to record a macro, and then see if there are any commands (like the Search > Select and Find Next) that don’t end up with a corresponding entry in the macro; those are usually the commands that aren’t macro-recordable. ;-)

    (*: when I was writing up the FAQ, I tried to create a list of not-recordable-but-playable based on the source code, but I gave up after a few hours of spinning my wheels on that. It’s not a simple task.)

  • notepad ++ adjust indentation

    8
    0 Votes
    8 Posts
    7k Views
    T

    @PeterJones I just registered an account to say thank you for mentioning what specific version changed the location of this setting. I came to this thread wondering where to change tabs to spaces. I knew there was a setting somewhere, I just couldn’t remember where, and apparently I must have missed that autoupdate for whatever reason (I don’t remember disabling auto updates but nonetheless I was outdated by a few minor versions), so knowing the setting got moved between versions, and particularly what version, was helpful.

  • 2 Votes
    22 Posts
    3k Views
    Alan KilbornA

    @mkupper said:

    I discovered that the Find field is limited to 2046 characters.

    It looks like in the next release of Notepad++ this is going to get bumped up to around 16384 characters. See https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16855 for details.

  • how to resize plugin window

    2
    0 Votes
    2 Posts
    78 Views
    PeterJonesP

    @ccoreymcmillan said in how to resize plugin window:

    . it wont let me resize the window and i am super green

    It is up to each individual plugin author to decide whether a dialog should be resizeable, and if so to include the code to make it resize. If the plugin author didn’t make it resizeable, there is nothing you or Notepad++ can do to change that. Sorry

    i would include a screenshot but don’t see a file upload or anything

    You can just paste the image in your post.

  • 0 Votes
    20 Posts
    33k Views
    C

    Yes, this is annoying but you can put your backup anywhere you want and then create a symbolic link in the hardcoded location that points to your real backup. That is what I did and it works seamlessly. Should be able to update the path but this is a pretty clean workaround.

  • numeri casuali

    4
    0 Votes
    4 Posts
    148 Views
    guy038G

    Hello, @stephano-brovelli and All,

    From wikipedia, for example, here is the list of the 20 most common surnames in England, which will be our INPUT text :

    Surname Percentage Smith 1.26 Jones 0.75 Taylor 0.59 Brown 0.56 Williams 0.39 Wilson 0.39 Johnson 0.37 Davies 0.34 Robinson 0.32 Wright 0.32 Thompson 0.31 Evans 0.30 Walker 0.30 White 0.30 Roberts 0.28 Green 0.28 Hall 0.28 Wood 0.27 Jackson 0.27 Clark 0.26

    So, let’s suppose you want to insert, a column of random numbers between the Surname and Percentage existing columns. Follow this road map :

    First, determine the number of rows of your list : in our example we have 20 rows

    After your list, create 20 consecutive empty lines

    Move back to the beginning of these empty lines

    Open the Column editor ( Alt + C )

    Select the Number to Insert option

    Chose 1 for each option and Zeros or Spaces for leading characters

    Select the DEC format

    Click on the OK button

    => Of course, you’ll get this simple list :

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

    Move back to the beginning of that list of numbers

    Do a normal selection of the lines ( from line 1 to line 20 )

    Use the Edit > Line Operations > Randomize Line Order option

    => You’ll get, for instance, this kind of OUTPUT :

    9 5 20 18 19 3 7 6 17 8 16 2 14 1 4 15 10 12 11 13

    Move to the first number of this new list, at column 1

    Hold down the Alt and Shift

    Do a zero-width column selection of these 20 numbers, with successive hits on the Down arrow

    Click two times on the Right arrow key, to select the complete numbers

    Click on the Ctrl + C shortcut

    Go to the beginning of your present list

    Put the caret/cursor on the 15th column of the first line Smith

    Click on the Ctrl + V shortcut

    => You should get your expected OUTPUT text, below :

    Surname Percentage Smith 9 1.26 Jones 5 0.75 Taylor 20 0.59 Brown 18 0.56 Williams 19 0.39 Wilson 3 0.39 Johnson 7 0.37 Davies 6 0.34 Robinson 17 0.32 Wright 8 0.32 Thompson 16 0.31 Evans 2 0.30 Walker 14 0.30 White 1 0.30 Roberts 4 0.28 Green 15 0.28 Hall 10 0.28 Wood 12 0.27 Jackson 11 0.27 Clark 13 0.26

    Best Regards,

    guy038

    Ciao, @stefano-brovelli e tutti,

    Da wikipedia, ad esempio, ecco la lista dei 20 cognomi più comuni in Inghilterra, che sarà il nostro testo INPUT :

    Cognome Percentuale Smith 1.26 Jones 0.75 Taylor 0.59 Brown 0.56 Williams 0.39 Wilson 0.39 Johnson 0.37 Davies 0.34 Robinson 0.32 Wright 0.32 Thompson 0.31 Evans 0.30 Walker 0.30 White 0.30 Roberts 0.28 Green 0.28 Hall 0.28 Wood 0.27 Jackson 0.27 Clark 0.26

    Supponiamo quindi di voler inserire una colonna di numeri casuali tra le colonne Cognome e Percentuale esistenti. Seguire questa tabella di marcia:

    Per prima cosa, determinare il numero di riga dell’elenco: nel nostro esempio abbiamo 20 righe

    Dopo l’elenco, creare 20 righe consecutive vuote.

    Tornare all’inizio di queste righe vuote.

    Aprire il Column editor ( Alt + C )

    Selezionare l’opzione Numero da inserire.

    Scegliere 1 per ogni opzione e Zeri o Spazi per i **caratteri di testa

    Selezionare il formato DEC

    Fare clic sul pulsante OK

    => Naturalmente, si otterrà questo semplice elenco:

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

    Tornare all’inizio dell’elenco di numeri

    Effettuare una selezione normale delle righe ( dalla riga 1 alla riga 20 )

    Utilizzare l’opzione Modifica > Operazioni di riga > Randomizza ordine righe.

    => Si otterrà, per esempio, questo tipo di OUTPUT :

    9 5 20 18 19 3 7 6 17 8 16 2 14 1 4 15 10 12 11 13

    Passare al primo numero di questo nuovo elenco, alla colonna 1.

    Tenere premuti i tasti Alt e Shift.

    Eseguire una selezione a larghezza zero di colonna di questi 20 numeri, premendo successivamente la freccia Giù.

    Fare clic due volte sul tasto freccia Destra per selezionare i numeri completi.

    Fare clic sulla scorciatoia Ctrl + C

    Andare all’inizio dell’elenco presente

    Posizionare il cursore sulla 15° colonna della prima riga Smith

    Cliccare sulla scorciatoia Ctrl + V

    => Dovreste ottenere il testo aspettato OUTPUT, qui sotto:

    Cognome Percentuale Smith 9 1.26 Jones 5 0.75 Taylor 20 0.59 Brown 18 0.56 Williams 19 0.39 Wilson 3 0.39 Johnson 7 0.37 Davies 6 0.34 Robinson 17 0.32 Wright 8 0.32 Thompson 16 0.31 Evans 2 0.30 Walker 14 0.30 White 1 0.30 Roberts 4 0.28 Green 15 0.28 Hall 10 0.28 Wood 12 0.27 Jackson 11 0.27 Clark 13 0.26

    Cordiali saluti,

    guy038

    Tradotto con DeepL.com (versione gratuita)

  • update notepad++

    12
    0 Votes
    12 Posts
    26k Views
    PeterJonesP

    @lιƒєlιηє-__,

    Just press the question mark (?) button in Notepad++, located near the Windows key,

    The Windows key is a physical thing on the keyboard, the ? menu is a graphical element you can click in the Notepad++ menu bar. How a menu-entry can be “near” a key on your keyboard is completely and totally beyond comprehension.

    If you’re going to bother posting to a topic that had been answered and left dormant years ago, the least you could do is not bring in false information.

    (And the advice to “press the question mark (?) button … and click’Update Notepad++'” had already been given in various forms three years ago. So that added nothing new.)

  • Running a macro on all the open docs ?.

    52
    0 Votes
    52 Posts
    7k Views
    Alan KilbornA

    @Alan-Kilborn said in Running a macro on all the open docs ?.:

    Here’s the PS bug report: …

    The aforementioned bug is fixed in PS release 3.0.23.

  • "Join Lines" with trailing whitespace anomaly, older npp versions

    9
    2 Votes
    9 Posts
    241 Views
    Alan KilbornA

    @Neil-Schipper said in "Join Lines" with trailing whitespace anomaly, older npp versions:

    I couldn’t see a way to edit the commit msg

    Well, the owner of it would be the only one with the power to edit it.

    or even leave a comment

    Not everything is commentable.

    so I invite a keener to fix it as the task is beyond my weight class

    No one would really want to expend the tedious effort required to fix it (make the links go to the right place). It’s an unfortunate copy/paste result. Perhaps in the future more attention will be paid to it and Notepad++ could be used to replace # with “base url to Scintilla bug list site”.

  • Read-Only does not work

    8
    1 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @Alan-Kilborn said:

    Ideally there would be three options:

    clear readonly (as it now functions) make readonly in Notepad++ (as it now functions – only disallows you from editing in the buffer – file system attribute unaffected) set readonly (currently missing! would set the readonly attribute in the file system as well as disallow editing in N++ buffer)

    In Notepad++ 8.8.2 and later are two “new” checkmarkable choices at the bottom of the Edit menu:

    5886cb49-dc35-4684-a952-f1d43fd6906e-image.png

    I use quotes because they aren’t entirely new; they replace old items whose functionality has been reworked a bit to cover all needs.

    The menu text is fairly self-explanatory for the functionality.

    Really, the only new part of it is that the readonly attribute in the file system can now be set as well as cleared.

    One more bit of newness: When the file system’s readonly attribute is set on a file, its tab icon will appear with an F on it, presumably standing for “File System”. (Truly, it would have been better for the menu text to have been “Read-Only Attribute in File System”…)

    Also, there can be a double level of protection: If Read-Only in Notepad++ is set first, then the Read-Only Attribute in Windows is applied, Read-Only in Notepad++ will be greyed but still checkmarked. Later if Read-Only Attribute in Windows is removed, Read-Only in Notepad++ will again be enforced.

    I’m sure all this and more appears in the user manual, I’m just modernizing an old thread here in case someone reading this is confused by the now outdated info above.

  • Add New Line Automatically After Pasting

    2
    0 Votes
    2 Posts
    78 Views
    PeterJonesP

    @Fern99 ,

    A few years back, I shared a macro here that pasted the clipboard and then adds a newline sequence. I think this is what you want.

  • Notepad++ replacing '!='

    6
    1 Votes
    6 Posts
    591 Views
    PeterJonesP

    @Michael-Goessmann-Matos said,

    @PeterJones

    Actually, I configured Notepad++ to update as soon as an update is available so I wonder how this could have happend.

    As I said above,

    or you previously had an older version that got upgraded without changing your setting (if you originally had DirectWrite off, and upgraded to a version that had it on by default, it would not generally overwrite your previously-saved setting).

  • 0 Votes
    11 Posts
    179 Views
    Alan KilbornA

    @PeterJones said:

    The script he was linking to is now in the second post in this topic.

    OK.

    I think the use of “script” for that (OP’s usage, not Peter’s) is a bit confusing.
    It’s just a command-line invoking Notepad++, albeit a rather complex one.
    I understand that it could be called a “shell script”, of course.

  • Legacy Print dialog freeze (Windows)

    8
    0 Votes
    8 Posts
    249 Views
    Alan KilbornA

    @PeterJones said in Legacy Print dialog freeze (Windows):

    In Emacs (and possibly other unixy apps), control key combos are indicated with…

    Nice to know, I guess, but I could’ve lived without that knowledge. :-)

    As Notepad++ is a Windows (only) app, let’s try to stick to its (and Windows’) notations when discussing it: Ctrl+X Current Microsoft notation

  • How does one create a desktop icon for this program please?

    10
    0 Votes
    10 Posts
    362 Views
    mathlete2M

    @Alan-Kilborn said in How does one create a desktop icon for this program please?:

    You should distill that down into something exactly applicable to Notepad++

    Good point.

    The command prompt code below will create a simple shortcut on the Desktop that shows the various command line arguments that NP++ supports in a pop-up before launching NP++ itself. The ICON-based pieces can be omitted if you prefer the standard icon, and PF may need to be adjusted depending on where you actually installed NP++ to.

    set PF=%PROGRAMFILES(x86)% set TARGET='"%PF%\Notepad++\notepad++.exe"' set STARTIN='"%USERPROFILE%\Documents"' set SHORTCUT='"%USERPROFILE%\Desktop\NP++ - help.lnk"' set ICON='"%PF%\Notepad++\updater\updater.ico"' set ARGUMENTS='--help' set PWS=powershell.exe -Command %PWS% "$ws = New-Object -ComObject WScript.Shell; $s = $ws.CreateShortcut(%SHORTCUT%); $S.WorkingDirectory = %STARTIN%; $S.TargetPath = %TARGET%; $S.IconLocation = %ICON%; $S.Arguments = %ARGUMENTS%; $S.Save()"
  • Font size and toolbar too small in Linux

    3
    0 Votes
    3 Posts
    188 Views
    ThosRTannerT

    possible AI spam?

  • help disabling smart quotes

    2
    0 Votes
    2 Posts
    129 Views
    Terry RT

    @Dave-Lang
    I’m not familiar with your problem but your issue did make me recall a previous post here.

    It might have occured as you just updated the version of Notepad++ from a very much older one, or possibly changed to a different font.

    Anyways, read that post and maybe you might find the answer.

    Terry

  • 0 Votes
    2 Posts
    138 Views
  • What makes notepad++ capable of making an html ???

    13
    0 Votes
    13 Posts
    884 Views
    PeterJonesP

    Since this has come up twice in the last couple months, I have cleaned up the instructions and split them off into a dedicated “FAQ: Using the GCC version of Notpead++

  • Keyboard shortcuts from external apps not working

    3
    0 Votes
    3 Posts
    153 Views
    Bernard DaninoB

    @Ekopalypse said in Keyboard shortcuts from external apps not working:

    @Bernard-Danino

    Right, that’s strange.
    I use Deepl, there is also the shortcut ctrl+c+c and as you can see in this screenshot, it works.

    ebeba1d0-a3b9-47fe-b0c6-147b935d1e4d-{68B7D05B-062A-4BBA-BDD0-5EE32126EC71}.png

    Understood. I passed it on to Reverso. Maybe they have an explanation, although the ticket I opened over there didn’t yield anything. Maybe this new info will get them going.
    Thanks