• Find and Replace between {}

    6
    0 Votes
    6 Posts
    723 Views
    Mark OlsonM

    @guy038
    Without even testing it, I agree that (?:\{|(?!\A)\G)[^}]*?\K\. will not have the scaling issues, but it does not correctly handle the edge case of {. or any other document with { followed by . without the matching } afterwards.

  • Notepad++ crash on shutting down laptop

    5
    0 Votes
    5 Posts
    555 Views
    PeterJonesP

    @Carolyn38972 said in Notepad++ crash on shutting down laptop:

    i need also answer

    Do you need an answer, or are you fishing for upvotes so that you can start spamming?

    We do not tolerate bots or spammers here in this forum.

    If you really need an answer, you will come back and reply with details of your exact situation. If you do not, you will be banned, because this is your second post that looks very much like you are fishing for upvotes by replying to posts that are many years old without putting in any details. You have 24 hours before you are banned for sure; if you do another of these posts that looks like fishing-for-upvotes, you will be banned even if 24 hours has not elapsed. If I see that you log in again between now and the 24 hour time limit, without replying with details to prove you are a human who really wants help, you will be banned.

  • Pinning or locking specific tabs?

    5
    0 Votes
    5 Posts
    2k Views
    Alan KilbornA

    @Alan-Kilborn said in Pinning or locking specific tabs?:

    possibly implement a feature request to allow plugins to set/get tab colors

    The implementation is finished and should be in Notepad++ 8.6.8.
    After that version is released, I’ll finish up and publish the script to pin tabs.

  • 0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Ephraim-Daniel ,

    Interesting. Most of the time, what people want is Edit > Line Operations > Remove Duplicate Lines … but that gets rid of the lines completely, whereas you seem to want to delete the text but keep the empty lines.

    There are other ways to do it, but if I were doing it for me, I would break it into two steps:

    indicate the lines to be emptied using ☹
    FIND WHAT = (?-s)(?:^|\G)(.+)\R\K(?=\1)
    REPLACE WITH = ☹
    SEARCH MODE = Regular Expression
    REPLACE ALL empty any lines starting with ☹:
    FIND WHAT = (?-s)^☹.*$
    REPLACE WITH = empty/nothing
    SEARCH MODE = Regular Expression
    REPLACE ALL

    This works by matching the zero-width between a pair of duplicate lines, and replacing that with a frown; then replace any lines that start with a frown with an empty line (but keep the EOL sequence). Since the “lookahead” is used in the first regex, the cursor hasn’t moved forward, so it can match the current line just after the previous replacement as the “old” and again check the next line to see if it matches.

    Or you could do it all in “one” step, as long as you are willing to hit REPLACE ALL more than once:

    FIND WHAT = (?-s)(?:^|\G)(.+)\R(^$\R)*\K\1
    REPLACE WITH = empty/nothing
    SEARCH MODE = Regular Expression
    REPLACE ALL until there are no more matches and the status line in the Replace dialog says Replace All: 0 occurrences were replaced in entire file

    This works by looking for a line, and any empty lines, followed by the same line again, matching the second occurrence of the line, and replacing it with nothing. But because this one replaced the second non-empty line with nothing, it loses the “memory” of the first line, and thus it won’t be able to match another immediate instance of that same first line. However, if you run it a few times, it will eventually catch them all.

    Both of these procedures assume that the data is in the order you suggest, where all the repeats are right in a row… if your data had 1:1 then 1:2 then 1:1 again, it would not find the second 1:1 as a duplicate.
     
    ----

    Useful References Please Read Before Posting Template for Search/Replace Questions Formatting Forum Posts Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • DSpellcheck

    7
    0 Votes
    7 Posts
    1k Views
    Sylvester BullittS

    @PeterJones Ok, sorry. I missed that one.

    Guess I need new glasses. Oops—I forgot: I don’t have glasses since my cataract surgery. Maybe I should have them re-install the cataracts! 8=)

  • The attribute on the element is not defined in the DTD/Schema

    2
    0 Votes
    2 Posts
    781 Views
    PeterJonesP

    @tmmartin ,

    It sounds like you are using XML Tools (or similar) plugin for Notepad++. It is trying to tell you about an error in your XML and/or the DTD/Schema that it’s linking to.

    This Forum is about Notepad++ itself, and cannot be an expert in – and should not be expected to provide help with – every possible thing you could type in Notepad++ … be it XML/XSD, HTML, C++, Python, JavaScript, cookie recipes, …

    But let me google that for you – from what I can tell from those answers, it looks like your XSD file doesn’t define the attribute noNamespaceSchemaLocation for the hci_data element. I would start my research there, if I were you.

  • opened file does not get the focus at first launch of npp only

    9
    0 Votes
    9 Posts
    2k Views
    mkupperM

    @asphodelus said in opened file does not get the focus at first launch of npp only:

    I’ve tried pre-launching, it worked, and I’ll stick to this workaround at least for now, as I hope this issue will be resolved the next clean install of windows, which I have planned for after the summer :)

    Good luck with that.

    This morning I booted and rebooted a few times this morning trying to reproduce the issue but was not successful other than when doing a deliberate effort to start Notepad++ without giving it focus.

    The first time I tried the machine was so early in the booting process that Window Focus Logger did not start logging until I was done with the test. Window Focus Logger uses Microsoft .NET Framework 4 meaning Window Focus Logger hung until .NET Framework was available and ready. While Window Focus Logger was hung, I found that right click on test.htm and selecting Edit with Notepad++ worked find. Notepad++ started and test.htm had focus in less than a second. It shows how lightweight Notepad++ is in terms of system resources needed.

    I rebooted a few more times, each time giving the system a little more time so that .NET Framework 4 could be loaded by Window Focus Logger. With logging enabled I could see that Notepad++ was getting focus when I did the right click / edit test on test.htm.

    The Windows desktop has a feature where if you are holding the shift key down as you start an application then it will launch an instance of that application but does not hand focus to it. This is mainly intended for use on the task bar to start extra instances of something but it also works on the desktop and start menu. So, I right click on the Test icon on the desktop, move the mouse down a little to Edit with Notepad++, hold the shift key down, and then left or normal click the mouse will start Notepad++ which opens displays test.htm while also not getting focus. That replicates what happens to you.

  • delete all lines that start with specific litter

    8
    0 Votes
    8 Posts
    11k Views
    A

    @PeterJones thanks solved my problem too

  • Impossible to read selected line

    3
    0 Votes
    3 Posts
    558 Views
    L

    @PeterJones Thank you!
    Removing CSVLint resolved my problem!

  • Search result not finding text strings that should be there?

    7
    0 Votes
    7 Posts
    503 Views
    CoisesC

    @CaspersDad said in Search result not finding text strings that should be there?:

    If this is the case would Notepad++ not be able to find what I am looking for?

    Probably it won’t be able to do that.

    Especially now that I see the sort of page under consideration… it’s possible that “Where do you want your auction displayed?” isn’t even in the HTML file for the page at all — it might be inserted by scripting, either server-side or client-side, so that it changes when conditions change (maybe changing to “Your auction will be displayed in:” once the user has made a choice).

    If this is a generic question as to being able to search web pages in Notepad++, the answer is, “It depends; it will sometimes be useful, it will never be 100% reliable.” If you have a specific use case, we might be able to help, but more likely you will need to consult with someone who understands the framework behind these web pages to get useful advice.

  • FunctionList not working for UDL

    5
    1 Votes
    5 Posts
    341 Views
    PeterJonesP

    @Grether2000 said in FunctionList not working for UDL:

    I’ll need to add some other matches for other machines and their comment formats.

    When you’ve got it working, feel free to submit your UDL and its FunctionList to the UDL Collection – right now, it doesn’t have a section for FunctionList, but since FunctionLists can be associated with UDLs, I think it makes sense to add a folder to house them.

    Update: The UDL Collection repo now has the functionList folder, and has the attributes and validators necessary to handle Function List definitions for the UDLs as well.

  • Find in files

    9
    0 Votes
    9 Posts
    1k Views
    PeterJonesP

    @wojh8547tg said in Find in files:

    I just had to write it like this:
    ^(ParteNumero||OKE_ID||OKE_IDCODE).*\K_\d{1,5}

    Double || because | was part of the name.

    You apparently didn’t read my answer. Double || means “ParteNumero OR nothing or OKE_ID or nothing or OKE_IDCODE” Since those groups can contain “nothing”, you will once again match more than you expect to match.

    as I said before, if you want to match a literal | , you need to have \| in your regex. I even gave you an example of how to use it, but you chose to ignore me. Good luck with that.

  • Search Window no longer opens

    3
    0 Votes
    3 Posts
    959 Views
    Alan KilbornA

    @runeoerndrup

    You of course read the FAQ section of this site when you first came here, right?
    And you saw THIS didn’t you?
    But that must not have helped?

  • how to add a sub-submenu to the context menu?

    3
    0 Votes
    3 Posts
    498 Views
    StoopidoManS

    @Ekopalypse

    Thank you very much

  • How to assign arbitrary color to standart C++ or user defined functions ?

    5
    0 Votes
    5 Posts
    1k Views
    unal mkU

    @PeterJones Thank you very much, it works on 8.6.7 portable :) .

  • How to mass shift and paste (see attached)

    3
    0 Votes
    3 Posts
    257 Views
    Sam KellerS

    @guy038 said in How to mass shift and paste (see attached):

    (?1$2 $1:)

    You’re a lifesaver! Thank you so much!

  • 1 Votes
    2 Posts
    236 Views
    mkupperM

    @Vercinger How are you opening multiple files at once? I believe knowing that would both allow for reproducing the issue and suggesting workarounds.

    You have already found one workaround which is to use v7.8.6 but there is likely a better way.

  • Ask for support Perl5 new version & Perl6

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    PeterJonesP

    To future readers:

    Scintilla eventually added a separate Raku lexer, and Notepad++ v8.6.6 and newer have the lexer enabled

  • 32- vs 64-bit (Intel): Which to use these days?

    2
    0 Votes
    2 Posts
    394 Views
    PeterJonesP

    @dcmdcmdcm ,

    If all your plugins have 64bit versions, then it was time to move as soon as they released the 64bit versions. If you have a plugin that isn’t in the 64bit list that you absolutely have to use, then you shouldn’t change to 64bit.

    That was the answer “years ago” as well.

    Since we don’t know what plugins are critical to your Notepad++ usage, there’s no way for us to answer you.

    If you look at your ?-menu’s Debug Info, it will tell you what plugins you are using (and if you share it here, tell us as well). And https://github.com/notepad-plus-plus/nppPluginList/blob/master/src/pl.x64.json is the list of all the 64bit plugins that the Plugins Admin tool knows about. If all your plugins are in that list, then you would likely have no difficulty in finally switching to 64bit. If one or more of your plugins aren’t in that list, you’ll have to look at their individual repos to determine whether they have 64bit versions. If you find any that don’t, ask yourself whether they are truly critical to your needs or not, then ask us if there are 64bit alternatives that will give you some or all of the same features that you need.

  • Page margins like in a word processor?

    14
    0 Votes
    14 Posts
    11k Views
    PeterJonesP

    @Stiggles said in Page margins like in a word processor?:

    The ability to add some top padding would be great. The top line of text has no padding at all.

    Did you read my last post in this discussion? The library that Notepad++ uses doesn’t have the feature to add top/bottom padding, so Notepad++ cannot make use of a non-existent feature. Someone who wanted that feature would have to request it from the library, they would have to implement it, and then Notepad++ would have to update its copy of the library. Since no one has taken step 1, saying “me too” is futile.