• Regular Expression in c.xml function list

    15
    0 Votes
    15 Posts
    832 Views
    PeterJonesP

    My current proposal for the updated wording:

    Contribute your new or enhanced parser rule to the Notepad++ codebase

    If you have added or updated the parser definition file for one of Notepad++'s built-in languages, you are welcome to contribute your file to the Notepad++ codebase by creating “Pull Request” (also called a “PR”) on the Notepad++ GitHub page. (A “Pull Request” is just the GitHub mechanism for requesting that code you write be added to a project.)

    Please Note: You only need to create a Pull Request if you want your Function List definition to be bundled as part of the Notepad++ codebase going forward, so that everyone who downloads Notepad++ gets your Function List definition. If you do not need to contribute your Function List definition to everyone, then you do not need to read anything below this paragraph.

    If you created a Function List for your own UDL, you do not need to create a Pull Request using the link above, because user-created UDLs and their Function List definitions are not distributed as part of Notepad++. You do not need to read any further.
    If you just edited one of the pre-existing Function List definitions for your own personal use, and you don’t want to share it with anyone else, you do not need to create a Pull Request using the link above because you are not sharing it with others. You do not need to read any further.
    This Pull Request can be used to update the Function List for a language that already has a Function List definition, but you just want to make it better for everyone; or it can be for a new definition file for one of the builtin lexer languages that does not yet have a function list definition. If it does not not meet one of these requirements, you do not need to read any further.

    If you still want to believe you should be submitting your Function List parser to the Notepad++ codebase at this point, please follow the steps below to create and verify your Unit Tests and then submit the Pull Request.

  • How do I change the blue bookmark icon?

    4
    0 Votes
    4 Posts
    454 Views
    Alan KilbornA

    @TheAndiRich

    If you are really out to change it to some custom bitmap that you define, you can get a start by seeing how it might be done:

    https://community.notepad-plus-plus.org/topic/17382 (see Apr 2, 2019 8:19AM posting)

    This posting doesn’t change what you want to change, but it gives some ideas on doing something similar.

  • Images no longer showing in any browser after View Current File

    8
    0 Votes
    8 Posts
    768 Views
    PeterJonesP

    @Sleepless-naShadow said in Images no longer showing in any browser after View Current File:

    If I can rule out Notepad++ that’s a win

    Create an HTML c:\path\to\ms-home\index.html file with MS notepad.exe, which just has a single embedded image ./images/abc.jpg (putting that image in the appropriate location, c:\path\to\ms-home\images\abc.jpg) Open that file with browser X, and prove to yourself that it it can see the image properly on your local machine Create an HTML c:\path\to\npp-home\index.html with Notepad++.exe, which just has a single embedded image ./images/abc.jpg (putting that image in the appropriate location, c:\path\to\npp-home\images\abc.jpg) Open that file with browser X (using either View Current File or the browser’s local-file-open) Notice that if the HTML is equivalent, and the relative paths are equivalent, then a file edited with Notepad++ behaves identically to a file edited with MS notepad.exe, thus ruling out Notepad++ as the culprit. If “5” was true, find an HTML forum to help you with debugging your faulty HTML, or a forum that helps with using a browser correctly for viewing of local files, because here is not the right place; if “5” was false (I am quite certain it won’t be), include screenshots and pasting the raw HTML (using the </> button after pasting to make the HTML source text appear in a text box) proving it, so we can show you where things are different, again proving that the culprit is not Notepad++. Because it’s not.

    So far, everything you have described (despite your assumptions) says that you have an HTML problem. Nothing specific to Notepad++ should change that HTML or the way that a browser interprets that HTML.

    PS:
    41acc8c6-ea69-4e62-b66b-f16d81fec54e-image.png

    d8002969-cad9-489f-943c-eb12a569b220-image.png

    <p>text before</p> <img src="./images/abc.jpg"> <p>text after</p>

    dd29bdb1-3389-4816-8ac3-d36f0dcdc256-image.png

    <p>text</p> <img src="./images/abc.jpg"> <p>after</p>
  • "Copy Failed" when installing/updating Notepad++ localization options

    9
    0 Votes
    9 Posts
    390 Views
    Terry RT

    @PeterJones said in "Copy Failed" when installing/updating Notepad++ localization options:

    but your normal user does not

    I have that as well on my work PC. But when I install I have a higher level account which is used which does have permissions. I assumed here that the same must apply as the image shows other localization files being successfully copied.

    Terry

  • Add "New Notepad++ file" in Windows11 context menu?

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @Marc0loide ,

    When Windows 11 creates a “New File” for a plaintext file, it will show the icon that is currently associated with .txt, and will give it the name of the .txt filetype. So if you choose in Windows to always “Open With” Notepad++ for a .txt file, it will generally change the name and icon (in that New File submenu, and in Explorer directory listings) to reflect the default application for .txt. But because Windows is Microsoft, it doesn’t always, and sometimes fights you. It’s a quirk of the OS, and nothing controlled by Notepad++.

  • How to set a global comment style?

    2
    0 Votes
    2 Posts
    558 Views
    PeterJonesP

    @PaulStSmith ,

    The reason you could not find it documented anywhere is that there is no easy way to do that. One of the problems is not all the COMMENTs (for example) have the same style ID or same exact name in every language; and not every language has a COMMENT. (It’s one of the reasons that designing a whole style takes effort, rather than just a couple quick tweaks.)

    If you wanted to change something like that, you could open up %AppData%\Notepad++\stylers.xml and do a series of regex-based search-and-replace like

    FIND = (?i-s)(name="COMMENT.*?fgColor)=".{6}"
    REPLACE = ${1}="XXXXXX"
    SEARCH MODE = Regular Expression

    (that will replace the foreground for any style name that starts with COMMENT with the color XXXXXX of your choice)

    You would then have to do that for every style name that is reasonably consistent throughout all the language style definitions.

  • How can I stop edits being highlighted in printing?

    3
    0 Votes
    3 Posts
    647 Views
    Jonathan SzantoJ

    @Terry-R

    Unbelievably fast response! I think that must be it, and at least I am not going crazy, as it seems to be a recent addition to the program. My coding days are long-gone, so it is not necessary to me. Thanks again for spot-on, x-fast help! ~ Jon

  • How to use characters like \t or others for style some lines?

    7
    0 Votes
    7 Posts
    1k Views
    EkopalypseE

    EnhanceAnyLexer uses indicators to highlight the text in question and these do not have access to font attributes. More precisely, as of today, indicators only have the possibility to change the foreground color. The reason why indicators are used is simple, lexers use styles and EnhanceAnyLexer should not compete with Lexers for this resource.

  • How to add a table to the first block of headings?

    21
    0 Votes
    21 Posts
    3k Views
    dr ramaanandD

    @PeterJones and @Terry-R, it worked. Some auto-correction was making the h2 become H2 (and I had selected the match case option) and I have corrected it now for which I apologise. Thank you very much.

  • How you add line splitter every tag?

    4
    0 Votes
    4 Posts
    716 Views
    Neil SchipperN

    @Rioscar-Orion-ghandy

    I will assume you want the new line inserted after each and every instance of </Entry>.

    Here is a solution using “Find and Replace”.

    First, make sure you have a safe backup of the original file.

    Next, use the backward P toolbar button (“Show all characters”), or, menu item View -> Show Symbol -> Show all chars, to view your file’s line endings. (You can show or unshow all chars whenever you want. It has no effect on the text in the file.)

    Probably the line endings are CRLF. If they are LF then, in the solution below, instead of \r\n use \n. If they are something else, you will need to describe them, and an adjustment will be needed.

    Invoke Replace dialog (Ctl+h)

    Find what: </Entry>\r\n
    Replace with: </Entry>\r\n<-------------------------------------------------->\r\n

    In the group of four options on left side, first three UNChecked; 4th one ‘Wrap around’ should be checked.

    Search mode: Extended

    Now use Replace All to process the whole file, or, you can use Replace if you want to see how it works line by line. Ctl+z to undo.

    Check the end of the file and decide if you want to keep the last inserted line.

    Let us know if it worked the way you needed.

  • Indent lines still on after i turn it off

    3
    0 Votes
    3 Posts
    582 Views
    blitztron15B

    @Terry-R Thanks so much! Have a great rest of your day.

  • UDL for DXL (C LIke) Number processing issues.

    48
    1 Votes
    48 Posts
    8k Views
    PeterJonesP

    @PeterJones said in UDL for DXL (C LIke) Number processing issues.:

    XML recognizes numeric/hex entities

    Actually, if you look at the discussion here, it appears that Notepad++'s parsing of the XML might have difficulty with the decimal numeric entities, so it seems more reliable to just use the hex entities (the ones that start with &#x then have 1 or more hexadecimal nibbles, followed by the ;)

  • 0 Votes
    4 Posts
    477 Views
    pgibeP

    @Alan-Kilborn, @PeterJones Thank you, I think that Issue#12079 properly describe my problem.
    Given that, I can close my request.
    Regards,

  • Separator

    5
    0 Votes
    5 Posts
    581 Views
    Mario CastroM

    Thanks Alan

    You rock!

  • Search and Replace

    7
    0 Votes
    7 Posts
    630 Views
    Alan KilbornA

    @Neil-Schipper

    Yes, indeed, it may very well be the simpler case. I was fooled because so often these go the other way. :-)

  • Show printable ASCII characters only

    12
    0 Votes
    12 Posts
    1k Views
    Alan KilbornA

    @Terry-R said in Show printable ASCII characters only:

    Apparently his edits are benign

    Even “benign” edits are annoying because I get a notification that there is something “new” to read. And even if such edits are “harmless”, they should be documented (like Peter will do) with an “EDIT: …” at the bottom explaining what was done.

    If an edit is so harmless that typing an “EDIT: …” explanation at the bottom would be silly…WHY even make that edit in the first place? Leave old postings the way they are (find better things to do with your time).

    It means someone can answer with a solution only to find the specifics of the request have changed in the intervening period.

    I agree and have made these feelings known, but no further changes came from that.

  • Space instead of TABS Issue, when opening files via SFTP

    3
    0 Votes
    3 Posts
    342 Views
    Alan KilbornA

    @schlaubstar said in Space instead of TABS Issue, when opening files via SFTP:

    on my notebook the opened python files show a line Ending of LF only, while it shows CR+LF on my stationary PC

    Are you sure you are opening the same file in both cases, not a duplicate in one case?

    Because, this wouldn’t depend upon any Notepad++ setting, it would depend only upon file content.

    Raspberry Pi is a Linux file system, so if the file you are opening originates there, it would have LF line-endings. But tools that might bring it to your PC for editing might convert line-endings…which would I’d think be restored when the file is updated to the Pi. But…this is just how I’d think it would work (in other words, could be wrong).

  • Manual: chapter Search

    10
    0 Votes
    10 Posts
    597 Views
    Lycan ThropeL

    @Alan-Kilborn ,
    Actually, the wording of that command only verifies that it is already a token. It is simply adding a Style data element to it’s data such as it’s position in a document. :)

  • 0 Votes
    5 Posts
    2k Views
    guy038G

    Hello, @brent-parker, @terry-r, @neil-schipper and All,

    So, @brent-parker, given this INPUT text :

    I run this regex test " but I suppose it will be OK ". However, I must verify this assertion. We went out for a walk in the country-side. " On the way back, we can take some cakes ". We often come to this store. They are going to the movies tonight. " They hope it will be interesting ". They had, indeed, been disappointed the previous time!

    Use this regex S/R :

    SEARCH (?x-is) " .+? " (*SKIP) (*F) | \b (?: ( I ) | ( We ) | ( They ) ) \b

    REPLACE (?1Guy)(?2Bob and me)(?3The group)

    And you’ll get your expected OUTPUT text :

    Guy run this regex test " but I suppose it will be OK ". However, Guy must verify this assertion. Bob and me went out for a walk in the country-side. " On the way back, we can take some cakes ". Bob and me often come to this store. The group are going to the movies tonight. " They hope it will be interesting ". The group had, indeed, been disappointed the previous time!

    Notes :

    The search regex uses a non-common modifier (?x) which enables the free-space mode for a better identification of the regex parts

    The search regex uses a special structure, called Backtracking Control Verbs. This specific form (*SKIP) (*F) can be understood as :

    What I don’t want (*SKIP) (*F) | What I want

    We do not want everything between double-quotes and we do want to replace some words with an alternative text, accordingly !

    So, any word I is changed by Guy, any word We is changed into Bob and me and any word They is replaced by The group, when they all are not found within double-quotes zones ;-))

    Best Regards,

    guy038

  • Using sets to find A-Za-z plus the # and - chars ..?

    23
    0 Votes
    23 Posts
    1k Views
    guy038G

    Hello, @peterjones,

    In my previous post, I forgot to mention the ^ character, which has a special meaning within a Character class !

    So, here is an updated version of my previous post :

    If we consider the following CHARACTER CLASS structure : [.......] 123456789 The POSSIBLE location(s), in order to find the LITERAL character below, are : LITERAL Character [ : POSSIBLE at any position, BETWEEN 2 to 8 POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character LITERAL Character ] : POSSIBLE at position 2 ONLY POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character LITERAL Character - : POSSIBLE at position 2 POSSIBLE at position 8 POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character LITERAL character ^ : POSSIBLE at any position, BETWEEN 3 and 8 POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character LITERAL Character \ : POSSIBLE at any position, BETWEEN 2 to 8, if PRECEDED with an ANTI-SLASH character

    And I suppose that @alan-kilborn could add :

    To use a “literal ^” in a character class: Use it directly like any other character, e.g. [ab^c], but right after the opening [ of the class notation ; “escaping” is not necessary (but is permissible), e.g. [ab\^c]

    Best Regards,

    guy038