• Please Read This Before Posting

    Pinned Locked faq newbie
    1
    7 Votes
    1 Posts
    9k Views
    No one has replied
  • HELP: Having trouble with Macros in v8.5.3 or later

    Pinned
    28
    2 Votes
    28 Posts
    33k 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.
  • How to find posts in my HUGE Master file..

    2
    0 Votes
    2 Posts
    24 Views
    PeterJonesP
    @Allinmyhead , Notepad++ has no notion of “post”. It just sees a big blob of text, and tries to apply the search string you give it. If you search for just your username, that’s the only piece that will match. If you use a more complicated regular expression (“regex”), you can define a fancy search that will match more. If you gave more details about what a “post” is formatted in text, we could help you come up with the right regex. For example, if the post is username: blah blah blah [newline][newline], then something like ^username: .*?\R\R would find everything from username: to the two newlines in a row. But Notepad++ is not just going to “hide” everything else, and allow you to look at just that. As you do each Find Next, it will just highlight the entire match. It might be possible, if you gave us examples of what this file would look like, to be able to strip out “posts” that aren’t yours, instead. (Similar to the above, but matching anything but your username at the start of the post). But until you give us example data that matches your formatting, and show which posts you’d like to keep and which to delete, there is no way we could randomly come up with the right regex to help you. Click the </> button in your reply. Put some data in the code-box that creates. Make sure the data matches your actual data, and is formatted exactly the same. Indicate which “posts” you’d like to keep vs delete. Make sure you give us a description of how you, as a human, would recognize where one post starts and ends. Update: it might actually be easier to use the Mark dialog to mark all the username posts, rather than the find/replace to delete the non-username posts. That would allow “copy marked lines”, and then the username-only ones could be pasted in a new file, rather than deleting the non-username posts from the original. But it depends on the shape of the data, and whether you’d prefer to just delete from your old file or create a new one…
  • Why headings are not displayed in the function list menu ?

    11
    1
    0 Votes
    11 Posts
    431 Views
    B
    @PeterJones Thank YOU so much I copy Your overrideMap & udl_markdown in my folder and problem is solved. I wish program by default have this option. Thank you again dear Peter
  • is there a way to save a file as .srt?

    saving files srt
    6
    0 Votes
    6 Posts
    235 Views
    CoisesC
    @Midnitecata said: @PeterJones thank you for your help, ill probably steer clear of it just out of caution, but i might look into it further should the tedious formatting inconvenience me enough to learn how to spot malicious code! thanks again!! :) Just a side note to this discussion: While you certainly can manipulate *.srt files in Notepad++ (and I do on occasion), for most purposes the free and open source program Subtitle Edit (found here on GitHub) is much easier to use. It has many functions for doing things like shifting times, identifying likely errors, and so on. Before working too hard to find a way to do something with a subtitle file in Notepad++, I recommend checking first to see if Subtitle Edit already knows how to do it.
  • Code is not working

    4
    0 Votes
    4 Posts
    277 Views
    guy038G
    Hello, @blake-g.-barrington, @peterjones, @coises and All, Here is my version to get duplicate lines, separated by any number of lines ( whatever they are : true empty lines, blank lines or lines with text ), even zero line : MARK (?-si)^(.+)(?=(.*\R)+\1$) As said by @Peterjones, and after some tests, this kind of regex get into trouble when the bunch of lines, between two duplicate lines, exceeds 15,000 empty lines about ! Now, Let’s suppose you create this text file : first 0002 0003 0004 0005 .... .... .... 9997 9998 9999 10000 first Then the (?-si)^(.+)(?=(.*\R)+\1$) regex returns : Correct result until the number of the in-between lines does not exceed 1,600, with the message 1 match in entire file Correct result until the number of the in-between lines does not exceed 12,000, although the error message Find Invalid Regular Expression ( So F.I.R.E. !! ) occurs ! NO result at all if the number of lines is over 12,000 lines, with, of course, the error message Find Invalid Regular Expression Best Regards, guy038 P.S. : I should add that my Windows11 laptop has 32 Gb of memory !
  • ASCII Sort Order

    7
    0 Votes
    7 Posts
    421 Views
    L
    @PeterJones, Thank you for your considered (and considerate) engagement. I actually hesitated to respond with my comment about the 70s and 80s, pretty sure I would get what you gave, but I couldn’t resist—I’m old (83 next month). Anyway, thanks again for putting up with me. …lee
  • Cursor starts at column 1 instead of column zero since 8.2.1

    6
    0 Votes
    6 Posts
    2k Views
    P
    Hi! A bit late, maybe my ZeroBasedColumn plugin could help with what you’re looking for. It makes the column numbering in Notepad++ start from 0 instead of 1. https://github.com/pasqualeambrosio/ZeroBasedColumn Hope it helps!
  • Add Increment Number (part 2)

    7
    0 Votes
    7 Posts
    312 Views
    CoisesC
    @PeterJones said: PeterJones said: I assume the Search++ syntax would be the same Per the Search++ announcement, it can do the numeric calculations that were first developed for Columns++. I should update the FAQ soon… I recommend waiting on that update. Search++ is not “production ready” yet. People shouldn’t be using it at present unless they want to be beta testers. Once I reach a 1.0 release I’ll make a serious effort to avoid changing things that people would expect to stay the same, but right now, anything could be changed at any time. Numeric expressions in Search++ do not have quite all the features of numeric expressions in Columns++; in particular, the history options (using the values captured or computed in a previous match) aren’t supported in Search++, and the exprtk return statement isn’t supported. However, I think all the features directly cited in the Math FAQ are included. The reg(1) syntax still works, but in Search++ you can use $1 as well. However, a quirk is that since Search++ doesn’t have the persistent Decimal separator is comma option of Columns++, it’s necessary to use regc(1) or $$1 for European-style numbers with periods and/or commas. Finally, Columns++ can only work on the active document. Search++ has a Find in Files option, but Replace in Files has not yet been implemented. So if your guess was correct and @neculai-i.-fantanaru wants a regular expression because it must be applied to many files at once, @thomas-knoefel’s MultiReplace is the best choice among presently-existing options. Oh, and MultiReplace has recently added an option to use exprtk formulas as an alternative to its Lua syntax.
  • REGEX: Change the name in reverse order

    11
    0 Votes
    11 Posts
    630 Views
    Neculai I. FantanaruN
    @guy038 I can creat a Python script :) but the beauty and art was finding a solution just with regex.
  • 0 Votes
    5 Posts
    278 Views
    PeterJonesP
    @Jacopo-Remondina , I am still not sure what you want for FOLDING and what you want for KEYWORD and what you want for DELIMITER and what you don’t want detected at all. But at this point, I’m guessing that what you want is too complicated for the simplistic keyword/token matching used for UDL. For FOLDING, it’s designed to either match spaces-not-needed so the open/mid/closing all don’t require spaces, or to match spaces-required so the open/mid/closing all do require spaces; it is not meant to mix, so that the open doesn’t require spaces but the close does. The easiest workaround is what you already know: enumerate them all. I don’t think you’re going to find a better solution.
  • Search & Replace syntax

    4
    0 Votes
    4 Posts
    224 Views
    CoisesC
    @KRadiants said: 1: False on both counts. Here is an example line <attribute id="Selectors" type="LSString" value="SelectSkills(ed664663-93b9-4070-a54b-3c7b19c0e7b4,3);SelectSpells(61f79a30-2cac-4a7a-b5fe-50c89d307dd6,2,0,BardCantrip,,,AlwaysPrepared);SelectSpells(dcb45167-86bd-4297-9b9d-c295be51af5b,4,0,BardSpells);SelectEquipment(aab8c5b5-eacf-4867-8e5f-bd4de3a9132e,1,BardInstrument);SelectAbilityBonus(b9149c8e-52c8-46e5-9cb6-fc39301c05fe,AbilityBonus,2,1)"/> There is a blank before, and sometimes there is something before and/or after it Otherwise, this is correct. OK, so in this example you want to end up with: <attribute id="Selectors" type="LSString" value="SelectSkills(ed664663-93b9-4070-a54b-3c7b19c0e7b4,3);SelectSpells(61f79a30-2cac-4a7a-b5fe-50c89d307dd6,BardCantrip,,,AlwaysPrepared);SelectSpells(dcb45167-86bd-4297-9b9d-c295be51af5b,BardSpells);SelectEquipment(aab8c5b5-eacf-4867-8e5f-bd4de3a9132e,1,BardInstrument);SelectAbilityBonus(b9149c8e-52c8-46e5-9cb6-fc39301c05fe,AbilityBonus,2,1)"/> ? If that’s correct, try the same expression I suggested before, except remove the ^ from the front: Find what: (SelectSpells\([\d\-abcdef]+),\d+,\d+ Replace with: $1
  • User defined language seems to support only one extension

    4
    1
    0 Votes
    4 Posts
    321 Views
    PeterJonesP
    @André-Programmeren said: As far as I remember I stopped and re-started Notepad++ Notepad++ saved it’s current language for that file (plain text) in the session config, then used that saved session config when you restarted. (This is a critical feature when one extension can have multiple meanings, and you have overridden the default language for a particular file) OTOH, if you close the file, Notepad++ discards meta-information, like what language was previously served, and so re-applies its internal rules and will see the UDL extension when you re-open the file.
  • Editing lines from vertical to horizontal format

    5
    0 Votes
    5 Posts
    369 Views
    PeterJonesP
    @goma-2000 , Your most recent post just quoted previous, not saying anything new. Were you meaning to say something?
  • 0 Votes
    4 Posts
    245 Views
    M
    @Coises Thankyou so much, I had two question marks near the end of the code block I was replacing with that I hadn’t escaped, so the code got cut off there. I’d blindly assumed NPP’s find and replace didn’t care about escaping because the code is full of all manner of forwardslashes, colons, and angle brackets and they posed no issue.
  • Trying to drag tab to new instance with unsaved changes

    2
    0 Votes
    2 Posts
    196 Views
    PeterJonesP
    @LiivaneLord said: I have noticed that I can now take tab and drag it outside window to make new instance of notepad++. Thank you. That’s not a new feature in v8.9.7. It’s been there a long time (as long as I can remember *). There is only 2 bugs - I cant drag modified file and I cant drag new file from scratch. That’s inherent to the design (and nothing new, so not a regression, and thus shouldn’t be in the Release Announcement anyway) To drag a file to a new instance, there needs to be an underlying file on the filesystem, with all the bytes that you want to open in the new instance, because what Notepad++ does is it launches a new instance of the executable, then uses the internal “file > open” command to read the original file off the disk, then closes the old copy from the old instance of Notepad++. If there wasn’t a file on the disk, there would be nothing for the new instance to read; and if there are unsaved changes, then those changes would not be saved to the disk yet, so the new instance couldn’t read those. To protect you from losing all the unsaved text that you’ve already typed, Notepad++ doesn’t activate the “move to new instance” feature when you try to do it with unsaved changes (whether in a new # document, or in an existing file with unsaved edits). The behavior you described is thus “working as designed” to keep you from unexpectedly losing your data, and thus not a bug (and definitely not a regression). *: update: yes, I tried back to v8.0 in 2021 and even v7.0 from 2016, and I could drag a tab from the tabbar to a new instance, even from the 2016 version of the application. Having proven it worked that way a decade ago, I can confidently say that this is definitely not a new feature. since this is not a new feature, and the problems you are describing are neither a problem with a new feature nor a regression in an existing feature, and they don’t belong in the “Notepad++ release 8.9.7” announcement, this question and reply have been forked to a separate “help wanted” topic.
  • Remove lines starting by...

    2
    0 Votes
    2 Posts
    266 Views
    PeterJonesP
    @Passant-Delarue , Initial guess: turn off “. matches newline”, otherwise your .* will greedily match the whole file.
  • Text selection color is gone since a few updates

    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP
    @Krzysztof-Blachnicki said: I deleted ExtSettings.ini (which was 0 byte) and… It works again. Maybe it’s n++ fault, but… For other plugins settings aren’t gone and when files are 0b they don’t cause glitchy behaviour. I’d bet it’s rather a problem with this particular plugin. If deleting the ExtSettings.ini caused the problem to go away, then I am confident it is the plugin, not Notepad++ itself, that is the culprit. The question is what now? Whom I can ask for reaction? Report the problem to @dinkumoil , the author of the plugin => https://sourceforge.net/projects/extsettings/support
  • Folder as Workspace not listing full content of folder (v8.9.7)

    faw
    3
    1 Votes
    3 Posts
    333 Views
    G
    @PeterJones Okay, yes, there are several subdir in that folder that are links (issue #18248). Actually, the first subdir is a plain one and is displayed whereas the second one is a link and is not displayed while preventing the display of the remaining data. I’ll give the RC a try. Thanks again.
  • (\W)'(\w) Regex replace failure

    find repl reg
    4
    1
    0 Votes
    4 Posts
    465 Views
    mpheathM
    @Coises said: Notepad++ won’t let the selection that results from a search split a CRLF line ending. As you can see, it moves the start of the selection from the actual location of the match to after the line ending. I noticed that in a Lua script recently that the Scintilla positionAfter function treats CRLF as a single UTF-8 character. So the CRLF has become what some may call an unbreakable sequence in some situations.