• Please Read This Before Posting

    Pinned Locked
    1
    7 Votes
    1 Posts
    6k Views
    No one has replied
  • v8.7 Search Results Missing

    Pinned
    15
    0 Votes
    15 Posts
    3k Views
    xomxX

    This v8.6.9-v8.7.2 issue has been fixed (GitHub commit).
    The fix will be included in the next Notepad++ version (probably v8.7.3).

    @PeterJones
    I would leave this topic pinned for a while longer until the fix reaches most N++ users.

  • HELP: Having trouble with Macros in v8.5.3 or later

    Pinned
    28
    2 Votes
    28 Posts
    14k Views
    Mike NewmanM

    Moderator Note: The contents of this post were moved to a separate topic, Macro works normally, but fails when shortcut is Ctrl+Shift+C, because it’s actually separate from the >=v8.5.3 issue for this Topic.

  • Help with Regex/Find/Macro

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Why does Autosave plugin keep disabling autosave at timed intervals?

    5
    0 Votes
    5 Posts
    109 Views
    Mr-BrunesM

    @PeterJones that’s great. I wonder if it’s a Win11 ‘feature’ that prevents the graceful app close/shutdown.
    Either way I know now what the smoking gun looks like so will be mindful of that in future.
    Tx for the analysis and for filing the plugin issue.

  • Privacy policy of Notepad++

    2
    0 Votes
    2 Posts
    64 Views
    PeterJonesP

    @Jarkko-Rantavuori ,

    I’m curious what personal information the app has about you – or rather, what you think it has collected. Because as far as I can tell, it doesn’t collect any information; and it definitely doesn’t “phone home” with any such information. And if an application transmits no such information to a central location, nor even collects such information, what does it need a privacy policy for? Do you expect it to say, “we collect no information about you, so there’s nothing for us to keep private”?

  • Locking file from other editing while opened in Notepad++

    10
    0 Votes
    10 Posts
    8k Views
    Serpens66S

    @xomx thank you very much :) hopefully the plugin gets updated some day, the auto-check is quite useful…

  • [FORK] How to get Alt-0### codes to work for newlines and similar

    14
    0 Votes
    14 Posts
    120 Views
    PeterJonesP

    @guy038 ,

    I think you missed my point.

    My point was not, “you can enter C0 using Ctrl+<key>, so there’s no need/benefit to be able to also enter C0 using Alt+0###”. My point is, all you have to do to be able to get Alt+0### access for C0 codes is to turn off the option named “prevent control character (C0 code) typing into document”: if you have things set up in a way that you want to be able to enter control codes, then you are the kind of user who probably doesn’t need the accidental-Ctrl+combo “protection” that enabling that option provides.

    Making the developers try to intercept the keystrokes before Windows turns the keystrokes from multiple presses into sending a single character to the app, just because you aren’t willing to turn off the anti-C0-“protection” seems the wrong way around. N++ already provides the option that allows you to enable typing C0 codes, whether by Ctrl+<unmapped> or by Alt+0### for C0 codes, so if you want to enter C0 codes, then set the option appropriately.

    solution cannot be applied because :

    Or, I would say, the “solution cannot be applied without unmapping pre-defined shortcuts, which is simple to do using Shortcut mapper”. (Or, I would say that, if that were a “solution” I were recommending; but it wasn’t.)

    Enabling vs disabling of features always come with tradeoffs, and power users of Notepad++ make those tradeoffs every day.

    Maybe I’ll put it this way: the option is literally named “prevent control character (C0 code) typing into document”. If you want to be able to type control characters (C0 codes) into the document, you obviously have to turn off that option. This seems highly reasonable to me.

  • Adding a Language to official Notepad++

    2
    0 Votes
    2 Posts
    42 Views
    PeterJonesP

    @Dawg1104 said in Adding a Language to official Notepad++:

    Is it at all possible to add a language to Notepad++ officially?

    At all? Definitely.

    Practically? It depends on the language.

    Notepad++ uses a library called Lexilla for handling the syntax highlighting of “official” languages. Lexilla actually provides some languages that Notepad++ has not yet exposed to its users. I have actually done a couple PR where I submitted the Notepad++ code update to enable those “hidden languages”.

    But if it doesn’t already exist in Lexilla, then someone would have to write the lexer per Lexilla standards, then submit it to Lexilla. One, in theory, could just submit a request that Lexilla add the language, but unless it happens to be a language that one of the Lexilla team is interested in, there’s very little chance they will implement it – for example, awk was requested to be added to Lexilla in 2009, but since the developer isn’t interested in it, it’s never been implemented. So practically, to add a new language to Lexilla, you have to write it.

    Those are the two paths to being “officially” added. But there are more paths to unofficial:

    There might already be a UDL (User Defined Language) available in the UDL Collection, If so, anyone can easily download the UDL definition from there and install it into their copy of Notepad++ per the UDL Collection instructions or, if you already have a UDL defined, but there isn’t one for that language in the Collection, you can submit it to the collection as described in the Collection instructions if it’s a simple list of keywords and operators and maybe a folding symbol (like the { ... } of C-style languages), it’s pretty easy to make your own UDL (and then submit it to the collection) my CollectionInterface plugin makes it really easy to download and install a language from the UDL Collection. wink wink nudge nudge If the logic is more complicated than simple keyword matching, then it’s possible to write a lexer plugin (overview found in the User Manual) – and such a plugin can be submitted to the Plugins Admin. (One of the most famous lexer plugins is the GEDCOM lexer, but there are actually quite a few of the plugins that have lexing capability among their features.)

    So, what language are you looking for, that you cannot yet find?

  • Search & Replace

    3
    0 Votes
    3 Posts
    41 Views
    guy038G

    Hello, @Jose-Ramalho, @peterjones and All,

    @jose-ramalho, let’s suppose this INPUT text :

    move $a swap $b, $c

    Then :

    Open the Replace dialog ( Ctrl + H )

    Uncheck all box options

    FIND (?-s)^(.+)\t(.+)

    REPLACE \1 FIXED_TEXT \(\2\)

    Select the Regular expression search mode

    Possibly, check the Wrap around option

    Click on the Replace All button

    => You should get the following OUTPUT text :

    move FIXED_TEXT ($a) swap FIXED_TEXT ($b, $c)

    This is just my first idea. Obviously, this requires some ajustements. See you later !

    Best regards,

    guy038

  • Strange Notepad++ file recovery

    5
    0 Votes
    5 Posts
    122 Views
    xomxX

    @Notepadder said in Strange Notepad++ file recovery:

    How can I access the files in this folder from a more recent restore point as with first crash?

    If there is also a more recent Windows OS Restore Point but you selected an older one somehow (with older N++ backup folder state) during your effort to revive your PC, you can try to extract newer N++ files by ShadowExplorer.

  • NPPCrypt not fully decrypting text.

    2
    0 Votes
    2 Posts
    84 Views
    xomxX

    @Michkovy said in NPPCrypt not fully decrypting text.:

    The file is stored in my dropbox, so it syncs to their cloud storage. Not sure if that is relevant.

    Could be. Seems to me that your file was simply out of sync somehow (common when the network is laggy or there was just a temp outage):

    Plus the newest line isn’t what I typed before the encryption.

  • Advice for Backup settings with AutoSave installed

    2
    0 Votes
    2 Posts
    72 Views
    PeterJonesP

    @Mark-D-Worthen-PsyD said in Advice for Backup settings with AutoSave installed:

    Today I searched for a file and found only a .bak file, which I cannot open, probably because it doesn’t have anything in it (?). It is not in %AppData%\Notepad++\backup\ .

    Right. Because the %AppData%\Notepad++\backup\ is used for the session snapshot files, which don’t use the .bak extension; the .bak extension is only used for the backup-on-save options. The backup-on-save go in the same directory as the file (or in a subdirectory relative to the file, depending on settings). This is described in both the FAQ and the User Manual.

    The most recent file in %AppData%\Notepad++\backup\ is from May (three months ago)

    That’s because that folder is only for the file tracking unsaved changes in the snapshot/periodic mode. As the FAQ descrbes, the instant you hit SAVE on a file, the snapshot/periodic file is deleted from the backup\ folder. This is described in the Built-in “Enable Session Snapshot and Periodic Backup” Feature of the FAQ, with more details for the particulars in Named Files and Unnamed Files sections just below it.

    If you’ve got a file from May still in that directory, then either

    you’ve had snapshot/periodic enabled that whole time, and you’ve had a file with unsaved changes that’s never been saved in the past 3 months (unlikely), or (more likely), in May, you had snapshot/periodic enabled, and had unsaved changes in one file; then you turned off snapshot/periodic (which means that Notepad++ stops its auto-save to the backup folder, but doesn’t actually delete any active snapshots currently stored) or you reset the session or there was a crash/unexpected-reboot, which left Notepad++ not noticing that it hadn’t closed that file

    What do you recommend

    It really depends on your needs.

    thinking I should deselect everything

    I leave ☑ Remember current session for next launch checkmarked, because that allows Notepad++ to remember which files were open last time – it doesn’t do the “unsaved files” tracking, but I don’t need that; but I like Notepad++ always opening whatever files I happened to last be editing.

    So I usually use AutoSave plugin with every 10 minutes (plus often one or both of lose-focus and/or change-tabs), set for All Open Files. In the builtin backup preferences, I remember the session, but don’t do the snapshot/periodic or the backup-on-save.

  • DSpellCheck not underlining misspelled words

    9
    0 Votes
    9 Posts
    107 Views
    Wally WilsonW

    @PeterJones

    Hi Everyone,

    I decided to drop back and punt. I cannot get hung up on this. I have other problems, and too much to do.

    I uninstalled the latest version, then downloaded the previous version (8.8.2), installed it, and installed DSpellCheck again. It is working. The underlining is not as prominent as I would like (even after adjusting the size to max), but it will have to do.

    I want to thank everyone who replied. Unfortunately, I do not have enough points to upvote anyone — sorry.

  • When network goes away - 2 pop-ups.

    4
    0 Votes
    4 Posts
    54 Views
    PeterJonesP

    I thought someone had suggested combining it to a single dialog, but there was some deep technical reason it was infeasible

    I looked through old issues (opened and closed): the closest I could find was the Isse#12079, where the loading of the current session would prompt N times if there were N network files missing. There was quite a lot of back-and-forth (hundreds of comments), but eventually, they were able to make it work, and get a YesToAll/NoToAll message added to the dialog when multiple files from the session were not available.

    Since it was feasible in that situation, I am hoping it’s also feasible here. Thus, I created Issue #16908 to see if the “Keep non existing file” dialog (when the network goes down) and the “Reload” dialog (when the network comes back) can add the YesToAll/NoToAll buttons. I don’t know whether it’s really feasible, or if it will ever be implemented, but the request has at least been made. Those who want this feature can go to that issue and upvote and/or watch for whether or not it gets implemented.

  • Sorting text with numbers

    4
    0 Votes
    4 Posts
    113 Views
    guy038G

    Hello, @michael-gomez, @coises, @thomas-knoefel and All,

    As @coises said, you could achieve your goal with the buit-in regular expression engine of Notpead++ !

    So, from your INPUT text :

    Warsongs rolls 206 Tykee rolls 206 Shadowhunter rolls 798 Ravencauthon rolls 229 Omgwtflolroflgg rolls 479 Nephlite rolls 576 Groverton rolls 943 Blodhgram rolls 829 Azria rolls 675 Antonioklaus rolls 720

    Using the following regex S/R :

    FIND (?-s)^.+?(\d+)

    REPLACE \1 $0!

    => You should get this temporary text :

    206 Warsongs rolls 206! 206 Tykee rolls 206! 798 Shadowhunter rolls 798! 229 Ravencauthon rolls 229! 479 Omgwtflolroflgg rolls 479! 576 Nephlite rolls 576! 943 Groverton rolls 943! 829 Blodhgram rolls 829! 675 Azria rolls 675! 720 Antonioklaus rolls 720!

    Then using the menu command :

    Edit > Line operations > Sort Lines Lexicographically Descending ( Should be better sorted than using the Sort Lines As Integers Descending ! )

    You would be left with that temporary text :

    943 Groverton rolls 943! 829 Blodhgram rolls 829! 798 Shadowhunter rolls 798! 720 Antonioklaus rolls 720! 675 Azria rolls 675! 576 Nephlite rolls 576! 479 Omgwtflolroflgg rolls 479! 229 Ravencauthon rolls 229! 206 Warsongs rolls 206! 206 Tykee rolls 206!

    And, finally, with the last regex S/R, below :

    FIND ^\d+\x20

    REPLACE Leave EMPTY

    Here is you expected OUTPUT text :

    Groverton rolls 943! Blodhgram rolls 829! Shadowhunter rolls 798! Antonioklaus rolls 720! Azria rolls 675! Nephlite rolls 576! Omgwtflolroflgg rolls 479! Ravencauthon rolls 229! Warsongs rolls 206! Tykee rolls 206!

    But, indeed, as @coises mentionned it, the two records with the same integer part 206 are inverted !

    Best Regards,

    guy038

  • Missing New Notepad++ Icon in v8.83

    6
    0 Votes
    6 Posts
    121 Views
    Daniel N 0D

    Thank you both!

  • 0 Votes
    2 Posts
    67 Views
    PeterJonesP

    @yeger-eren ,

    My answer is not “AI” specific.

    Maybe syntax highlighting tweaks,

    Notepad++ syntax highlighting is already pretty good; I’m not sure there is anything that needs to be “tweaked” in that regard when looking at code that you don’t create.

    auto-format tools,

    Notepad++ does not have built-in per-language code cleanup (“auto-format”, indentation fix, etc), because very few languages have One Right Way to format – and those that think they do actually have multiple factions who do things slightly differently, anyway. Notepad++ would never be able to get enough options to make everyone happy for all 90+ of the built-in programming languages that it has syntax highlighting for, let alone the uncountable number of possible UDLs that might exist.

    That said, there are plenty of language-specific plugins for Notepad++: if you’re generating XML, then XML Tools will help you format it; if you’re working with JSON, then JsonTools or JSON Viewer would be helpful; etc. And generically, @Michael-Vincent shares an example script for the NppExec plugin that is able to run an external “pretty print” utility for multiple languages depending on file extension in this post: his script does it for C, HTML, Perl, and Python, but it shows the pattern, so if you were getting code for another language, you could definitely call any external “pretty print” for whatever language you are using.

    Also, @Ekopalypse has the NppLspClient plugin, which will allow you to connect to an LSP Server for your language – and the tips page shows examples of how to configure it for various languages. Some LSP servers will respond to the Plugins > NppLspClient > Format Document or Format Selected Text commands by formatting according to the server’s settings – but not all do.

    regex replacements, or clever macros that make the process smoother?

    Every regex (or regex/editing macro) is specific to a very limited transformation; coming up with a generic one for something as indefinite as “fixes AI-generated code” is impossible. About the closest we come is our FAQ: Generic regex formulas, which lists a few different template regex, that you can use as a starting space for doing common tasks that we’ve seen requested year after year – though none of them are specific to “AI code craziness”.

  • Opening Files

    3
    0 Votes
    3 Posts
    135 Views
    Alan KilbornA

    Here’s my script entry, which does exactly this:

    open additional ffiles to the left of the files that are already open?

    I call the script MoveJustOpenedTabToExtremeLeft.py and instructions for use appear in the comments in the source code.

    # -*- coding: utf-8 -*- from __future__ import print_function # Python2 vestige! ######################################### # # MoveJustOpenedTabToExtremeLeft (MJOTTEL) # ######################################### # note: # This script was developed and tested under Python3 64-bit on unicode (non-ANSI) encoded data. # It may work as-is using Python2 and/or ANSI-encoded data and/or 32-bits, but that would be incidental. # references: # https://community.notepad-plus-plus.org/topic/27054/opening-files # for newbie info on PythonScripts, see https://community.notepad-plus-plus.org/topic/23039/faq-desk-how-to-install-and-run-a-script-in-pythonscript #------------------------------------------------------------------------------- # ensure this file is not executed directly: assert __name__ != '__main__', 'Cannot run this script directly; for testing, could execute this at console >>> prompt: from MoveJustOpenedTabToExtremeLeft import MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT' # to execute, use this in (e.g.) user startup.py: # from MoveJustOpenedTabToExtremeLeft import MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT # another execution option would be to copy and then paste that line into the PythonScript console >>> box # note: if running via startup.py, need to make sure that "Initialisation" for "Python Script Configuration" is set to "ATSTARTUP" and not "LAZY". #------------------------------------------------------------------------------- from Npp import * import threading #------------------------------------------------------------------------------- class MJOTTEL(object): def __init__(self): notepad.callback(self.fileopened_callback, [NOTIFICATION.FILEOPENED]) def fileopened_callback(self, args): #print('FILEOPENED:', args) IDM_VIEW_GOTO_START = 10005 threading.Timer(0.05, lambda : notepad.menuCommand(IDM_VIEW_GOTO_START)).start() #------------------------------------------------------------------------------- MOVE_JUST_OPENED_TAB_TO_EXTREME_LEFT = MJOTTEL()

    Notes:

    the script is rather simple-minded: it works for the simple case of opening 1 file at a time. If you attempt to open 2+ at the same time (e.g. drag and drop 2+ files from Explorer into Notepad++, use File > Open and specify 2+ files, etc.), the script causes only 1 of the files to move. If this is a big limitation for functionality, I could look into how to successfully achieve it.

    the threading stuff seems like it wouldn’t be necessary, but it is. Probably what happens (I didn’t verify) is that the file-opened notification message comes before Notepad++ is entirely done with everything it does to open a file. Delaying (via the threading call) moving the tab allows control to return to Notepad++ to let it finish doing its thing, before the script moves the tab.

  • 0 Votes
    3 Posts
    85 Views
    Terry RT

    @Tall-Navy-Guy said in Backup Files for New, Unsaved Tabs Are Deleted When Tab Is Closed — Bug?:

    Actual Result
    The backup created for the unsaved tab is immediately deleted when the tab is closed — there is no way to recover the text.

    Why This Matters
    Users (myself included) rely on the periodic-backup feature as a safety net for unsaved work. Accidentally closing an unsaved tab—or closing all tabs—should not silently discard those backups; other editors retain them until the user explicitly deletes the file or disables backups.

    You really need to understand what the backup is designed to do. There is a FAQ section and in there is this post which explains in detail what it does.

    You say you rely on this process “as a safety net” yet what you really seem to say is that this will be the “one and only” copy of the data you create. I am actually concerned to learn that you are relying on some process which clearly you misunderstand for saving what seems to be critical data.

    I believe you should get a message when closing the new 1 tab (not the whole application) asking if you want to keep it (see image in @Lycan-Thrope post), so in reality the application does NOT silently discard the backup, it asks you, it seems you confirm you don’t want the data since you are asking this question. The only “silent” process will be if you close Notepad++ without first closing any tabs. When you start Notepad++ later, all tabs should remain with their content intact.

    For your idea to work you would continue to rack up endless “backup” files, all with the same starting name new 1... and have very little idea which file contains which data you want.

    If you were to search this forum you will find it littered with unhappy users who like you misunderstood the process, relied on it for their only copy, only to find that inevitably the process eventually failed them, often due to external factors outside of Notepad++'s control.

    Please read the FAQ post and I strongly suggest changing the way you use Notepad++.

    Terry