• UDL: Folding with Alt-0 no longer works correctly

    9
    1 Votes
    9 Posts
    1k Views
    PeterJonesP

    @peklei said in UDL: Folding with Alt-0 no longer works correctly:

    It would be interesting to know how this is implemented there and whether it can be recreated in a UDL definition.

    In a UDL definition? No. Each built-in lexer has dedicated code for deciding where to fold (if that lexer has folding). The source code for UDL has a separate set of code, that is purely keyword-based.
    From the “UDL definition” point of view, all you can do is set the open/middle/close keywords; you cannot change the logic from the UDL interface or config file. If you wanted to change the logic, it would require a change to the UDL source code, which requires a feature request

  • Tail with filter

    2
    0 Votes
    2 Posts
    286 Views
    PeterJonesP

    @Franz ,

    Natively, no. Notepad++ doesn’t have a “filter” feature that just hides text without deleting it.

    There might be some plugins that do a “filter”-like feature, but I don’t know which they are, and it would be doubtful if they’d work correctly with the Monitor (tail -f) feature of Notepad++. If someone else knows of a way, they can chime in.

    As a workaround: assuming you have the logfile.log open as the current file (doesn’t need to be in “tail” mode, but it can be): Run > Run…

    powershell -command "Get-Date -Format 'MM/dd/yyyy' >> '$(CURRENT_DIRECTORY)\filtered.log' ; Get-Content -Path '$(FULL_CURRENT_PATH)' -Wait | Select-String -pattern '^[AEOIU].*$' >> '$(CURRENT_DIRECTORY)\filtered.log';"

    and then File > Open filtered.log, and set Monitor (tail -f).

    This example filters your original logfile.log for any line in that starts with a vowel, and pipes it into filtered.log in the same directory; when you then open filtered.log in tail-mode, only the text that matches the filter will make it into filtered.log , which you are watching as it goes, so it gives you the basic effect, even though Notpead++ doesn’t do it natively.

    If you want something other than “starts with a vowel”, change the '^[AEOIU].*$' from the command I gave to a valid powershell regular expression (make sure to keep it wrapped in single quotes, like the example regex was). (In this forum, we’re good at Notepad++ regular expressions; but powershell regex are not our area of expertise, so, if you need help with the powershell regex aspect, this forum probably isn’t the best place to ask)

  • New Update Removed My Toolbar Icons. How Do I Get them Back?

    22
    0 Votes
    22 Posts
    3k Views
    Troglo37T

    @PeterJones Great catch! Thanks Peter!! It works! I didn’t notice the double .XML.

    Just noticed your comment about the extensions. I keep it like that because I frequently use the search software Everything and several file conversion programs. I need to know what I’m dealing with while using them simultaneously.

    The other reason I keep it hidden is so I don’t accidentally screw up the extension and can’t find the file. It’s happened to me several times. The only way that can happen is when I use Everything, However, it nicely only highlights the file name and not the extension, making it harder to unintentionally change the extension.

  • doLocalConf.xml still necessary to make NP++ portable?

    3
    0 Votes
    3 Posts
    361 Views
    mkupperM

    @Claudia-Svenson, I am wondering, What are you trying to achieve?

    The reason I ask is that it’s possible to run a “portable” copy of Notepad++ without a doLocalConf.xml file.

    You may want to review https://npp-user-manual.org/docs/config-files/#configuration-files-location.

  • Use mouse browser back/forward button to rotate vertical tabs

    5
    0 Votes
    5 Posts
    686 Views
    Ariel DiamondA

    If anyone else is interested in an AHK script that works, it’s simple enough:

    #HotIf WinActive("Notepad++") XButton1::XButton2 XButton2::XButton1 #HotIf
  • Orange highlighting of everything I copy and paste into a document

    2
    0 Votes
    2 Posts
    249 Views
    PeterJonesP

    @Martin-Neosel ,

    Do you mean the orange bar on the left margin, as shown in this screenshot?
    90102f0a-b5ce-44ca-9472-e03bf0a8d861-image.png

    That’s the Change History. We have a FAQ that explains that feature, and how to turn it off (but also explains why it’s a good idea to leave it on, now that you know what it is).

  • Remove "duplicate" lines based on only a specific part of the line

    4
    0 Votes
    4 Posts
    503 Views
    Terry RT

    @inkognito said in Remove "duplicate" lines based on only a specific part of the line:

    How can I apply it to the text file without opening it in Notepad++?
    Are there any corresponding options over the command line?

    Two very leading but somewhat loosely defined questions.

    Find in Files allows you to select a number of files based on filters, such as folders (and hidden & sub-folders), file type, partial filename. So the files are edited by Notepad++ (NPP) but don’t show in the NPP view(s). You could say they aren’t opened by NPP if you mean “do I see them in the NPP view”.

    I am aware that there is the ability to have an “auto start” functionality upon loading NPP. The information is in the FAQ section here. So it uses the PythonScript plugin along with an “auto-start” script file called “startup.py”. Upon NPP loading it immediately starts processing the commands in this script file.

    There is another PlugIn called NppExec and a post late last year suggested it might have a method on autostarting once NPP is loaded, see post #26006. Unfortunately there isn’t a lot else I have seen on NppExec, it doesn’t tend to get much exposure.

    If you are referring to editing these files without NPP itself loading, then that is a whole other question which resides outside of this forum. Other command line editors such as AWK, SED, GREP etc might offer you that functionality but as I say that is not for this forum to answer. You would need to visit forums based on which ever editor you wish to use. The regular expression I provided might work as is in another editor, but likely would require some massaging to perform correctly.

    Terry

  • Escaping delimiters does not work with UDL.

    2
    0 Votes
    2 Posts
    288 Views
    PeterJonesP

    @Manish-Patel,

    Based on your description, I assume you are seeing something akin to
    e28deaed-860a-4b30-9409-669bbcf0badd-image.png
    … where the regex starts looking like a quote starts inside.

    In that example, I also showed examples of how the escape is actually intentended to work: the “Escape” character escapes the various open/close symbols _when embedded between open/close symbols. So "In \" quotes", it properly treats the \" as being inside the string, not ending the string, and similarly for the single-quote example.

    Since, based on your <Keywords...> line, you don’t have regex defined as delimiters, the parser is not in a mode where it knows it needs to escape them.

    If you define regex wrappers as delimiters as well, like:
    c4459c06-30a2-4102-b735-97449b2d96f2-image.png

    … then you can get it to treat the regex as a string:
    9c3810c4-bef3-4bb0-b24e-9443e312a000-image.png

    The reason the quote isn’t starting a string inside the regex is because, by default, UDL doesn’t allow nesting of delimiters, unless you tell it to in the Stylers. This is more obvious if I do the same regex, but with the quotes not escaped:
    186dddd5-94e5-4595-a12f-d3b85b0f2d2b-image.png

    The quotes are still not treated as string-starters, because the regex delimiters were not defined to allow nesting of the string delimiters.

    On the other hand, if you define Delimiter 5 to be [ and \ and ] and then in the Styler definition you also allow nesting of Delimiters 1 and 2:
    f6821207-5207-450b-98b9-5168b42c7068-image.png

    … then you can get another example, which shows quotes embedded in brackets, and escaped brackets:
    347cbe63-ed9c-482b-8cbd-97498d8cc7f3-image.png

    If you escape the quotes when inside brackets, they will not be recognized as embedded quotes anymore:
    8ec9e14d-4e2d-48fe-848b-4b5bf5931cd6-image.png

    So I believe these are the kinds of setups you will want. Defining the regex wrappers as delimiters as well should go a long way to giving you what you want, I think.

  • Re-Assign hotkey: Conflict found --> auto-delete previous assigment?

    6
    0 Votes
    6 Posts
    658 Views
    mathlete2M

    @PeterJones said in Re-Assign hotkey: Conflict found --> auto-delete previous assigment?:

    Once you know for sure which one you want to not use that shortcut, you just have to click on it and choose Clear

    Unless it’s a Scintilla command; as discussed in this thread, those are much more cumbersome to clear.

  • PythonScript detect saved/unsaved file state at startup

    8
    0 Votes
    8 Posts
    1k Views
    Alan KilbornA

    After long delay, I made an official Notepad++ issue out of this:

    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16514

    In the issue, I switched to using NppExec to reproduce, rather than PythonScript, lest it be interpreted as a PS bug and not a N++ bug.

  • How to disable FindHistory and FileEditViewHistory? auto-clear at exit?

    15
    0 Votes
    15 Posts
    2k Views
    Alan KilbornA

    @MarkusBodensee said:

    Highlight the entry in the dropdown and press Del to delete.

    To extend this idea, drop down the combobox, then press and hold Del (aka Delete) to remove all entries (ask the key repeats).

  • Fullscreen - X icon to close isn't enought on top right corner

    2
    0 Votes
    2 Posts
    245 Views
    Alan KilbornA

    @Andrea-Astolfi-0

    Didn’t you already say this, HERE ?

    This is a long-known issue; I could be wrong but I believe the reason it hasn’t been fixed is that it is related to other problems Notepad++ has with “high dpi” screens…

    If you’d like, you can find the issue in the official Notepad++ issue list, start HERE, and add a comment (to the existing issue) in the form of an “I noticed this too and would like it fixed”.

  • posting code (by copy & paste) with line numbers

    18
    0 Votes
    18 Posts
    2k Views
    Lycan ThropeL

    @PeterJones said in posting code (by copy & paste) with line numbers:

    @Lycan-Thrope ,

    If it’s automatically picking the D language, have you looked at Settings > Preferences > New Document > Default Language – does it say D instead of None (Normal Text)? If so, change that preference back, and it will go back to defaulting to normal text. (That setting cannot be affected by UDL, so I don’t see how your dBASE UDLs could be doing anything to influence it…)

    @PeterJones ,
    Thanks, this was the cause.
    Now that I think back, I think I was doing a help in the forum and used that to show the language setting and take screenshots…and forgot to put it back. DOH!!
    Back to normal…thanks for curing my forgetfulness. :-)

  • 0 Votes
    7 Posts
    859 Views
    dr ramaanandD

    @guy038 Thank you very much. @PeterJones I don’t come here to “fight” with anyone - I linked to the explanation of the SKIP/FAIL method by @guy038 just to help future readers to understand it. I am sorry if I have hurt you but that was not my intention. I request others to comment if any of my posts seem offensive and why they seem so (if they deem it so) - I will correct myself.

  • Bold font style change on Linux Mint

    12
    0 Votes
    12 Posts
    1k Views
    PeterJonesP

    @kapenike said in Bold font style change on Linux Mint:

    @PeterJones yes I agree, I believe the OP is ------. Keep it to reddit

    Either I have misunderstood what you were implying by that term, or I think you seriously misunderstood me somewhere along the way. I was never intending to insult or otherwise denegrate you – and I would never use the term that I think you were trying to obfuscate to refer to anyone.

    As @mathlete2 said, maybe you just forgot that you had different settings on the two; or, as all I was trying to say, you maybe didn’t notice that it was a plain text file on one machine and a syntax-highlighted file on another.

    Or maybe that wasn’t the cause at all: given the symptoms you described, and the resolution that you said works, I cannot, right now, think of anything else that would have matched your description on both sides of the equation, which is why I currently believe that; but if you have evidence to the contrary, then great. If you wanted to help figure out why things were behaving differently on Windows and Wine for you, then provide some more evidence, and we can try to help you figure it out; or if you’ve got a solution that works for you, and you don’t care about the cause, that’s fine – but I was honestly not in any way trying to insult or attack you.

  • On install regsvr32 has stopped working

    2
    0 Votes
    2 Posts
    275 Views
    xomxX

    @C-Bacca said in On install regsvr32 has stopped working:

    On windows Server 2013

    Do you mean Windows Server 2012 R2 (Windows 8.1 based)?

    (I can try to test the same in a VM but has to be sure which Windows…)

    @C-Bacca said in On install regsvr32 has stopped working:

    I have limited permissions to install on this dev machine so I installed

    From your error messages is clear that there is a problem with registering the Notepad++ context menu shell extension (NppShell). Since only “system-wide” registration (which in turn needs the admin-rights anyway) is currently supported for NppShell, I would simply choose to install without this shell extension during installation:
    npp-installer-no-NppShell.png

    Other workaround is to use a portable N++ version instead, e.g. here is the link to the latest v8.8 (x64): https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8.8/npp.8.8.portable.x64.zip

    Just unzip that to your writable folder of choice and run there the Notepad++.exe. And portable N++ versions do not contain the NppShell at all, so no similar regsvr32 problem is possible…

  • How do I sort strings separated by commas?

    5
    0 Votes
    5 Posts
    545 Views
    Alan KilbornA

    @C-Bacca said in How do I sort strings separated by commas?:

    is there a way to make this a series of steps, like a macro,

    Yes, you should be able to record it and save it as a macro.
    Note that Step 1 would not be part of the macro, but would be something that you have to do before running the macro.
    For more on macros see HERE.

  • Is the shortcut mapper dialog box broken?

    9
    1 Votes
    9 Posts
    1k Views
    mkupperM

    @PeterJones said in Is the shortcut mapper dialog box broken?:

    Could you download the appropriate artifact for your installed Notepad++, and see if this build fixes it for you?

    I’m now using both the MSVC.x64.Release and MSVC.Win32.Release Notepad++.exe files. The shortcut mapper issue has been fixed. Thank you @PeterJones

  • Grouping tabs and group renaming.

    4
    0 Votes
    4 Posts
    442 Views
  • need help to look for a word

    10
    0 Votes
    10 Posts
    1k Views
    PeterJonesP

    @dr-ramaanand said in need help to look for a word:

    simply because it is easier

    That’s apparently a matter of opinion. To me, negative lookbehind, where it’s telling you “look behind the current position, and make sure it’s not XYZ” is a lot easier to read/understand than “match something, then say, wait no, I don’t actually want to match that, let’s fail this whole path and move on to the alternation”. (And, from what I can tell, that’s not really a good explanation of skip+fail, because it takes our regex guru pages of text to explain it, whereas I can successfully convey the meaning of a negative lookbehind in one sentence.)

    Since your first version of the skip+fail post was wrong, and you couldn’t tell this immediately, even after it was pointed out to you that it was wrong, I am not convinced that it’s truly as “simple” – even for you – as you are implying.

    I am going to stick with recommending solutions that i could explain if necessary; I will only personally link to the skip+fail formula if I know of no other way to do something (and I wouldn’t tell anyone it’s “simple”)

    But if it truly makes more sense to you than a negative lookbehind, that’s great for you; everyone is different.