• FORUM: Posting Queue

    Pinned
    9
    12 Votes
    9 Posts
    2k Views
    PeterJonesP

    @donho ,

    Makes sense.

    Since deleting posts was tedious for me, I had recently been looking into whether I could use the API that the forum offers to write a script to automate some of the cleanup (like with purging the deleted posts/topics), but that will take some time to develop.

    update: As of Nov 9, the purge automation is working, and it will run once a week. (Along with purging deleted posts/topics, it will also delete user accounts that are more than a year old where the user never posted and never logged in after the first day – nearly half of the 30000 accounts were in this category)

  • Please Read This Before Posting

    Pinned Locked
    1
    5 Votes
    1 Posts
    4k Views
    No one has replied
  • Applying Diff patches?

    4
    0 Votes
    4 Posts
    109 Views
    EkopalypseE

    @pbarney

    Using PS3 and an installed pygit2 library
    you can do something like

    import pygit2 repo = pygit2.Repository(Path(notepad.getCurrentFilename()).parent) diff = pygit2.Diff.parse_diff(editor.getText()) repo.apply(diff)

    This assumes that

    the patch file has been created from a git tool the current file open is the patch file in question the patch file is in the repo directory
  • Quick Question: what Python version for Pythonscript does everyone use?

    3
    1 Votes
    3 Posts
    64 Views
    EkopalypseE

    @pbarney

    I only use the pre-release version, PS3,
    as I only work with utf8 encoding, which I think everyone should do.

  • Npp website spelling error

    7
    3 Votes
    7 Posts
    664 Views
    deleeleeD

    @mkupper said in Npp website spelling error:

    FWIW, this Google search gets zero hits other than this forum thread.

    site:notepad-plus-plus.org "featurs"

    I’m guessing that the misspelling, if it ever existed, was corrected a while back.

    Yes, it was fixed within a few days of me posting 😁👍

  • 8.8.2 - coming soon??

    16
    0 Votes
    16 Posts
    2k Views
    xomxX

    @rdipardo said in 8.8.2 - coming soon??:

    edition in a user-local path

    I already checked such possibility (for N++ installer, not for portable eds) and have the non-admin user-installations on my TODO, but so low spare time… (#15182)

    @rdipardo said in 8.8.2 - coming soon??:

    can still have context menu entries — scoped to HKEY_CURRENT_USER by default

    Very good. I think the NppShell project should take this into account somehow and allow the HKCR registrations when needed/requested. This HKLM default is(?) IMO the reason for a possible regsvr32 zombie process when trying to register the NppShell manually & unelevated (#15182)

    @Coises said in 8.8.2 - coming soon??:

    I don’t think I’ve ever used a package manager.

    But OTOH you also said that for some SW (Firefox) you allow (welcome(?)) the autoupdates. Such package managers do just that - they remove the burden from the user to constantly check and update their software (even for a portable non-admin user-installation), but at the same time they leave them free to enter this process (if they wanna) and therefore it is not completely hopeless like with the locked stores like WindowsStore or GooglePlay. One example - with the WinGet you can go simply back in the app-versions if you need to (as you do with your “Software\Old”), this is of course impossible with e.g. the GooglePlay (damn hell to them for it!).

    SW-updating “world” just changed and not everything is so bad. So e.g. the WinGet (or more user friendly WinGetUI) way is ok for me (I am not using it for N++, I do it old-school as you do, I admit :-) ). Some relevant links:

    https://community.notepad-plus-plus.org/topic/24884/winget-real-autoupdater-finally
    https://github.com/microsoft/winget-pkgs/tree/master/manifests/n/Notepad%2B%2B/Notepad%2B%2B

  • Replace 2nd occurrence in string per line, then nth occurrence Npp v8.8.1

    5
    0 Votes
    5 Posts
    168 Views
    FraF

    @PeterJones thanks a lot for the nuances. Indeed, I first wondered about the difference from the group indexing starting at 1. Then also about the difference from the quantifier ( {n} where n is an integer >= 1 https://www.regular-expressions.info/refquick.html).
    Thanks for the $0 group placeholder mention, I wondered about that too, now I understand what it captures.

    I understand the regex as this:

    Find:

    Put everything that preceeds the occurence of interest into a group (1st group referenced by the placeholder with the starting index at 1 ($1) — though there is a placeholder 0 ($0) which references the whole set/string instead of any subgroup of it)). Exclude the occurence of interest from the that group, but state is a the search delimiter for the regex just outside the group.

    Replace with:

    Capture the group with it’s placeholder (make a copy of it and store it: $1 = foo / ^((?:.?foo){0}.?) for the 1st occurence (N+1) with index 0). Use the 2nd/next occurence as external delimiter reference to stop the regex search at (^((?:.?foo){0}.?)foo). Then append the new value (XOO) to the copied unchanged group.

    I think I see what you mean when considering there must always be a 2nd /next occurence for the regex to work so it can’t be starting at zero? While in the background the engine uses a zero based indexing for the 1st element of the occurences series.
    0 is the 1st element in the indexes series, 1 is the 2nd and so on.
    While for the groups placeholders, 0 isn’t an ordinal reference, it’s an arbitrary reference to the set. The ordinal reference starting at 1 in this case.

    I need to check the doc and do more practice to get over the confusing parts!

    The quantifier also starting at 1 though index 0 is still valid but return no value (or the whole set but with empty values)?

    For example:

    19 empty string matches:

    0.gif

    [A-Z]{0} goo A greAS gir PE

    https://regex101.com/r/dYnJmE/1

    / [A-Z]{0} / gm Match a single character present in the list below [A-Z] {0} matches the previous token exactly zero times (causes token to be ignored) A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive) Global pattern flags g modifier: global. All matches (don't return after first match) m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) 0-0 empty string 1-1 empty string 2-2 empty string 3-3 empty string 4-4 empty string 5-5 empty string 6-6 empty string 7-7 empty string 8-8 empty string 9-9 empty string 10-10 empty string 11-11 empty string 12-12 empty string 13-13 empty string 14-14 empty string 15-15 empty string 16-16 empty string 17-17 empty string 18-18 empty string No match/invalid:

    1.gif

    [A-Z]{} goo A greAS gir PE

    https://regex101.com/r/CtqQ0D/1

    / [A-Z]{} / gm Match a single character present in the list below [A-Z] A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive) {} matches the characters {} literally (case sensitive) Global pattern flags g modifier: global. All matches (don't return after first match) m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) Your regular expression does not match the subject string. 5 matches:

    2.gif

    [A-Z]{1} goo A greAS gir PE

    https://regex101.com/r/MImsNL/1

    / [A-Z]{1} / gm Match a single character present in the list below [A-Z] {1} matches the previous token exactly one time (meaningless quantifier) A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive) Global pattern flags g modifier: global. All matches (don't return after first match) m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) 4-5 A 9-10 A 10-11 S 16-17 P 17-18 E 2 matches:

    3.gif

    [A-Z]{2} goo A greAS gir PE

    https://regex101.com/r/p1WOWQ/1

    / [A-Z]{2} / gm Match a single character present in the list below [A-Z] {2} matches the previous token exactly 2 times A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive) Global pattern flags g modifier: global. All matches (don't return after first match) m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string) 9-11 AS 16-18 PE
  • [suggestion] View > Tab > Move up/down

    3
    0 Votes
    3 Posts
    422 Views
    S

    Thanks for the tip.

  • Find/Replace Window blocking results ...

    11
    1 Votes
    11 Posts
    1k Views
    M

    Replace was where I was having the issue and it brings up some challenges that Find does not - basically, you would need a shortcut for “Ignore and Find Next” and one for “Replace and Find Next” and you’d have to remember those shortcuts.

    @Coises; TBH, now that I’ve learned to resize the screen. I’m okay with it. I think most users have multiple monitors these days and use the find/replace dialog on the second monitor.

    @Coises and @mkupper - I wasn’t aware of the caret button to move the dialog to two lines. I think that and an OPTION to dock the find dialog in the lower-right corner so I don’t have to re-size the screen would be perfect for what I want.

    Again - none of this addresses the context issue - which isn’t a primary concern of mine, but I still think it should be accommodated, if possible.

  • How to Remove "Edit with Notepad++" from the Right-Click Context Menu

    2
    0 Votes
    2 Posts
    252 Views
    PeterJonesP

    @Ling-Ling ,

    When you install Notepad++, it installs the right-click context-menu entry using a “Shell Extension”. The User Manual has an entire page on the Shell Extension, including a secion on how to unregister the Shell Extension so that the “Edit with Notepad++” entry goes away

  • Notepad++ lags when text files are on FTP

    11
    0 Votes
    11 Posts
    585 Views
    mkupperM

    @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

    You may be right. In my understanding, WebDAV is another way of connecting protocol but still is FTP, although different.
    May be I am wrong.

    You are wrong. :-)

    WebDAV is a protocol that is similar to HTTP that web browsers use with web servers. As WebDAV looks like HTTP on the network it works with NAT, firewalls, web proxies, etc. Accessing a WebDAV server is just like accessing a web server. Many web browsers have built-in support for WebDAV.

    That said, if there are bandwidth or latency issues accessing a particular WebDAV server then all applications, including Notepad++ will be impacted.

    WebDAV itself is not slow or laggy.

    If I was stuck with needing to edit files that are on a slow or laggy server then I probably would create script that first copies the file to the local hard drive, runs Notepad++ on the file, and then keeps an eye on both the local and remote copies of the file. If the local copy changes then I push it out to the remote server. If it changes on the remote side then pop-up a warning. A tricky aspect is that Notepad++ allows people to exit Notepad++ and then resume editing. Thus I can’t depend on Notepad++.exe going away as a signal that I no longer need to monitor and synchronize that file but also need to watch Notepad++'s session.xml file.

  • 0 Votes
    17 Posts
    6k Views
    PeterJonesP

    @Marshall-Brooks said in Double Ctrl+F won't bring the find dialog to the front of the primary window.:

    Also - somewhere along the way (8.81 or prior), Alan’s suggestion was implemented:

    v8.3.3 in March 2022, so a few months after Alan’s 2021 post. See https://github.com/notepad-plus-plus/notepad-plus-plus/wiki/Changes#833

  • Copying file itself into clipboard in Notepad++

    23
    0 Votes
    23 Posts
    3k Views
    PeterJonesP

    @Alexander-Anisimov said in Copying file itself into clipboard in Notepad++:

    how can I bind a hotkey something like Ctrl+Shift+C to it?

    That’s explained in the FAQ. Search that page for “shortcut” (step 4 of the instructions) if you didn’t notice it.

  • Pascal multi line string highlight

    2
    0 Votes
    2 Posts
    191 Views
    PeterJonesP

    @Ertan-Küçükoglu said in Pascal multi line string highlight:

    It would be nice to have it visualized as string in Notepad++

    Notepad++ uses a library called “Lexilla” to handle deciding what characters in a document to syntax highlight. When I use their testbed “SciTE” editor, it is showing that it’s treating the line ending with ''' as an “unterminated string”. But it apparently doesn’t know that Delphi recently added multi-line strings with the triple-quote syntax.

    The Lexilla project has ome reported issues about Pascal and Delphi – you can look through those, and see if any mention the multi-line strings. If not, you might want to request that they add it. Once they add it, and Notepad++ updates its Lexilla library, then Notepad++ could add that new styleID to the Style Configurator options for Pascal. But until they add the support, there’s nothing Notepad++ can do about the official lexing of the language.

    However, as a workaround, there is a plugin called “EnhanceAnyLexer”, which allows you to add regex-based foreground colors. Doing multi-line stuff with a regex is risky if there’s a mismatched triple-quote somewhere, but once you install EnhanceAnyLexer, open your Delphi/Pascal file, use Plugins > EnhanceAnyLexer > Enhance current language, which will open up a [pascal] section in the EnhanceAnyLexerConfig.ini. Set it to the following

    [pascal] ; Everything between pairs of triple-ticks is colored cyan 0xCCCC00 = (?s)'''.*?''' ;excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23

    (make sure you use the ; or # to coment out the excluded_styles, otherwise it won’t color properly; you can, of course, pick any 0xBBGGRR values you want to choose your own color, as described in the comments of the INI file.)

    With that INI saved, it will mean that from now on, the EnhanceAnyLexer plugin will color triple-quote multi-line strings in Delphi/Pascal files. like this example:
    5ba5abdd-c30f-4536-b470-290f55647f1a-image.png

    Since some people aren’t clear when I’ve given such instructions: once you save the EnhanceAnyLexerSettings.ini, the EnhanceAnyLexer will always apply that regex-based coloring to Pascal/Delphi files (you don’t have to run Enhance current language every time you want to turn it on; with the plugin installed, and the ini saved, it will be automatic).

  • 1 Votes
    35 Posts
    12k Views
    M

    @Denis-Rionnet said in Notepad++ has a Reload false alarm / bug? "This file has been modified by another program. Do you want to reload it"? even when it hadn't been recently modified at all?!:

    I understand that this behaviour can be disabled via the settings panel (it works: the warning gets muted)).

    How and where? nvm - found it with Google - Settings>Misc>File Status auto-detection.

    I’m having the same issue - for me, typically when I don’t save the file in NPP, lock the computer, and then unlock it and go back to editing.

    Files are stored on a network hard drive (not Cloud storage). File protocol is SMB, if that is what @ekpalypse is asking.

    I don’t think I’ve seen the message in NPP previously, but I’ve just started using it heavily.

    I agree, the feature was handy when it worked.

    For me, nobody else edit’s these files, and the one other program that I might edit them in notifies me if they were changed in NPP, so I’m okay with disabling it, but I’d like to see it fixed.

    Debug info:
    Notepad++ v8.8.1 (64-bit)
    Build time : May 3 2025 - 18:41:09
    Scintilla/Lexilla included : 5.5.6/5.4.4
    Boost Regex included : 1_85
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line : “Z:_Brooks Work\FM ExtendScript\Scripts_2025\OPS_JG_Update_Variables.jsx”
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    Periodic Backup : ON
    Placeholders : OFF
    Scintilla Rendering Mode : SC_TECHNOLOGY_DEFAULT (0)
    Multi-instance Mode : monoInst
    File Status Auto-Detection : cdEnabledNew (for current file/tab only)
    Dark Mode : OFF
    OS Name : Windows 11 Enterprise (64-bit)
    OS Version : 23H2
    OS Build : 22631.5472
    Current ANSI codepage : 1252
    Plugins :
    JSMinNPP (1.1905.1)
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    NPPJSONViewer (1.34)
    XMLTools (3.1.1.13)

  • ANSI escape sequences color rendering

    13
    0 Votes
    13 Posts
    13k Views
    J_SwaJimeJ

    @PeterJones

    Sorry I wasn’t trying to stir up trouble. Either you are correct or I may simply have mangled things by going in the wrong order.

    Here is a pic showing miswritten regex I found via AI, which was what I was trying to correct. I did not find the ErrorList language feature until after writing my initial post.

    Screenshot_20250618_203154_RVNC Viewer.jpg

  • Revert to Windows 10 NotePad

    3
    0 Votes
    3 Posts
    181 Views
    7 COME117

    @PeterJones
    Many thanks!
    Regards,
    RPrinceton

  • How to copy text file from Notepad++

    Locked
    4
    0 Votes
    4 Posts
    194 Views
    PeterJonesP

    @Alexander-Anisimov ,

    Ah, okay, I understand. Notepad++ itself doesn’t have that feature. But as you apparently don’t remember from last October when you asked the same question, there are ways using a script for the the PythonScript plugin. It seemed more than you could understand at the time, but maybe it’s important enough to you to try again.

    If you have questions about the old discussion, you can continue the conversation there, to maintain context. Since this is a duplicate of your previous discussion, it is being locked – so you can reply there, not here.

  • Using Notepad++ for Script Review in Large-Scale Automation

    3
    1 Votes
    3 Posts
    191 Views
    Thomas KnoefelT

    @NebulaPulseX
    MultiReplace covers the complexity you’re dealing with quite well. While it doesn’t support syntax checking, it handles regex, variables, and multiline edits. Bulk replacements work across all open files in Notepad++. Folder-based processing is on the roadmap.

  • 1 Votes
    6 Posts
    550 Views
    PeterJonesP

    @deleelee said in The 'shortcuts.xml' file is NOT re-created if you delete it, on purpose or by mistake !:

    Perhaps I’m misunderstanding your meaning but, if the “exe” directory is the one containing notepad++.exe, the portable version does have shortcuts.xml there.

    You ignored the context of the discussion: the specific question @guy038 asked was,

    Is is normal that a default shortcuts.xml file is NOT created if absent in current folder ( for a portable version )

    Or, phrases a different way: “if you delete the shortcuts.xml and start Notepad++, why doesn’t it re-create it with default shortcuts”

    So, definitionally, if you’ve deleted the shortcuts.xml from the portable directory, there is no shortcuts.xml from which NPP can read the defaults, since NPP doesn’t have a .model for shortcuts.xml and it has no where else to look. (I was contrasting that to the normal installation, where if you delete the App data shortcuts.xml, NPP can recreate it using the shortcuts.xml in the exe directory)