• 1 Votes
    3 Posts
    160 Views
    Billy GatesB

    Hi @Alan-Kilborn

    yes that works!
    Thank you very much!

  • large selection behavior changed?

    5
    0 Votes
    5 Posts
    292 Views
    mkupperM

    @TBugReporter It may also be an issue that is happening this week. The second Tuesday of a month is Microsoft’s “Update Tuesday”. Microsoft’s update process will lock the c: file system, do a bunch of stuff, and then unlock for a moment.

    My desktop is getting clobbered and it’s particularly noticeable when dealing with large files in Notepad++. For example, today Notepad++ performance is sluggish but usable for normal size files. I opened a 175 mb (3 million line) file in Notepad++. Ctrl+End to get to the bottom of the file hung Notepad++ for about a minute. Now when I switch to another tab for a normal file it snaps over to the new tab. I switch back to the large file and it hangs for eight or nine seconds before it shows me the tab.

    It does seem like Notepad++ and/or Scintilla does an unusual amount of something to figure out what needs to get painted when the view window is at the bottom of a large file. I ran a profiler but there’s next to zero disk I/O from Notepad++ when switching tabs. It checks the files on-disk size and time stamps as part of switching but that operation took 13 microseconds. Without a bunch of time consuming digging, I have no idea why Notepad++ is stalling for eight or nine seconds.

    I did verify that it’s the scroll window being at the bottom of the file and not the caret position. I also saw that Notepad++ hangs with seemingly zero system calls and then after eight or nine seconds there is that 13 microsecond burst of activity.

    I suspect the machine will get back to its normal speedy self once the Windows updates plus Microsoft Defender stuff is done.

  • Define File type

    2
    0 Votes
    2 Posts
    198 Views
    Mark OlsonM

    @Morvyn-Finch

    Yes, you can restrict the files you want using the Filters field, as described in this documentation.

    That said, you are most likely going to be very disappointed if you try to search PDFs or Word documents with Notepad++, because Notepad++ is a text editor, not a word processor.

    If you want to search all kinds of documents (not just text documents), I recommend dnGrep, a free and open-source file searching tool. That said, further discussion of dnGrep would be off-topic for this forum.

  • Text file search and replace using lookup table

    3
    0 Votes
    3 Posts
    320 Views
    nazooks99N

    @Alan-Kilborn
    I see, sorry about that, I had searched around but didn’t find what I was looking for, probably didn’t search for the right keywords. This works perfectly, you’re a life saver! Thanks so much!!!

  • HTML code not running properly

    3
    0 Votes
    3 Posts
    179 Views
    Amir CA

    @Coises
    Oh I see went back and fixed those errors and it’s working now appreciate it

  • how to run a NPPExec script with autohotkey

    6
    0 Votes
    6 Posts
    486 Views
    CoisesC

    It looks like NppExec can process a message, NPEM_NPPEXEC, instructing it to run a script:

    https://github.com/d0vgan/nppexec/blob/66e6ad1a238588c92652a0d14230c2ed8cdb44a1/NppExec/src/PluginCommunication/NppExecPluginInterface.cpp#L168

    and as far as I can make out, that’s in a section of code that would be executed when you send NPPM_MSGTOPLUGIN to Notepad++ identifying the source module name as NppExec. I couldn’t find documentation on NPEM_NPPEXEC, though.

    I don’t use either NppExec or AutoHotKey; but my memory is that AutoHotKey can send a message to a window. If it can construct the necessary message — and if NppExec does what I think it must do when it receives such a message — then that should be a way to trigger an NppExec script directly from AutoHotKey.

    Beyond that, you’ll have to ask people more familiar with NppExec and AutoHotKey.

  • Search Result to be the word, not the whole line

    4
    0 Votes
    4 Posts
    224 Views
    PeterJonesP

    @Robert-Or-Janet-Diebel ,

    Now I want to get all highlighted words from the first search in a list of just words.

    Instead of Find All in Current Document, you could use Search > Mark, then Mark All, then Copy Marked Text – this will put all the matched terms into the clipboard, and then you could paste into a new document (or wherever you wanted it).

    With the three lines you showed, and the regex you showed, when I follow that sequence, my Clipboard now contains:

    φιλουσιν φιλων φιλων φιλουσιν

    … which is what I think you want.

  • Shortcut-key for selecting word (i.e. double-click)

    9
    0 Votes
    9 Posts
    1k Views
    G

    @Alan-Kilborn Nice! Thank you very much!

  • Regex: How to remove enewline character from a particular html tags?

    9
    0 Votes
    9 Posts
    481 Views
    Hellena CrainicuH

    The best solution is this:

    (?-si:<p class=".+?">|(?!\A)\G)(?s-i:(?!</p>).)*?\K\s+

    General regex: (?-si:BSR|(?!\A)\G)(?s-i:(?!ESR).)*?\KFR

  • help please

    4
    0 Votes
    4 Posts
    240 Views
    mkupperM

    @mohammad-maaitah Please review FAQ: Periodic Backup vs AutoSave. It’s possible you already have enabled one or more of Notepad++'s backup mechanisms in the past and Notepad++ has been saving copies for you.

    If you discover that have not enabled any of Notepad++'s backup systems then it’s a good time to enable them. For performance and disk space reasons they are not enabled by default.

  • Modifying existing language settings

    6
    0 Votes
    6 Posts
    4k Views
    PeterJonesP

    For future readers:

    Note from the future: In 2024, the HTML TAG style does have a box for user-defined keyword slots. I don’t remember when it was added, but it’s been there for a while now (I can guarantee at least since v8.6.6, but I think a lot longer than that). So if you want this, start by upgrading to the most recent Notepad++.

    Further, as I say here, I recently learned that the HTML lexer has the ability to enable “substyles” for the HTML TAG style, which you can assign your own color and your own list of keywords – so you could style your custom tags differently than the builtin tags if you want. Unfortunately, Notepad++ doesn’t (yet) enable those substyles, so you cannot do it natively in Notepad++. In this post, I share a script for the PythonScript which enables substyles – that specific post gives the example for PHP, but if you want to do the same for HTML, you would follow the same instruction, except edit the lists in class HTML_SubstyleLexer and append your colors/list definitions to the SCE_H_TAG in that class’s colorize.

  • Can't define php color for functions

    4
    0 Votes
    4 Posts
    542 Views
    PeterJonesP

    Update from the future:

    this post shares instructions for using the PythonScript plugin to add one or more “substyles” to the PHP lexer, so that you can define your own PHP keyword lists with their own custom colors.

  • How to add keywords for the HTML syntax highlighter?

    3
    0 Votes
    3 Posts
    326 Views
    PeterJonesP

    @PeterJones said in How to add keywords for the HTML syntax highlighter?:

    The Lexilla lexer for HTML does not have a provision for user keywords.

    This was wrong, assuming “add keywords” meant adding new tags. You could obviously add new tags using the Style Configurator’s HTML > Tag > user-defined keywords. I think a year ago I was under the misunderstanding that you couldn’t add your own tags, because every time I had tried, I had done a mixedCase tag so I could easily identify it; I later learned that the lexer requires the keyword list to be all lowercase (which I thought was an odd limitation, because HTML itself is case-insensitive for tag names – but it has to do with the way that the lexer lowercases the tag text before comparing it to the list). So sorry for the misinformation last year.

    Further, as I recently learned, the HTML lexer has the ability to enable “substyles” for the HTML TAG style, which you can assign your own color and your own list of keywords – so you could style your custom tags differently than the builtin tags if you want. Unfortunately, Notepad++ doesn’t (yet) enable those substyles, so you cannot do it natively in Notepad++. In this post, I share a script for the PythonScript which enables substyles – that specific post gives the example for PHP, but if you want to do the same for HTML, you would follow the same instruction, except edit the lists in class HTML_SubstyleLexer and append your colors/list definitions to the SCE_H_TAG in that class’s colorize.

  • How to use Windows default icons with Notepad++

    2
    0 Votes
    2 Posts
    204 Views
    PeterJonesP

    @educatedllama ,

    Search the internet for "windows 11" how do I change the icon for a specific filetype (or "windows 10" or whatever version of Windows you have). The answer is the same whether or not you use Notepad++.

  • SHIFT+left-click needs to select top-down not bottom-up

    13
    0 Votes
    13 Posts
    763 Views
    Alan KilbornA

    @mkupper said in SHIFT+left-click needs to select top-down not bottom-up:

    While the PythonScript is just two lines long implementing it may be technically challenging. In summary

    Good summary for this specific case.
    For the general case with a bit more hand-holding, see the FAQ entry.

    If you do Edit / Select All from Notepad++'s drop down menus then you will still get the old “broken” version of select-all

    Note that it is only “broken” in terms of how the OP thinks about it. There is no bug with Select All, just because Notepad++ happens to do it differently from some other editors.

  • HexEditor Plugin Compare Hex Dimmed

    4
    0 Votes
    4 Posts
    1k Views
    Lycan ThropeL

    @PeterJones ,
    Doh…I guess I should have tried that, too. :sigh: Oh well, that’s why there’s many eyes here just for that reason.
    Just a note, I still don’t like the way it resets my UI menu items to white, and also missing files options, even when the two compared files are closed. So I’ve uninstalled it again. Luckily, I don’t often compare binary files.

  • Preview HTML 32-bit Plugin package hash mismatched

    6
    0 Votes
    6 Posts
    782 Views
    rdipardoR

    Installation via Plugins Admin will be possible in the next release of Notepad++ https://github.com/notepad-plus-plus/nppPluginList/pull/795

    Any other issues with the plugin should be sent here: https://github.com/rdipardo/npp_preview/issues

  • Disable opening image files

    11
    0 Votes
    11 Posts
    436 Views
    mkupperM

    @wicked-clown said in Disable opening image files:

    I need to only open htm files but it loads images to when i drag and drop.

    Most things that show a list of files offer a way to filter the list by file type or extension.

    For example, with Windows Explorer type Ctrl-F to get to the search box in the upper-right corner and type ext:htm to only see the HTML files. You can then drag/drop what is shown into Notepad++ and there should be no image files.

  • g code into document.

    2
    0 Votes
    2 Posts
    488 Views
    Alan KilbornA

    @MrDee

    See HERE.

  • 0 Votes
    2 Posts
    150 Views
    PeterJonesP

    @Arsalan-M ,

    Notepad++ doesn’t currently have that option. When it installs, it adds an “Edit With Notepad++” for all files, not just known filetypes; you can either keep that for current behavior, or disable it (following the instructions in my final paragraph).

    That feature is useful to people who suddenly get a file with a non-normal extension, and want to be able to use the right-click to open it. Or people who do use Notepad++ for looking at binary files (maybe with the HexEdit plugin), so would not find it out of the ordinary to look at a .png file in that setup.

    The issue with this is that there are a lot of apps with useless or nonsensical submenu entries

    Notepad++ is adding one entry – because many users over decades of use want it and/or have at least grown accustomed to it being there. In fact, when Windows 11 changed the way that applications must interact to get their “Edit with Notepad++” entry, there were many, MANY complaints to this forum and directly to the Developer, begging (no, insisting) that Notepad++ put itself back in the main right-click menu.

    causes loading times at some point

    Loading times of what? Notepad++'s loading time shouldn’t be influenced by whether or not is has an entry in the OS Right Click menu. And I would find it hard to believe, without hard data, that Notepad++'s single entry in the right click menu measurably increases the time to load the right click menu, or to load another application, or to load/boot the OS. Do you have real data that proves otherwise – for Notepad++ (not just “some other apps entries slow it down, so I feel like I can claim that Notepad++'s does”)?

    However, if you don’t like that entry: If you get rid of Notepad++'s C:\Program Files\Notepad++\contextMenu\NppShell.dll (you might have to follow the uninstall/unregister instructions in the user manual’s Right Click > Manual Installation/Registration section before it will allow you to remove it), then reboot, then the all-filetypes Right Click entry won’t be there. You would then have to use the OS’s “Open With” feature from the Right Click menu, instead of Notepad++'s specific entry, to allow right-click and/or double-click access for a given filetype (depending on whether you say “always open with Notepad++” or not).