• Tiny on laptop, huge on external monitor

    2
    0 Votes
    2 Posts
    154 Views
    Alan KilbornA

    @Dale-Bronk

    Yea, I think this was an experimental change in 7.9.3 to see how things would go. I guess the judgement was “not well” because I believe it will change back to work as it used to for people encountering your problem.

    You might want to give the 7.9.4 RC version a try; see the “Announcements” section of this site.

  • Launching .BAT file with paramater

    13
    1 Votes
    13 Posts
    2k Views
    PeterJonesP

    @Alan-Kilborn wrote:

    this tells me your Notepad++ is fairly out of date.

    Not necessarily. As a reminder, the updater does not overwrite existing config files. So it really says that the version currently being used had been updated from an installation that still had those launch-in-browser commands.

    @Salvador-Garcia said in Launching .BAT file with paramater:

    v7.9.1 Win 32 bit
    Update: When I chose to update Notepad++, I get a message indicating that there are no updates. ???

    v7.9.1 is the most recent Notepad++ that has had the auto-update triggered (and came long after the launch-in-browser commands were removed from the Run menu). v7.9.2 and v7.9.3 were never deemed stable enough to push to auto-update; and v7.9.4 is still in Release Candidate (“RC”) mode.

    I changed the short cut keys from Shift F5 to Alt Shift R and it worked.

    I am confused. Was the problem you were having that Shift+F5 wasn’t running your user-defined-command? Or was the problem that the user-defined-command wasn’t running, even when you manually selected it from the menu, it never ran? Or was the problem that it runs the batch file just fine, but doesn’t include the path name? (I thought it was the third option, until you mentioned the Shift+F5 vs Alt+Shift+R.)

    Also, you never showed the results of the experiment that @Alan-Kilborn asked you to try. And you haven’t responded to @Ekopalypse’s request for ?-menu Debug Info.

    I took a fresh v7.9.1 portable (straight from the zipfile, no customizations yet), and replicated Alan’s experiment:

    Exit all instances of Notepad++ Run Notepad++ Run > Run set the program to cmd /K echo $(FULL_CURRENT_PATH) as @Alan-Kilborn suggested click Save… give it the name DebugFullCurrentPath give it the shortcut Shift+F5 click OK => it should be saved now click Cancel to exit the menu, or Run to run the command now that you’ve saved it. I know, Cancel seems counter-intuitive; but since you hit the OK already, it really did save. typing Shift+F5 ran the command and printed the full current path. So does Run > DebugFullCurrentPath Looking at Run > Modify Shortcut / Delete Command will show you whether or not you have a shortcut conflict: if you do, it will highlight the offending entry red. if you have a conflict, that would explain why Shift+F5 didn’t work but Alt+Shift+R did “work”. Exit all instances of Notepad++ Run Notepad++ File > Open: %AppData%\Notepad++\shortcuts.xml (see 🛈 below)<Command name="DebugFullCurrentPath" Ctrl="no" Alt="yes" Shift="no" Key="112">cmd /K echo $(FULL_CURRENT_PATH)</Command> … so that is what I would expect

    My guess is that you originally saved your Launch asm2bin command without the $(FULL_CURRENT_PATH), and that the next time, when you edited the command to be E:\CoCoDev\asm2bin.bat $(FULL_CURRENT_PATH), you forgot to Save… and assign the name. For reference, if you assign the same name, it does not overwrite the existing Run entry: it creates a duplicate – notice this screenshot (taken after reloading Notepad++, so that shortcuts.xml will be updated) shows two DebugFullCurrentPath entries in the menu and in the XML:
    8debd49a-7435-42b5-af5f-368067a40e53-image.png

    In the state you are in now, I would recommend

    Run > Modify Shortcut / Delete Command Click on Launch asm2bin Click Delete button and confirm in the next dialog If you created the test or DebugFullCurrentPath commands that Alan and I recommended for testing, delete those as well. Close this dialog Exit all instances of Notepad++ and restart Run > Run… program = E:\CoCoDev\asm2bin.bat "$(FULL_CURRENT_PATH)" please notice the quote marks – they are really there. The full current path might contain spaces, and your batch file probably expects the path name as a single token, not multiple, so using quotes will make sure that the space is considered part of the filename. Save…, use your Launch asm2bin name, and whatever shortcut you desire OK to save Now you can Cancel to exit dialog without running Check the Run menu to make sure Launch asm2bin has been re-created Check Run > Modify Shortcut / Delete Command to make sure that Launch asm2bin doesn’t have a conflicting shortcut Try running it, both from the Run > Launch asm2bin menu, and using your keyboard shortcut. If all is well, great! Otherwise continue Exit Notepad++ and restart. File > Open: %AppData%\Notepad++\shortcuts.xml, and the Launch asm2bin entry should look more like<Command name="Launch asm2bin" Ctrl="no" Alt="no" Shift="yes" Key="116">E:\CoCoDev\asm2bin.bat "$(FULL_CURRENT_PATH)"</Command>

    Note, the detailed steps that I outlined have always worked for me in Notepad++, no bugs ever shown, for as long as I can remember.

    If it still doesn’t, please show us what’s in your shortcuts.xml, and explain in your own words exactly what you did to get there. If you have a screen-recording app like ScreenToGif you can create an animated gif of the full process, and save/upload to imgur.com or similar, and link it like ![](https://domain/path/file.gif) (make sure you use imgur’s .gif link, not the .gifv or the one with no extension, which will not embed an image; if you’ve done it right, the preview window on the right will show your animation running while you’re editing your post)


    🛈 : Since you haven’t shown us your Debug Info, I am assuming you have a normal installation, where config files go in %AppData%\Notepad++ 🔗. If you have cloud settings enabled, or are using a portable edition, the shortcuts.xml file will be in a different location. But since you quoted from the shortcuts.xml already, I am hoping you know this.

  • I need help

    2
    0 Votes
    2 Posts
    166 Views
    EkopalypseE

    @yasin-koohestani

    Same advice as before.

  • Need help with doing this task.

    2
    0 Votes
    2 Posts
    156 Views
    EkopalypseE

    @yasin-koohestani

    That sounds like homework.
    I suppose you’d better look here, for answers,
    since this forum only discusses Npp-related assignments.

  • Edits multiple files inside multiple zip files

    3
    1 Votes
    3 Posts
    216 Views
    karl cartwrightK

    @Alan-Kilborn Understood,
    Thank you!

  • 64 bit applicationHost.config and 64 bit version of notepad ++

    4
    0 Votes
    4 Posts
    268 Views
    David HubbardD

    Thank you for taking some time to offer these suggestions.

    I certainly thought with the 64 bit version, this wasn’t an issue (I checked it before I posted after reading some into File System Redirector).

    I will absolutely go look at the last-changed dates on all of those.

    I have write permissions, thanks for making it a point.

    We do have a hangfire “monitoring tool” that I fired off earlier today,… and it’s a good thought that perhaps it or IIS re-wrote the file after I saved it in notepad ++.

    Truly Alan and Peter both…

    Thank you~!

    -David

  • 0 Votes
    4 Posts
    399 Views
    Andrew SchultzA

    @Andrew-Schultz well, double posting is generally a bit tacky, but here, I figured what I was doing wrong.

    I had switched to Windows 10 and this may have altered the behavior of start.exe, which I used to spawn notepad for stuff like python files.

    Notepad++ actually does, by default, open symlinks. If I open a .txt file that symlinks to another, it shows the linked-to file.

    With link-from.txt linking to link-to.txt, this opens up the file linked from:

    start "" "c:\program files\notepad++\notepad.exe" "link-from.txt"

    This opens up the file linked to:

    start "c:\program files\notepad++\notepad.exe" "link-from.txt"

    I suppose I can complain about windows batch files a bit if I want, but … this looks like something notepad++ can’t be expected to handle, but I can, pretty easily.

    Hopefully what I found can save someone else a bit of time.

  • Registry comment lines wrapping

    3
    0 Votes
    3 Posts
    320 Views
    dondolarsonD

    No problem, I understand. It is how it is. Thank you for your explanation and fast reply.

  • Notepad++ 7.9.3 silently crashes on startup

    7
    1 Votes
    7 Posts
    392 Views
    greg-michaelG

    @PeterJones Excellent! I’ll give it a go. Thanks again!

  • Restricting search to the end of line

    6
    0 Votes
    6 Posts
    307 Views
    glossarG

    Hi all,
    Thank you for your understanding and offers to help me further. I’ve solved the problem in the meantime - as usual in a poor-man’s way! :D

    Love & Peace,
    glossar

  • Find term and delete the line above

    3
    0 Votes
    3 Posts
    244 Views
    WatashiW

    @PeterJones Sorry about the link, I’ll keep that in mind for the next time!

    Oh, you’re right, {1} is not needed for single line :O

    “Not every hero wears a cape” =D

    0ab48f6a-2eac-4ac0-971c-63035657796c-image.png

    Did work like a charm * – *

    Thank You so much!

  • Can’t open files with 103 char filenames, 259 char paths

    21
    0 Votes
    21 Posts
    2k Views
    M Andre Z EckenrodeM

    @Alan-Kilborn

    Point taken, but they were all successfully opened by the OS’ own Notepad, and most of the files >103 characters were even opened by NPP. Anyway, I’m really not hell-bent on having such long filenames and paths on my computer, but since there was considerable inconsistency, I thought there might be something else at play. Either way, it would be nice if NPP told why it couldn’t open them. Not the end of the world, of course.

    .

  • Regex: Match the first three words from every line

    6
    0 Votes
    6 Posts
    1k Views
    guy038G

    Hi, @vasile-caraus,

    Then, use the following search regex :

    ^\h*\K([\w-]+[^\w\r\n-]+){2}[\w-]+

    And, in case of replacement, click on the Replace All button, only, because of the \K syntax !

    Cheers,

    guy038

  • Language style changes when tab view is dragged out of Notepad++

    4
    1 Votes
    4 Posts
    330 Views
    Alan KilbornA

    @PeterJones said in Language style changes when tab view is dragged out of Notepad++:

    the developers are more likely to implement “normal user” requests rather than requests from “known power users” like me

    Yes, but for this case it appears that OP isn’t interested enough to do so.
    So it could be done by an interested power-user and a link back here ought to show the devs that the request isn’t coming from a known power-user but some other user.

  • Replace tilde (~) with headword

    22
    0 Votes
    22 Posts
    2k Views
    glossarG

    @guy038

    Hi guy!

    Thank you for effort.

    FYI, I’ve applied this last one as well as the second one on another file. Sadly, both didn’t work well, leaving 10K-20K tildes behind.

    Greetings,
    glossar

  • Keep links and discard rest from page sourcecode.

    2
    0 Votes
    2 Posts
    198 Views
    PeterJonesP

    @Ravi-K ,

    Some questions:

    Did you intend for that to be two separate lines (ie, you want to keep both normal URLs and filenames-with-extension) or was that meant to be a single line with the filename immediately after the trailing slash in the URL? for the URL protocol, will they all be https://, or will there also be http://, ftp://, file://, irc://, or other such links? if there really are links that are filename.ext, does it have to be able to recognize any .ext, or just .jpg, or just some small set of extensions (if the last choice, please list them) The search/replace expression can be very different if there is only ever one link per line of text vs potentially needing to recognize multiple links in the same line

    If you follow the advice below and give us some more information (especially “before” and “after” data, with examples of data that will stay and data that will go), it will make it more likely that you will get an answer that meets your needs. But I will start by showing what I would do under one such circumstance

    If I were solving this problem for just https://... links, where they may or may not be more than one link per line, I would probably do it as a multi-step process

    get them onto lines by themselves: open Search > Replace dialog:
    FIND = https://[^\s()<>'"]* – assume that spaces, tabs, newlines, parentheses, angle brackets, and double or single quotes will all end a URL
    REPLACE = \r\n$0\r\n – put CRLF newlines on both sides of the matched link
    SEARCH MODE = regular expression
    REPLACE ALL Get rid of everything but those URLs-on-a-line: Search > Mark dialog (or if it is still open, just go to the Mark tab of the Replace dialog you were already in
    FIND = ^https://[^\s()<>'"]*$
    BOOKMARK LINE = enabled
    MARK ALL
    Search > Bookmark > Remove unmarked lines

    Given the number of open questions about your data, I doubt that will immediately solve your problem. But it would be my first step. I recommend figuring out how all the pieces of my recommendation worked, and trying to tweak them to match your actual data. If you have trouble, follow the advice below, share what you tried and why you thought it would work when you tweaked my regular expressions, and ask specific questions.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

  • How to find identical files saved under different names?

    6
    0 Votes
    6 Posts
    640 Views
  • Regex: Select/Delete html <div> tags between comments

    15
    1 Votes
    15 Posts
    951 Views
    Robin CruiseR

    @guy038 , @PeterJones and @Alan-Kilborn

    Thank you. Now, it was much easy for me to understand the structure of a the new way of using regex.

    I hope that all those who will access this page in the future will take a step forward towards progress in the way of how regex works.

  • Macro Save/Reload/Where Files

    9
    0 Votes
    9 Posts
    9k Views
    PeterJonesP

    @PorAhiViene-Pepe said in Macro Save/Reload/Where Files:

    C:\Users\<localaccount>\AppData\Roaming\Notepad++

    Please note: that assumes a standard Windows setup. One can tell Windows to place that folder in a different location. The environment variable %AppData% 🛈 encodes the right path for the ...\AppData\Roaming folder, so %AppData%\Notepad++, like @Ekopalypse said a couple years ago, and @Bharath-k said a few months back, is going to access the right spot, no matter how Windows is configured, and without having to edit the path: you can just paste %AppData%\Notepad++ into the Windows Explorer or File>Open address bar, and always get to the right place
    9223894d-5e52-4a26-9cfc-a6124b934689-image.png
    03ecf6eb-4916-4844-bca6-3e478656ab43-image.png

  • 1 Votes
    2 Posts
    1k Views
    PeterJonesP

    @PorAhiViene-Pepe ,

    Thanks for sharing that.

    I have a feeling your regex got munged by the forum, because <.?>|</.?> only looks for 0-or-1-character between the angle-brackets; I assume the . were really .*?

    For future reference, in this forum, you can put ` marks around text (like regex) to format it red like my examples and to make sure the forum doesn’t munge the characters. `<.*?>|</.*?>` will render as <.*?>|</.*?> , so that we can see the actual regex as you intended (and that has the benefit of not wondering if the “smart quotes” were part of the regex, or just used to separate the regex from the flow of your text)