• bookmarks line with value numbers

    4
    0 Votes
    4 Posts
    637 Views
    namx3249N

    wow, great solution. wonderful
    it work fine, thank you Peter

    about your second post: i agree, and i’ve try to search around the web some solution, but i didn’t find anything useful, and few have the knowledge as you have
    I hope in the future to increase my notions, in fact i’m following all the threads here!

    all the best

  • Auto-generate unit tests in macro-like way

    8
    0 Votes
    8 Posts
    644 Views
    PeterJonesP

    @rdipardo said in Auto-generate unit tests in macro-like way:

    If you can hack Perl, there’s Win32::Mechanize::NotepadPlusPlus

    Ooh, if someone other than me and @Michael-Vincent acknowledge its existence, I suppose I need to find the time to go update it for all the new messages and updates that have been added since Notepad++ v8.3.3

    If @Mark-Olson cannot hack Perl, the same principles can be applied from other languages: although Don’s reason for the Messages were for Plugin Communication, any process – whether a plugin for Notepad++ or an external process like Perl script or a C executable or even something like AutoHotKey – can SendMessage to any Win32 window… so if you know how to search for Notepad++'s hWnd in your language of choice, and know how to use the SendMessage from win32-API in your language-of-choice, you too can remote-control Notepad++, even without a “plugin”.

    (The next version of the User Manual’s Plugin Communication will actually emphasize that external processes like AHK can SendMessage to Notepad++.)

  • NPP can't handle large files

    11
    0 Votes
    11 Posts
    3k Views
    rdipardoR

    @Coises

    My guess is that the way to implement this would be to set a timer just before making the call, so there would be an interrupt if the process ran too long.

    SendMessageTimeout with the SMTO_NORMAL flag would achieve something like that: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagetimeoutw

    As you point out, however, that would entail picking a fixed, arbitrary number of milliseconds for every single plugin message that Npp would dispatch.

    A more provident implementation would have all plugins running on separate threads, the way Sublime Text plugins have done since version 3.

    I think the OP was really asking for some way to detect the source of a (potentially problematic) message; e.g., if XMLTools wants to check syntax, ask the user for permission first. Of course that’s impossible, and any workaround would penalize every other plugin at the same time.

  • Removing multiple blank lines

    5
    0 Votes
    5 Posts
    259 Views
    Alan KilbornA

    @Gerd-Selter said in Removing multiple blank lines:

    Because I had first posted it in the wrong forum

    Oh. You mean the wrong Category. You thought that your question would be better received in Help Wanted vs. General Discussion.

    It hardly matters; I don’t know for sure but I don’t think people pay much attention to what category a posting is in.

  • Swapping Blocks of Code with Regex

    6
    1 Votes
    6 Posts
    320 Views
    guy038G

    Hello, @dick-adams-0, @alan-kilborn, @peterjones and All,

    Here is my solution, which can be applied in all cases of text swapping ;-))

    First you add a specific character, NOT YET used in your current file, in front of each concerned block of text

    Thus, if I choose the ― character ( Unicode char HORIZONTAL BAR, \x{2015} ), your INPUT text is temporarily changes to :

    ―<link rel="prev" href="../d/myfile.htm"> <link rel="next" href="../../../l/a/n/ilandsas.htm"> <link rel="up" href="../../../../../ttl/ttl-i.htm"> ―<link rel="stylesheet" href="../../../../../css/hymn.css"> ―<script src="../../../../../js/jquery.js"></script> <script src="../../../../../js/base.js"></script> <script src="../../../../../js/myscripts.js"></script> ―

    Then using the regex S/R below :

    SEARCH (?xs) ^ ― ( .+? ) ― ( .+? ) ― ( .+? ) ― \R

    REPLACE \2\3\1

    You’ll get your expected OUTPUT text :

    <link rel="stylesheet" href="../../../../../css/hymn.css"> <script src="../../../../../js/jquery.js"></script> <script src="../../../../../js/base.js"></script> <script src="../../../../../js/myscripts.js"></script> <link rel="prev" href="../d/myfile.htm"> <link rel="next" href="../../../l/a/n/ilandsas.htm"> <link rel="up" href="../../../../../ttl/ttl-i.htm">

    Notes :

    You may choose any kind of character to begin a block of text which is to be moved ! For instance, in my previous example, I could have chosen the BULLET char ( \x{2022} ) as shown below : •<link rel="prev" href="../d/myfile.htm"> <link rel="next" href="../../../l/a/n/ilandsas.htm"> <link rel="up" href="../../../../../ttl/ttl-i.htm"> •<link rel="stylesheet" href="../../../../../css/hymn.css"> •<script src="../../../../../js/jquery.js"></script> <script src="../../../../../js/base.js"></script> <script src="../../../../../js/myscripts.js"></script> • This method allows you to select very large multi-lines blocks of text as well as simple single-line blocks too !

    Here is a general example which deals with 6 blocks of text :

    Group 1 contains 3 lines

    Group 2 contains 3 lines

    Group 3 contains 4 lines

    Group 4 contains 1 line

    Group 5 contains 2 lines

    Group 6 contains 5 lines

    So, let’s begin this text with a ¤ character in front of lines A, D, G , K, L and N

    ¤line A Group 1 Line B Group 1 Line C Group 1 ¤Line D Group 2 Line E Group 2 Line F Group 2 ¤Line G Group 3 Line H Group 3 Line I Group 3 Line J Group 3 ¤Line K Group 4 ¤Line L Group 5 Line M Group 5 ¤Line N Group 6 Line O Group 6 Line P Group 6 Line Q Group 6 Line R Group 6 ¤

    Then, the following regex S/R :

    SEARCH (?xs) ^ ¤ ( .+? ) ¤ ( .+? ) ¤ ( .+? ) ¤ ( .+? ) ¤ ( .+? ) ¤ ( .+? ) ¤ \R

    REPLACE \3\4\6\2\5\1

    would produce this expected OUTPUT text :

    Line G Group 3 Line H Group 3 Line I Group 3 Line J Group 3 Line K Group 4 Line N Group 6 Line O Group 6 Line P Group 6 Line Q Group 6 Line R Group 6 Line D Group 2 Line E Group 2 Line F Group 2 Line L Group 5 Line M Group 5 line A Group 1 Line B Group 1 Line C Group 1

    Notes :

    As you can verify, the resulting order respects the replacement numbering of the groups !

    The single line block ( Group 4 ) was moved upwards

    The two-lines block ( Group 5 ) has not been moved during the process

    As a conclusion, if we don’t use the free-spacing mode ( (?x) ), just TWO rules to remind :

    Between the leading part (?s)^ and the trailing part ¤\R, just add, in the search regex, as many ¤(.+?) syntaxes than the number of blocks concerned by the replacement

    In the replacement regex, just re-organize your blocks, from 1 to n, whatever you want to ! You could even duplicate some blocks using, from the above example, the replacement syntax \3\4\3\6\2\5\2\1\6 ;-))

    Best Regards,

    guy038

  • Autocomplete code, NOT words?

    4
    0 Votes
    4 Posts
    590 Views
    PeterJonesP

    @jabcreations said in Autocomplete code, NOT words?:

    I had to install from scratch after a hardware failure

    That’s not an update, then. It’s a new installation. No wonder your old settings weren’t kept.

    Very simple: while creating a new paragraph (<p>) Notepad++ would immediately append the end tag to the paragraph element to the right of the keyboard caret (</p>).

    Then why did you never mention that previously? That’s a different aspect of the auto-completion feature, called “Auto-Insertion”, controlled by the “html/xml close tag” checkbox on the same page of the Preferences dialog:
    1a094258-e628-4888-962d-df2efc7fff4c-image.png
    As shown in my screenshot, you can also have it auto-insert matching parentheses, brackets, braces, quotes, and single quotes, if you so desire.

    Suggestions please?

    Read the User Manual descriptions of the general Auto-Completion feature, as well as all the various settings which are affected by Settings > Preferences > Auto-Complete. (And note that I linked you to both of those on Tuesday, with the hopes that you would actually read the sections I linked you to.)

    I thought it might be some poor oversight like that someone was too lazy

    You made the desired behavior active in your old installation by changing those settings. At some point, you then apparently forgot that those settings existed (since you didn’t remember how to set them up in your new installation). After your installation from scratch, those settings were not set by default. Instead of trying to look for settings that might affect the behavior of auto-completion, and instead of reading the manual which is linked from the ?-menu in Notepad++, you came to us to (essentially) have us read the manual to you. And then, even after we pointed you to a related setting for a related feature, along with the documentation for all such settings and features, instead of reading the documentation to learn more about those settings and features and the ones related, you come back and ask us to tell you which settings to change. And then you have the temerity to call the developers too lazy to implement things – despite the fact that they have implemented them. So my suggestion to you is to not assume others are lazy when you haven’t finished researching the problem.

  • Merge plugin .Can this be added ?

    2
    0 Votes
    2 Posts
    353 Views
    PeterJonesP

    @Doğancan-yılmazer ,

    Yes, you can install that plugin. You can even use Plugins Admin to do it:

    653f8c8a-5a43-4c92-824c-a508ca369f1e-image.png

    Plugins > Plugins Admin Mark the checkbox “Merge files in one” Click Install button
  • How to get windows explorer right-click menu "Open/Edit with Notepad++"

    6
    0 Votes
    6 Posts
    18k Views
    namx3249N

    more easy: go to np++ folder then make shortcut to exe file
    then trim this shortcut and paste on this folder ...\AppData\Roaming\Microsoft\Windows\SendTo
    so click on your txt file then mouse - right click - send to and choose np++

  • Adding properties for the CSS language

    Locked
    2
    0 Votes
    2 Posts
    238 Views
    PeterJonesP

    @DomOBU ,

    Adding new properties to CSS lexer: while it might be nice to have them in the default (langs.model.xml), you can just use the Style Configurator to add them to your CSS > IDENTIFIER > User-defined keywords, and they will be highlighted for you; this should be able to hold you over while you are waiting to see whether the developers decide to implement your request or not.

    Side note:

    You don’t actually have to notify us fellow users in the Community forum that you create an issue. We in the Community forum are just fellow users, and making a post here won’t somehow make the developers decide to implement your request faster (if at all).

    edit: oh, I see, you were just trying to follow the FAQ instructions to “please come back to the Community Forum and reply to your original post, giving us a link to the issue you found or created” – you didn’t quite make it, because you created a brand-new topic, rather than replying to your original post here. Any follow-up conversation should go there.

  • help about this regex

    6
    0 Votes
    6 Posts
    342 Views
    namx3249N

    oh nice !
    Wrap around solved my issue.
    thank you for the tip, Alan

  • How to copy or extract particular string value from each line ?

    10
    0 Votes
    10 Posts
    1k Views
    PeterJonesP

    @Coises said in How to copy or extract particular string value from each line ?:

    Good observation, since no one said it had to be unchecked

    That’s why Alan and I try to always prefix our regex that use . with (?-s) or (?s) (depending) to make sure that option is in the right state, regardless of the checkbox state.

  • KeyMap Help

    8
    0 Votes
    8 Posts
    525 Views
    Alan KilbornA

    Further info about the oddities of assigning Shift+Backspace may be found HERE.

    Bottom line, it IS possible if you want to do some “hacking”.

  • Uninstalling 8.5.1 throws error

    4
    0 Votes
    4 Posts
    736 Views
    bokkabongaB

    Seems to be fixed as of 8.5.2

  • Suggestion: contrasted scrollbar & bigger pin

    2
    0 Votes
    2 Posts
    341 Views
    PeterJonesP

    @Sim-Won ,

    The right scrollbar size changes with the size of the document: it indicates what fraction of the document is visible in the current view – though it has a smallest size that’s about 1 line of text tall: that seems reasonably big to me.

    83f5b505-c753-4e25-b07d-0554d636a239-image.png

    And when you hover over it, it gets wider, so it’s easier to grab:
    2bbf4787-78fa-477b-8e28-7da40ed2014f-image.png

    Themes (what I assume you meant by “no matter what style I choose”) don’t affect it, because themes are relevant to the editor portion of the application, not the GUI. But Dark Mode vs Light Mode does affect it:
    d762b02d-76a1-4b44-aea8-e50b0c260cc2-image.png

    If you want the ability to change the color of the scrollbar, you would have to follow the FAQ to put in a feature request – we in the Community are fellow users, and cannot change the codebase of the application.


    update: the widening of the scrollbars may be a Win11 feature; if you are on older Win, it may keep constant width

  • 0 Votes
    7 Posts
    1k Views
    lossmark70L

    @guy038 said in best way to stop matching of escaped parentheses/brackets in regular expression.:

    Hello, @mark-olson, @ekopalypse and All,

    There are a solution with recursive regexes ! Here are 3 kinds of recursive regex which do find paired groups of NON-escaped parentheses !

    The regex A looks, from cursor position, for the greatest group of NON-escaped paired parentheses

    The regex B looks, from cursor position, for the greatest group of NON-escaped paired parentheses, surrounded by text different from NON-escaped parentheses

    The regex C looks, from cursor position, for the greatest range of characters, containing one or several group(s) of NON-escaped paired parentheses, each of them being surrounded by text different from NON-escaped parentheses

    Regex A : (?x) (?<!\\) \( (?: (?: \\ [()] | [^()] ) | (?0) )* (?<!\\) \) # Regex A

    Regex B : (?x) (?: \\ [()] | [^()] )* ( (?<!\\) \( (?: (?: \\ [()] | [^()] ) | (?1) )* (?<!\\) \) ) (?: \\ [()] | [^()] )* # Regex B

    Regex C : (?x) (?: (?: \\ [()] | [^()] )* ( (?<!\\) \( (?: (?: \\ [()] | [^()] ) | (?1) )* (?<!\\) \) ) (?: \\ [()] | [^()] )* )+ # Regex C

    Important : Sometimes the regex engine needs to go further on, in order to get a new paired group of parentheses to match !

    To test these regexes,:

    Paste the text below in a new tab

    Put the cursor , on the last line, right before the word This

    Run, successively, the regexes A, B and C

    C -------------------------------------------------------------------------- ----------------------------------------------------- B ------------------------|------------------------------------------------- ----------------------------------------------------- A -------------- -------------------------------------- --------------------------------------- x 1 2 1 0 1 2 1 0 x 1 2 1 0 This ( is ( ( a very ) ) small ( test \( to ( verify \( if \) all ) ) these \) ( regexes ( ( match ) NON-escaped \) parentheses) ONLY

    In the new tab, you may perfectly spread over your text in many lines without any problem, as shown below :

    This ( is ( ( a very ) ) small ( tes t \( to ( verify \( if \) all ) ) these \) ( regexes ( ( match ) NON- escaped \) parentheses ) ONLY

    The regexes will still work ! Just one restriction : You cannot, of course, split an escaped parenthesis in two parts, like below :

    these \ ) ( regexes

    Best Regards,

    guy038

    P.S. : Of course, if you change the starting position of the search, these recursive regular expressions will certainly find very different results in value and scope !

    thanks for the awesome information.

  • Column Mode Indent?

    7
    0 Votes
    7 Posts
    1k Views
    PeterJonesP

    All,

    Please do not post content generated by ChatGPT or other such systems. It is harmful, not helpful, to the Community.

    In this specific case, the content was just completely unhelpful – presumably, it was generated by just typing in the title, rather than the content of the actual question, so it completely missed the point.

    But because such AI systems have no fact-checking involved – all they do is, based on all their historical text training input, they guess what text is likely to come next. Based on that, they could easily give advice that is plain wrong or even dangerous to follow.

  • Please help a shortcut to insert date ,not time+date.

    3
    0 Votes
    3 Posts
    397 Views
    mario rossi dueM

    Thank you

  • Login via github: cancelled but here I am

    5
    0 Votes
    5 Posts
    396 Views
    Henrik JensenH

    @PeterJones This also happen’t to me. Trying to use login via my Github account, but got an error, This site can’t be reached (see output in PS!).
    Anyway, got an email from github:

    ... A third-party OAuth application (Notepad++ Community) with user:email scopes was recently authorized to access your account. ...

    The link was already made even though the Auth site couldn’t be reached. Revoked Notepad++ Community access from my github account. I was logged in, but I deleted my account since I had revoked access to my github.
    Using my google account to login worked but after ~1 hour and a half, I’m still waiting for an email confirmation?!!!

    PS! Tried again, through my Profile to change “Single Sign-on Services” association from Google to Github.
    Still got the message (Note! XXX… replaces possible privacy revealing tokens. And replaced ‘https’ with ‘h-tps’ because of spam warning):

    This site can’t be reached The web page at h_tps://community.notepadplus-plus.org/auth/github/callback? code=XXXXXXXXXXXXXXXXXXXX&state=XXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXX might be temporarily down or it may have moved permanently to a new web address. ERR_FAILED

    Again,- had to revoke Notepad++ Community access from my github.

  • Search between pages feature!

    6
    0 Votes
    6 Posts
    396 Views
    Terry RT

    @Star-Tube said in Search between pages feature!:

    I have many pages that are opened I don’t want to close so I leave them open and make new pages

    When I read that I immediately become concerned the OP is using the backup feature of Notepad++ without being aware of how it actually works.

    Please Read the FAQ post Periodic Backup vs AutoSave Plugin so you are aware of the risks of not saving those pages yourself.

    Terry

  • strange behavior with macro

    28
    0 Votes
    28 Posts
    2k Views
    pinuzzu99P

    yes confirmed. fixed in 8.5.2 version (at point 9)

    https://community.notepad-plus-plus.org/topic/24345/notepad-v8-5-2-release