• Replace a specific char with the begining of the line

    3
    0 Votes
    3 Posts
    1k Views
    Axel BlitzA

    @PeterJones said in Replace a specific char with the begining of the line:

    Peter Jones you saved my day !!
    Thank you very much <3

  • Plugin installation don't works

    8
    0 Votes
    8 Posts
    1k Views
    rdipardoR

    New Problem: The plugin “NppXmlTreeview 2” crashes always at startup. Error message: “NppXmlTreeviewPlugin.dll just crashed in runPluginCommand (size_t i:58)”

    Actually an “old” problem

    Indeed, even older than I thought.

    The problem seems to only affect version 2 (“Rome”). 1.5.0.54 (“Berlin”) apparently works fine.

  • Code Folding Plain Text in Dark Mode

    2
    1 Votes
    2 Posts
    383 Views
    PeterJonesP

    @Frank-Wojtczak ,

    UDLs are mostly independent of themes – you define their colors separately from the theme colors. By using “transparent” background instead of fixed background (right click on the color square, or click the “Transparent” checkbox if you’re in a new enough version of Notepad++), you can alleviate some of the problems of it not matching well with the rest of your theme, because it will just inherit the background from your theme. But a foreground color that works well on a light background will not usually work well on a dark background. This is the reason that even the Markdown UDL that distributes with Notepad++ has two versions – one if you’re in Dark mode, and one for default light mode.

    how can you edit a User Defined Language

    Language > User Defined Language > Define My Language, then select your UDL from the User Language dropdown. Then edit the keywords,operators,styles, etc just as you did when you created.

    how can you delete a User Defined Language

    Language > User Defined Language > Define My Language, then select your UDL from the User Language dropdown. Then Remove

    See also: https://npp-user-manual.org/docs/user-defined-language-system/
  • Move NPP to new computer

    6
    1 Votes
    6 Posts
    11k Views
    PeterJonesP

    @Future Readers,

    If you have been reading this topic to find out how to copy settings from one computer to another, this 2023 discussion gives one more caveat to my instructions from Aug 2019:

    If the OLD computer and NEW computer have different usernames, or otherwise use different paths for the %AppData%\Notepad++ directory resolution (maybe it’s on d:\users\abc\AppData\Roaming\Notepad++ on OLD and c:\users\long.name\AppData\Roaming\Notepad++ on NEW), then you might also have to edit the NEW copy of session.xml and possibly other config files, and if they have any paths in those config files that referenced the OLD AppData, you will have to update to the NEW AppData.

    In general, in session.xml and other config files, if there are paths in those files, they are hardcoded to full paths… so if those full paths do not exactly match on both machines, you will have to edit the config files or Notepad++ cannot find the files referenced by those paths.

  • Moving Notepad++ to new computer *Including all the opened tabs"

    4
    0 Votes
    4 Posts
    30k Views
    PeterJonesP

    @PJ-Hankins ,

    Glad you found it.

    The directory path names need to be changed in the source.xml [session.xml] and config.xml files on the target to point to the new directory name for %AppData%

    That is true: since session.xml and other config files use full paths without windows variable expansion, they cannot just store %AppData% and instead store a hardcoded path. With a hardcoded path, then purely copying is not sufficient.

  • Update CLI command

    3
    0 Votes
    3 Posts
    3k Views
    mkupperM

    @Michal-Šunka To add to what @PeterJones posted, you can run gup.exe --help (with two leading – dashes) and it’ll show you the command line options.

    Typically, when someone selects the ? / Update Notepad++ menu option it runs
    "C:\Program Files (x86)\Notepad++\updater\gup.exe" -verbose -v8.55 where the -v8.55 is the current version of Notepad++.

    gup.exe has a web site, https://wingup.org/, but the details of the command line options don’t seem to be explained so you can figure out what works best for your setup.

  • Need to extract specific info from text file

    10
    0 Votes
    10 Posts
    1k Views
    Alan KilbornA

    @Alexander-Verbitsky said in Need to extract specific info from text file:

    My solution transforms text as OP wants. OK, I don’t know, maybe marking text suits his need.

    All OP said was “extract”, not “transform”.

  • Can't find the unsaved tabs after Window 10 automatic update

    2
    0 Votes
    2 Posts
    234 Views
    PeterJonesP

    @Vincent-Pringalle said in Can’t find the unsaved tabs after Window 10 automatic update:

    2 days ago after an unsollicited Windows 10 update, Notepad+ reopened without any tabs. The C:\Users\USER\AppData\Roaming\ does not contain any Notepad++.

    If you only use Portable with doLocalConf.xml in the portable directory, then then it will never create anything in the AppData hierarchy. So looking there most likely won’t help you with your portable version.

    Moreover as I use Notepad++ in Portable mode, the dir …_portable_Notepad++\App\Notepad++\backup\ defined in Settings / Preferences / Backup contains some unsaved tabs but with outdated contents : the tabs modified last week were dated feb 2022…

    Could you show us

    A screenshot of Settings > Preferences > Backup Paste a copy of your ?-menu’s Debug Info let us know where you got your portable Notepad++

    Do you have nppLogNulContentCorruptionIssue.xml in your portable directory? if so, did it create nppLogNulContentCorruptionIssue.log in the portable directory when the crash occurred? If so, its contents might be able to give some insight into the sequence of events that led to your periodic-backup-and-session-snapshot being corrupted.

    In order to proceed with my works, I backuped this backup dir before reusing Notepad++ again.
    Could someone help me retrieving my recent unsaved tabs dated last week ?

    Most likely not: if the files aren’t in the portable backup directory, then somehow Notepad++ was convinced that you had told it that it was okay to delete the unsaved files, and so they haven’t been saved. At that point, as it mentions in our backup FAQ, you might have to resort to file recovery software (we give the example of “Recuva”, but make no guarantees or warranties regarding that separate piece of software), which may or may not be able to see the no-longer-visible files in the portable backup directory. That FAQ has suggestions for how to prevent this loss of data in the future.

  • NPP+ 8.5.4 Now Folder As Workspace undocked and can't re dock it.

    4
    0 Votes
    4 Posts
    237 Views
    Alan KilbornA

    @Dennis-Kathrens said in NPP+ 8.5.4 Now Folder As Workspace undocked and can’t re dock it.:

    Not sure HOW it became undocked. I only noticed it floating on a subsequent app opening.

    Probably a “mouse stutter” that wasn’t harmless. I hate when such a stutter happens to me, but I know of no way to prevent it. Hopefully you know what is meant with this…

    no clues about how close I was to a permissible drop location. I’m thinking the visual feedback could be better.

    There IS visual feedback; probably it could be better (but that’s true of most things in life). IMO the user manual describes this fairly well.

  • XML Tools Plugin: "Pretty Print" not working- is it the file?

    8
    0 Votes
    8 Posts
    2k Views
    pseudocoderP

    I know this is an older thread but I’ve had this a few times and each time it was because the source file is read-only!

    Seems obvious I guess but as there’s no error message it always gets me.

  • Need help please

    7
    0 Votes
    7 Posts
    514 Views
    PeterJonesP

    @Wahlla-Magla said in Need help please:

    @PeterJones
    the reference post had nothing to do With this post, I certainly can’t apply the same regx and they are Two opposite things.

    The same regex – of course not. I never said you could. But it has the same concepts. And I will prove that below.

    I posted this so that someone can help me fix it because I couldn’t find it Someone else.
    I appreciate the work you’re doing and I understand that you’re doing it for free and I’m not here to argue I just need help, I use notepad++ every day And I’m definitely learning.

    You posted this so that we’d do your work for you. And you got it again this time. Lucky you. But if you haven’t figured out the concepts of the previous regex in the more-than-1.5-years since that last post, it’s really hard for us to believe you are really here to learn instead of trying to guilt us into doing your work for you.

    So here is a description of the concepts that Alan’s regex from 2021 should have taught you, and an exaplanation of how the concepts that were presented in your previous question are exactly the same concepts you are still working with here – at the same time, giving you the answer you wanted to this specific problem.

    In the previous post, you had some colon-separated text

    item:email:item:password:item:item:item:item:item:item:item:item:item

    and wanted to do something with text between the colons, but only specific fields.

    In this post, you have colon-separated text

    1111:55555:8383:jjjsyn:ayahj:jsjsja:jjsjjsjjs

    and want to do something with the text between the colons, but only for specific fields.

    In the previous post, the search (?-s)^.+?:(.+?):.+?:(.+?):.+ grabbed the second and fourth fields from your colon-separated text, and ${1}:${2} did the replacement so everything was replaced with just groups#1 and #2 (which were your second and fourth fields) with a colon between

    This time, what you want is to grab the text from the first and second fields, and replace it with the same text, but with no colon between.

    So the concepts involved:

    you want to start at the beginning of a line, so that you know which field you are in at any point in the regex – this was true of both. You do this with the ^ anchor you want to be able to temporarily store the contents of one or more of the fields – this was true of both. As Alan showed you in 2021, you do this by the (.+?) sequence you want to split the fields based on the colon – both last time and this time. Using the : in the regex in the right places does exactly that. you want to replace some or all of the line with the contents of groups you saved – you wanted this before, and you want it this time. The difference is that before, you wanted to replace the whole line with those contents, and this time, you only want to replace part of the line with those contents.

    So to evolve the old regex into the new:

    The groups you care about are the first and second instead of the second and fourth. So that will change the regex from (?-s)^.+?:(.+?):.+?:(.+?):.+ to (?-s)^(.+?):(.+?):.+?:.+?:.+ You don’t want to affect anything after the second colon from the original text. So that will mean you don’t need to continue the match beyond the second colon in the regex, so just trim it down: (?-s)^(.+?):(.+?): – now it just matches the first two fields and the colons that follow them. (I included the second colon to help anchor things) You want to replace that smaller matched section with the contents of the groups, and (since I included the trailing colon) a colon after, but no colon between. So you take the original replacement from the previous discussion, ${1}:${2}, which put a colon between the group#1 and group#2, and instead just want the two groups together with a colon after, like ${1}${2}:

    In the end, you end up with

    FIND = (?-s)^(.+?):(.+?): REPLACE = ${1}${2}:
    with just a couple of quick changes to the previous regular expression

    With initial text

    1111:55555:8383:jjjsyn:ayahj:jsjsja:jjsjjsjjs 6262g:yysh:ysyahj:hjjma:ksksygg:jsjjsj:jsjjsjz

    and doing Replace All with the find/replace I showed above, I get

    111155555:8383:jjjsyn:ayahj:jsjsja:jjsjjsjjs 6262gyysh:ysyahj:hjjma:ksksygg:jsjjsj:jsjjsjz

    That is the text you said you wanted to get.

    Thus, I have shown you that it was exactly the same concepts involved for breaking the line of text into fields, and exactly the same concepts involved for doing the replacement.

    Stop lying to yourself: you can learn this, but you have to put in the effort to do so – and since you couldn’t see that it was the same ideas this time as last time, it shows that you haven’t put in the effort to understand. I’ve given you the blow-by-blow description for the slight changes necessary this time, in the hopes that you will start to see the concepts behind the regex, so that you can continue to customize those same ideas next time.

  • 'linter' plugin issues

    3
    0 Votes
    3 Posts
    513 Views
    ThosRTannerT

    @PeterJones thanks. I eventually took a deep breath and cloned the repo, copied the latest header files and rebuilt. And - it now works…

  • Selecting text after =

    6
    0 Votes
    6 Posts
    1k Views
    drkkk whrrrD

    @Alan-Kilborn Thank you!

  • Function Parameters Hint very Limited for Python

    9
    0 Votes
    9 Posts
    676 Views
    Ahmed AbuharthiehA

    @mpheath
    Sounds good, I will give it a try. Thank you for your help

  • Notepad++ NPPEXEC Unable to Properly Run Pygame Code

    6
    0 Votes
    6 Posts
    704 Views
    Ahmed AbuharthiehA

    @Vitalii-Dovgan
    Cool, I just checked out the link. Looks good!

  • how to clear or change this ?

    6
    0 Votes
    6 Posts
    277 Views
    Sophie CongS

    @PeterJones Thank you for the explanation.

  • How to replace a dash with space within a word and not change after

    7
    0 Votes
    7 Posts
    2k Views
    KingfisherK

    @Kingfisher
    Here is my solution ending up with 2 expressions

    undefined

    ^(\w+)-(\w+).(\w+)>
    $1 $2

    ^(\w+).(\w+)>
    $1$3

    undefined

    And then I bundble them in a macro with a hot key.

    Thanks for your help!

  • java Program

    2
    0 Votes
    2 Posts
    142 Views
    PeterJonesP

    @Amol-Kamble

    Type the code using your fingers on the keyboard.

    This isn’t a “how do I program” forum. This is about Notepad++, the text editor.

  • Violet highlighting ?

    6
    0 Votes
    6 Posts
    1k Views
  • Help duplicate files

    30
    0 Votes
    30 Posts
    3k Views
    wonkawillyW

    @guy038

    You are right: it was my copy-paste mistake. I’m sorry for that. But please notice the original screenshots are actually correct, in fact in my answer are removed the lines 1 and 3 and in fact in screenshots are present the lines 2 and 4 but not 1 and 3:

    b6a294af-5c71-41b9-8937-9bb06677e407-image.png

    Probably I might have screenshotted the right file but copy-pasted from the wrong one of those I was experimenting with. Sorry again.

    So I suppose that both methods work well after all.

    ;30-10000010-9;86;0;0;0;1;230178;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;230133;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770772;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770192;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770902;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770412;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;705;0;0;0;1;177141;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770171;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770546;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;347211;17/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;18/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;19/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;20/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;770192;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;770902;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;770546;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;770412;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;230178;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;230133;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;770711;21/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;22/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;23/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770902;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770412;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770546;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;230178;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770711;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770192;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;230133;24/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;25/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;26/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;27/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;28/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;10;0;0;0;1;170175;29/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;29/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;11175;0;0;0;1;347211;29/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;4066;0;0;0;1;121012;29/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;230133;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;230178;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770192;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770412;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770546;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770711;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;86;0;0;0;1;770902;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;30/05/2023 12:00;1;1;S72.3;1; ;30-10000010-9;9072;0;0;0;1;420302;31/05/2023 12:00;1;1;S72.3;1;