• Mark the column by macro

    2
    0 Votes
    2 Posts
    312 Views
    PeterJonesP

    @Petr-Jaja ,

    Please is there some simper solution than X times repeat message 2306

    Sorry, not that I know of. The macro language is a simplistic language that just sends messages to the scintilla editor components for the active editor window, or sending GUI commands (activate menus, etc) to the Notepad++ GUI. It’s essentially recording keystrokes.

    Where can I find some description or manual for macros syntax in Notepad++?

    The official docs at https://npp-user-manual.org/docs/macros/ have a link to the config-file description for the macros section of shortcuts.xml, and that has a link to the detailed description from Scintilla for all the Scintilla messages.

    If you want to do something more complicated – especially if you want X and Y to be variables – then you will need one of the scripting plugins, which embeds the full features of your favorite programming language (Python, Lua, JavaScript, Perl, …) into the Notepad++ environment, so the programming language has direct access to the scintilla editors and the Notepad++ GUI. That makes loops or variables possible. Each of those refenced plugins has good documentation

  • Run until the end of file only runs once

    10
    0 Votes
    10 Posts
    2k Views
    guy038G

    Hello, @vishwas-bhide and All,

    So your language uses the Unicode DEVANAGARI script, in range U+0900 - U+097F below :

    https://www.unicode.org/charts/PDF/U0900.pdf

    And :

    - The **`॥`** character is *DEVANAGARI DOUBLE DANDA*, with code-point **`\x{0965}`** - The **`०`** character is *DEVANAGARI DIGIT ZERO*, with code-point`\x{0966}`** - The **`१`** character is *DEVANAGARI DIGIT ONE*, with code-point`\x{0967}`** - The **`२`** character is *DEVANAGARI DIGIT TWO*, with code-point`\x{0968}`** - The **`३`** character is *DEVANAGARI DIGIT THREE*, with code-point`\x{0969}`** - The **`४`** character is *DEVANAGARI DIGIT FOUR*, with code-point`\x{096A}`** - The **`५`** character is *DEVANAGARI DIGIT FIVE*, with code-point`\x{096B}`** - The **`६`** character is *DEVANAGARI DIGIT SIX*, with code-point`\x{096C}`** - The **`७`** character is *DEVANAGARI DIGIT SEVEN*, with code-point`\x{096D}`** - The **`८`** character is *DEVANAGARI DIGIT EIGHT*, with code-point`\x{096E}`** - The **`९`** character is *DEVANAGARI DIGIT NINE*, with code-point`\x{096F}`**

    Your initial S/R could be changed as :

    SEARCH ॥\h\d+\h॥\h(?!<br>)    OR    \x{0965}\h\d+\h\x{0965}\h(?!<br>)

    REPLACE $0<br>

    Two advantages :

    No need to capture something in a group as we grab the overall match with the $0 syntax, in replacement

    If the part ॥ digit ॥ is already followed with a space char and the string <br>, it will not add <br> a second time

    So, two cases can be considered :

    A) WITHOUT a macro :

    Open the Replace dialog ( Ctrl + H )

    SEARCH ॥\h\d+\h॥\h(?!<br>)    OR    \x{0965}\h\d+\h\x{0965}\h(?!<br>)

    REPLACE $0<br>

    Tick the Wrap option option

    Select the Regular expression search mode

    Click on the Replace All button, once ( anyway, a second click will not work ! )

    B) WITH a macro :

    Open the Replace dialog ( Ctrl + H )

    SEARCH ॥\h\d+\h॥\h(?!<br>)

    REPLACE $0<br>

    Tick the Wrap option option

    Select the Regular expression search mode

    Run the Macro Start Recording option ( Ctrl + Shift + R )

    Click on the Replace All button

    Close the Replace dialog ( ESC )

    Run the Macro Stop Recording option ( Ctrl + Shift + R )

    Run the Save Current Recorded Macro option

    Save it as, for instance, Addition of <br>

    Choose, preferably a shortcut for further easy process

    Click the OK button

    Close and re-start Notepad++

    Open your concerned file

    Now, whatever the option chosen :

    Macro > Addition of <br>

    Macro > Run a Macro Multiple Times > Addition of <br> > Run 1 times and a click on the Run button

    Macro > Addition of <br> > Run until the end of file and a click on the Run button

    => The <br> string is added to any ॥ digit ॥ string, ONLY once !

    Note that the Wrap around forces the regex engine to process file(s) from the very beginning to the very end !

    If you prefer to modify, directly, your active shortcuts.xml file, add the lines, below, right before the line </Macros>

    <Macro name="Addition of &lt;br&gt;" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="&#x0965;\h\d+\h&#x0965;\h(?!&lt;br&gt;)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="$0&lt;br&gt;" /> <Action type="3" message="1702" wParam="0" lParam="768" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    Best Regards,

    guy038

  • Session lost after Windows 10 update, recovery options?

    10
    0 Votes
    10 Posts
    490 Views
    Alan KilbornA

    @Ekopalypse said in Session lost after Windows 10 update, recovery options?:

    What data loss are you referring to?

    Well, OP said he lost his existing session in favor of some presumably empty one.
    The presumption is that he had a session of a bunch of unsaved, unnamed, temporary files.
    In such a case, which is one that I do not operate under myself, haven’t you lost track of all of your “files”?

    As you said, you might find them in the backup directory…

    Ah, okay, I later see OP said:

    All my open files were saved

    So that’s a good thing.
    But this is probably not how most people that ask such a question as the OP’s original actually work.

  • Not Loading on windows 10 with the 20H2 update

    5
    0 Votes
    5 Posts
    445 Views
    mere-humanM

    I use Notepad++ 7.9.4 (32-bit) on Windows 10 20H2 just fine.

  • How to open dumps generated by N++ while crashing?

    7
    0 Votes
    7 Posts
    3k Views
    Grigore IG

    @Ekopalypse, For the record

    The ‘.dmp’ dumps in “AppData/Local/Crash Dumps” and “Program Files/Notepad++” are real dumps and I can open them only via WinDBG
    The ‘.dump’ dumps in “Temp/N++RECOV” are pseudo-dumps, in fact backups of the last open unsaved files in N++ at crash, and they are in text format in fact so I can recover now easily the lost documents.

  • Unable to launch Notepad++ versions 7.9.3 and 7.9.4

    6
    0 Votes
    6 Posts
    361 Views
    PeterJonesP

    @k-kolev1985 said in Unable to launch Notepad++ versions 7.9.3 and 7.9.4:

    there was no information about a new version of the “Save as admin” plugin. And to clarify - I’ve done that while using the older version of the plugin and version 7.9.2 of Notepad++, which I could launch with no problems.

    That’s working as designed, then. You apparently didn’t know that Notepad++ (Plugins Admin) only updates its list of available plugin versions on each new Notepad++ release – it does not have a “live” list update (it was designed that way to avoid bandwidth and terms-of-service restrictions on file distribution – because Notepad++ is free software, it is relying on free services for distribution, and those have limitations; the bandwidth restriction is what effectively killed the old plugin manager which had “live” plugin-list updates). The way to get the list of new plugins versions available is to update Notepad++ itself to a new version.

  • How to open a file with View->Monitoring active from command line

    2
    0 Votes
    2 Posts
    261 Views
    EkopalypseE

    @David-Moore

    you can assign a shortcut via settings->shortcut mapper…

    df4f0d03-81fb-4b07-aa4d-b0f43afe86df-image.png

  • Problem collapsing and expanding text

    4
    1 Votes
    4 Posts
    2k Views
    Harry-12345H

    Well, here I am again.

    I fiddled arround with this code, and I think I have a slightly better description now:

    The main problem seems to be the inclusion of a *.js-script with code like
    <script src=“any_name.js”></script>
    Textual insertion of the content of such script into an ordinary section
    <script> any javascript </script>
    makes the problem vanish. So we have workarround.

    The bug itself seems to behave like this:
    If a node of type <script>…</script> is shown expanded, no function under this node is given a collapse button.
    If you do any edit to the text of the script some nodes will appear, but only below the point of edit.
    If you collapse and expand the enclosing script node, the icons inside the script are unvisible again.

    Nodes inside the script may be functional or may misbehave: Sometimes they don’t collapse the function, but they close the whole enclosing script-node. I can’t see a rule for that.

    For reference:

    <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="cookie-demo.js"></script> <title>Demo8</title> </head> <body> <script> "use strict"; function dummy1(){ var dummy=0; } function dummy2(){ var dummy=0; } function dummy3(){ var dummy=0; } function explain(){ document.writeln("Using Notepad++ no function of this script can be collapsed immediately after expanding the script-node in line 10.<br/>"); document.writeln("There are no icons to be clicked between line number and the text of the line. <br/><br/>"); document.writeln("Any edit inside this script-node will make collapse icons visible, but only below the point of edit.<br/>"); document.writeln("Collapsing and expanding the enclosing node of this script the will make the nodes disappear again.<br/><br/>"); document.writeln("Note: Collapsing any function inside this script (after making them appear) will not always yield the correct result: <br/>"); document.writeln("Instead of closing the function desired, the enclosing script node may close. <br/>"); document.writeln("I can't find any rule that controls this behavior.<br/><br/>"); document.writeln("There is only one thing I'm resonably sure of:<br/>"); document.writeln("The whole problem diappears if no *.js-script is included. See line 5 of the header.<br/><br/>"); document.writeln("(This seems to be true for Notepad++. <br/>"); document.writeln("And it is at least in part validated for SciTE text editor as well. Thanks to mere-human!) <br/><br/>"); } explain(); function dummy4(){ var dummy=0; } function dummy5(){ var dummy=0; } function dummy6(){ var dummy=0 } </script> </body> </html>

    Happy Coding!

    Regards,
    Harry

  • Question about replacement

    6
    0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @Acme1235 said in Question about replacement:

    So if I understand the code correctly, you captured the (<g) and then started scrolling through characters.

    technically, captured the <g, and characters necessary after that to make the whole match work

    \s denotes a new line.

    \s* denotes 0 or more of any whitespace (space, tab, newline)

    The * makes it look for the id=

    The * was the 0-or-more quantifier for the \s

    the id=" makes it look for id="

    And then the \d denotes a digit.

    Yep.

    Thanks again for the help! You’ve been a lifesaver.

  • Copy data found in one file to another/new file

    3
    1 Votes
    3 Posts
    1k Views
    guy038G

    Hello, @mike-gill,

    Yeah, that’s the right way ! However, Mike, note that, before the v7.9.1 release, where the Copy Marked Text button was added, we were forced to use a regex S/R to achieve the same goal !

    But this way still works nice with last releases ! For instance :

    Copy the contents of your .log file in a new tab

    Open the Replace dialog ( Ctrl + H )

    SEARCH (?s)^.+?(dstip=.+?)(?=\x20)|.+

    REPLACE \1\r\n

    Tick the Wrap around option

    Select the Regular expression search mode

    Click on the Replace All button

    Save these modified contents

    Et voilà !

    Best Regards,

    guy038

  • Change a line..

    12
    0 Votes
    12 Posts
    404 Views
    Carolina Number 1C

    @PeterJones said in Change a line..:

    = ${1}“${2}”;

    This worked like a charm:

    (?-is)^(title = )(.*?); Variation name"
    ${1}${2};"

    I think I can adapt it or tweak it if I need too.

    Thanks @PeterJones @Alan-Kilborn

  • Commandline Parameter -l <vb> or -l vb does not set the Language to VB

    3
    0 Votes
    3 Posts
    294 Views
    Thomas HabermannT

    @Alan-Kilborn
    Thanks for your msg! I can see the selected file correctly but just in “Normal” if I swith the Langage manually it works correctly as it should! Only the command line Parameter had no effect - I tried also -lvb earlier in the 64Bit version
    How ever, using -lvb works correctly now in the 32Bit version
    -SOLVED

  • 1 Votes
    8 Posts
    1k Views
    Alan KilbornA

    @ginger-manson said in How to move numbers at end of line to new position in same line farther to the right I normally tab them over to:

    @guy038 I really liked the look of what you accomplished with your method, but honestly I got lost trying to implement it.

    This can be a problem sometimes with the solutions Guy offers, but hmm, in this case I just followed the steps and it worked exactly right, so I encourage the OP to try it again.

  • Identical strings in column

    26
    0 Votes
    26 Posts
    2k Views
    Petr JajaP

    @PeterJones , @guy038

    I have tested your solutions and both work fine. However, for futher work I will use probably the solution from @guy038 because it is a little bit faster.
    Thank you very very much for your help.

    Tested - NP v.7.9.3 on Win10, Win7

  • Prb multiple words in the sentence

    6
    0 Votes
    6 Posts
    391 Views
    Terry RT

    @Mamoune-Zerhouni-faiz said in Prb multiple words in the sentence:

    Sorry to have exaggerated but please I don’t understand anything about Notepad++ commands
    I just discovered another error ‘double repeated words’ in sentences, such as:

    Well, possibly you need to start learning about regular expressions as we cannot continue to give you the answer every time without you at least trying first. In our FAQ section we have a post on REGEX (regular expressions). Try to learn some of the basics which is the best starting point. If you do try, but fail, show us what you have attempted. You will get more offers of help if you at least try.

    Your latest problem with “double repeated words” was actually more complex than I initially thought hence the time taken to get back to you with a possible solution. Again it is a regular expression so search mode MUST be “regular expression”. Using the Replace function we have:
    Find What:\b(\w+)(?=\W(\w+)\W\1\W\2)(\W)(\w+)\W\1\W\2
    Replace With:\1\3\4

    To give a bit of a description:
    We look for an entire word (\b before the \w+ forces that). At this point we look ahead (?= is a lookahead, this does not actually consume any characters). The lookahead looks for a non word character (\W which can be a space, comma etc) a 2nd word, then another non-word character and the 1st word again followed by a non-word character and the 2nd word. If none of this is true, then the regex fails with the first word and proceeds to the next word, consuming it and repeats the lookahead. Once the lookahead is true then we proceed with actually consuming the 2nd word and the duplicates. In this instance I only look for 1 duplicate as that’s what your example suggests. If more than 1 duplicate exists, then run the regex again until no more duplicates exist.

    Terry

    PS when we ask that examples be entered using the </> button please follow that request. It is important you supply both before and after views of the data in the black boxes so that we know the data can be trusted as correct and not altered by the posting engine. In this case the example you supplied might not have been affected but that’s not always the case.

  • Operators 2 (seperators required) not working?

    2
    0 Votes
    2 Posts
    362 Views
    PeterJonesP

    @David-Abrahams-0 ,

    2236f51b-12c2-4430-b532-870679151c7a-image.png

    It works as expected for me.

    Could you show your UDL (if there isn’t proprietary/private/sensitive information contained in the definition)? (You could even Export… the UDL, and then paste the contents of that exported XML file into your reply)

    Also, it’s always good to post the ? menu’s Debug Info (copy/paste) when asking for help that might end up being version-dependent.

  • How do I merge two or more consecutive lines into one?

    26
    0 Votes
    26 Posts
    25k Views
    glossarG

    @guy038 said in [How do I merge two or more consecutive lines into one?]

    If you prefer, you may send it to me, by e-mail. Here is my temporary e-mail address :

    BR

    guy038

    Just sent it to the above address.

    Thank you!

  • Remove some mistakes !! Need help plz !

    3
    0 Votes
    3 Posts
    188 Views
    El kohen AmalE

    Thank you very much! It works!

    Merci encore :)

  • Where is 'Show vertical edge' setting in 7.9.3

    3
    0 Votes
    3 Posts
    222 Views
    Alex CA

    @Alan-Kilborn thank you, good sir, your belief really helped me!
    Now it’s in Preferences > Margins/Border/Edge > Vertical Edge Settings

  • Add a new name before and after names that start with a capital letter

    12
    0 Votes
    12 Posts
    901 Views
    Alan KilbornA

    @PeterJones said in Add a new name before and after names that start with a capital letter:

    use (?-is) at the beginning

    My rule of thumb is becoming to type that, first thing after calling up the Find window, when I know I’m doing regex.

    I can always modify it later, but it is a good starting point.
    The discussion in this thread about case bears that out.