• How to extract last 23 digits from this string

    3
    0 Votes
    3 Posts
    320 Views
    breakfreerut rutB

    GREAT! Thanks. The search expression worked.

  • How instlla emmet plugin?

    3
    0 Votes
    3 Posts
    421 Views
    rdipardoR

    @jafet-Figueroa

    There’s also jn-npp-emmet, a JavaScript extension for the jN plugin (a.k.a “jn-npp-plugin”), which has a fairly recent 64-bit version. First you install jN, then install the scripts, as per the instructions.

  • Little Dialog-wrapper for PythonScript

    74
    4 Votes
    74 Posts
    13k Views
    PeterJonesP

    @Bruno-Bonaspetti ,

    Have a little patience. You already asked that question yesterday here. This is not paid support that is guaranteed to get a reply in 5 minutes or your money back; this is a Community of fellow users of Notepad++, and as such, any who read here regularly and answer questions do so solely on their free time, and they might not always have time to answer a specific question – especially one that might take more knowledge of a specific sub-tool of Notepad++.

    Furthermore, this topic, “Little Dialog-wrapper for PythonScript” is focused on the Dialog Wrapper library for the PythonScript plugin; it briefly mentioned a script that was using that wrapper to help with the user interface, but the translation is not the focus of this discussion.

    Your original question was in the right place. This question was not. I will try to give a brief answer in the other topic.

  • SaveAs event - get new file Name

    3
    0 Votes
    3 Posts
    203 Views
    Mark OlsonM

    As an example, I want to trigger my action wehn saving a file with the extension .special. When I open a file log.txt and select saveAs and enter log.special, then I still get the Filename log.txt from NPPN_FILEBEFORESAVE, hence my action will not trigger

    As @Coises said, NPPN_FILESAVED should be used to listen for when a file is finished saving. As the name implies, NPPN_FILEBEFORESAVE fires before the file is saved, so you should not be too surprised that you get the old name of the buffer when you respond to this notification.

    To respond to a file being renamed, use NPPN_FILEBEFORERENAME, NPPN_FILERENAMED and NPPN_FILERENAMECANCEL.

    You need a global variable, the name of a file that is being renamed. Let’s call it fileToRename.

    When you receive an scNotification with code NPPN_FILEBEFORERENAME, set fileToRename, to the name of the buffer to be renamed (use NPPM_GETFULLPATHFROMBUFFERID with WPARAM = scNotification->Header.idFrom) When you receive an scNotification with code NPPN_FILERENAMECANCEL, set fileToRename to NULL, because the file rename operation was cancelled. When you receive an scNotification with code NPPN_FILERENAMED, you can set fileToRename to the name of the file after being renamed (use NPPM_GETFULLPATHFROMBUFFERID with WPARAM = scNotification->Header.idFrom)

    If you don’t care about what the name of the file was before after it was renamed, you can also only listen to NPPN_FILERENAMED.

  • My Notepad++ binhex plugin

    19
    1 Votes
    19 Posts
    14k Views
    donhoD

    FWIW, just FYI:
    The Mistpen malware is a modification of a legitimate plugin for the Notepad++ open-source text and source code editor.
    Ref: https://cybersecuritynews.com/hackers-targeting-job-seekers/

    Another link: https://therecord.media/north-korea-hackers-energy-aerospace

    It seems the malware in question reuses only the ability of binhex, but not uses Notepad++ as loader.

  • Support for KQL

    2
  • Change-Request: Add display of Unicode 'Tags' symbols

    2
    0 Votes
    2 Posts
    303 Views
    PeterJonesP

    @Dennis-McEnaney ,

    What do you mean by “Unicode ‘Tags’ symbols”? Do you mean like 👍 is U+1F44D ? So something like 65014dfd-0070-4c2e-858c-5d43694fc98f-image.png being shown like 46e0db8c-ab83-4cbf-9490-f835d7e5e511-image.png ?

    if so, that’s an interesting feature request (though I personally doubt it would be implemented, even if you made an official feature request, as described in this FAQ; without following those instructions, I can guarantee it won’t be implemented, because the developer wouldn’t know you wanted it). ‡

    As a workaround, I have a script WhatUniChar.py for the PythonScript plugin – if you download it, and follow the instructions in this PythonScript FAQ to install the PythonScript plugin and script, then you can run that script and the statusbar will temporarily change to show you the character information:
    e6aee356-8594-4eb5-aaf4-acef1126e308-image.png
    (I have that script associated with a keyboard shortcut, so I can just put the caret before the interesting Unicode character, and use that shortcut, and it will tell me what the character is.)

    ‡: As you might guess from my screenshot, it was actually feasibility for Notepad++ to do this: Notepad++ uses the SCI_SETREPRESENTATION command when making those boxes, so my screenshot was made by using the PythonScript plugin to send editor1.setRepresentation(u'\U0001F44D', 'U+1F44D') to set the representation for just the 👍 character. In theory, you could run a loop in PythonScript to go from U+0080 through U+10FFFF to make all those representations. I just don’t think that the developer would be interested in adding that to the Show All Characters choices (I think similar things have been asked before, and rejected or ignored.)

  • Find in Files: all fields highlighted

    13
    1 Votes
    13 Posts
    693 Views
    S

    OK, should have mentioned here I had created an issue on GITHUB. OK, one remains, that’s fine.

  • C# GUI access

    9
    0 Votes
    9 Posts
    748 Views
    PeterJonesP

    @General-Coder ,

    My guess is that @myGitAlex thought that showing you another example of a GUI written in C# would be helpful – maybe assuming you were asking “how do I write any GUI for my plugin using C#”, not realizing you were asking for a very specific question about accessing specific parts of the native Notepad++ GUI from your plugin, even though they don’t have plugin API calls.

  • Delete lines from Search Result

    3
    0 Votes
    3 Posts
    280 Views
    ΣΥΝΠΑΝ SoftwareΣ

    It does not work for me. It seems never to receive keyboard focus although I can click my mouse and copy text from the results window, nor is there a delete entry in the context (right-click) menu. All keyboard events go to the active tab window

  • Hide/shade code not #defined

    9
    0 Votes
    9 Posts
    1k Views
    PeterJonesP

    @Vitaly-Gelman ,

    I wonder if there is a way to set a background to grey for a disabled block of C code

    Use editor.styleSetBack(...) instead of editor.styleSetFore(...)

    Also, where can I find a description of editor.styleSetFore() function

    If you click on editor.styleSetFore() in your script inside Notepad++, and use Plugins > PythonScript > Context-Help, it will take you to the PythonScript documentation for styleSetFore, which tells you that the second argument is the color

    namely the second argument (clr). What are the three integers there?

    The “color” to use. Specifically, the three integers in the tuple are the red, green, and blue values. In my calculation, I had it set the “disabled/hidden preprocessor section” (aka “SCE_C_PREPROC_HIDDEN”) to the foreground color that’s halfway between the foreground and background of a normal preprocessor (which is a reasonable hidden value, whether in Light Mode or Dark Mode).

    So if you want to set the background, you would have to pick red/green/blue values that make sense given your theme, and use editor.styleSetBack(self.SCE_C_PREPROC_HIDDEN, ...) where ... is either a tuple variable (like clr) or a literal tuple (like (63,63,63)).

    (Please note that Scintilla, and thus Notepad++, treat the #if 0 exactly the same as the #ifdef NOTDEFINED, so there is no way to distinguish between a hardcoded #if 0 and the define-based #ifdef NOTDEFINED – so I hope you weren’t asking to be able to distinguish between the two, as you would be disappointed if you were.)

    PS: the styleSetFore() didn’t specifically describe that a “color” was in a tuple, because near the top of the Editor Object page, there is a paragraph which says,

    Colours are a tuple of (red, green, blue) where each of red, green, and blue is between 0 and 255.

    … and that paragraph applies to all “color/colour” arguments throughout the documentation.

  • [New Plugin] Blitz Search

    8
    3 Votes
    8 Posts
    1k Views
    natestahN

    So glad this is in the latest build!

    Small Demo here:
    https://www.reddit.com/r/notepadplusplus/comments/1e6eceq/blitz_search_in

  • Npp and plugins, font size of the representations

    2
    0 Votes
    2 Posts
    329 Views
    CoisesC

    @Raff-Zahn said in Npp and plugins, font size of the representations:

    In Windows 11 I set the display to 125%. Npp does not handle the adjustment.

    That’s strange. On Windows 10, I have two monitors; one is scaled at 100% and one is scaled at 125%. The size of menu text, icons and editable text changes when I move the Notepad++ window from one monitor to the other (unmistakably visible as I drag it across, because when the window changes from being mostly on one monitor to mostly on the other, the size changes on both monitors). If the display scaling is really not affecting Notepad++ in your installation, there must be some reason; normally, it does.

    Is there a way to adjust and zoom the representations in plugins?

    Plugins in Notepad++ create their own user interface, aside from docking dialogs when docked (and even then, it’s only partially under the control of Notepad++). You would have to make your request to the author of the plugin in question; usually there is a GitHub issues forum.

  • 1 Votes
    9 Posts
    933 Views
    Guido ThelenG

    Hi,
    did you install the C++ development tools when installing Visual Studio. This is mandatory for developping the Npp Plugin.
    Regards
    Guido

  • List with self created code snipets

    7
    0 Votes
    7 Posts
    576 Views
    Raff ZahnR

    My ancient Oxford English is very bad? I actually have a poor understanding of US English here in the forum. So I have to use a translator. Thanks for the tip.

    Actually, it’s not QuickText but the Snippets plugin that’s right for me. It’s much more elegant than Panel in the old Weaverslave.
    As a docking popup it’s OK. I expand the left editor margin to the maximum, make the snippets quite narrow, use very short tag names, put the line numbers and the margin in the snippets. So it’s almost perfect.

    Thank you for help. I’m already happy with the npp. Must see, Donate is mandatory.

  • Plugin MultiReplace: Translation Help Needed!

    3
    1 Votes
    3 Posts
    527 Views
    Thomas KnoefelT

    Russian is the first language translation completed. Thanks to AlexERistGIT.

    There are still a few more languages left to go ;-)

    If you are a native speaker of a language other than German or English, feel free to join and help with further translations.

  • Support for Plugins Admin & NppPluginList

    73
    1 Votes
    73 Posts
    92k Views
    CoisesC

    @PeterJones said in Support for Plugins Admin & NppPluginList:

    Let me know if that procedure […] is able to work for debugging.

    Yes, it works. Thank you.

    I didn’t bother to examine the code to find out how it works, but apparently using a debug version of Notepad++ automatically uses the .json plugin list instead of the .dll, so the test proceeds just fine. Just to be sure, I tried changing my plugin’s hash value in the list and it flagged the mismatch, so it is validating the hash.

    I don’t think that’s an unreasonably difficult procedure for plugin authors to follow (relative to the work to actually write and debug a plugin!). It’s not a big deal if updating those fixed-URL debug builds is inconvenient. It would just be good to have the procedure documented, either in the manual or in the plugin list readme (to which the manual could refer — personally, I think it makes more sense in the plug list readme).

  • 1 Votes
    3 Posts
    301 Views
    CoisesC

    @PeterJones said in I was ambushed by the 63-character limit for plugin menu item names:

    Given that the menuItemSize doesn’t affect anything except the size of the Plugins’ menu entries in TCHAR _itemName[menuItemSize], and the equivalent for built-in context menus is generic_string _itemName , which doesn’t have length restrictions, I think it’s worth trying to ask Don to allow for an increase (“Notepad++ menu entries don’t have a length restriction, but Plugin menu entries do” seems a solid argument, to me).

    Changing that would break existing plugins. It’s hard-coded into the C interface.

    @Mark-Olson
    I’m coming a bit off the top of my head here, but I see no way Notepad++ could offer a message, since the length limit is hard-coded into the interface structure. If you’re supplying more than 63 characters, you have, by definition, broken the interface.

    If you hard-coded a character string of more than 63 characters into a C/C++ program using that structure (as I use it here), you’d get a compile time error.

    As I understand it, plugins that choose to be translatable must supply their own translation mechanism; Notepad++ doesn’t do anything about that. I believe it must be the translation process in your plugin that is copying a string without checking the acceptable target length first.

  • Little script is very slow (depends on file size)

    9
    0 Votes
    9 Posts
    483 Views
    PeterJonesP

    @0BZEN said in Little script is very slow (depends on file size):

    Not necessarily, no, it’s just very convenient, especially with shortcuts.

    I’m just saying, select, Ctrl+M, visually confirm checkboxes, and click Mark All isn’t that onerous… and if your script is “very slow”, it’s sure to be faster than >15sec for the script version.

    Possibly, although that will get invalidated when the file content changes

    Mine doesn’t cache that information from run-to-run. It just precomputes the mapping of the positions-from-lines in a way that only requires going through the whole document once (as far as I can tell), rather than counting from the beginning every time.

    Yeah, the search results don’t contain meta-data, like line numbers. It might be possible to count the number of ‘/R’ characters from the last hit, the first search result using the slow function (or count the ‘/R’ from beginning of file).

    I’m pretty sure that the extra effort of counting between matches (which isn’t implemented already, so it’d have to be manually done) would be more time-consuming than the current.