• 0 Votes
    5 Posts
    81 Views
    h-jangraH

    @Ekopalypse I tried simple plugin now using go. It did worked, let see if I can improve. If its good then I should make template for it.

  • The Nightmare %> Issue

    General Discussion
    10
  • New NppESPHome plugin

    Notepad++ & Plugin Development
    1
    0 Votes
    1 Posts
    27 Views
    No one has replied
  • 2 Votes
    14 Posts
    202 Views
    CoisesC

    @NolanNolan said in Standard ANSI and code still change to something else:

    But really weird that using Microsofts own notepad.exe that comes with a standard windows installation makes windows search not detect characters in txt files that belongs to the installation language of the OS.

    Perhaps not quite as strange as it might first appear.

    Support for Unicode in Windows dates back to the first release of Windows NT in 1993. (NT was a “business” operating system; it took another eight years or so to get Unicode into “consumer” systems.) The thing is, Windows chose to support 16-bit characters: UCS-2, which later became UTF-16. UTF-8 wasn’t even presented publicly until 1993, and it took many more years for it to become popular. Most early adopters of Unicode, like Windows, used 16-bit “wide” characters.

    So, for a long time, in Windows “Unicode” meant UTF-16. Windows XP (2001) introduced code page 65001 for UTF-8, but it was only useful in conversion functions and console sessions. In Windows 10 Version 1903 (May 2019), it became possible to set UTF-8 (65001) as the system code page; however, that doesn’t (yet, in 2025 at least) do as much as you might hope it would, and it can precipitate odd behavior in software. (I tested your specific case: setting Use Unicode UTF-8 for worldwide language support does not change how search in Windows Explorer interprets files without a byte order mark.)

    Files using legacy (“ANSI”) encodings are too common to ignore, but, as @PeterJones pointed out in his earlier post in this thread, there is no completely reliable way to distinguish an “ANSI” encoding from UTF-8. Windows chose to use the byte order mark (already in use in UTF-16 files) to signal when a file is UTF-8. Windows simply does not recognize a file without a byte order mark as Unicode.

    Notepad++ uses byte order marks, too, but it also recognizes when a file has a very high likelihood of being UTF-8 (without a byte order mark). This is possible because the details of UTF-8 encoding make it highly unlikely that a legacy text file will “accidentally” also be a valid UTF-8 file — unless it is very short, has been intentionally crafted to trigger false detection, or contains only ASCII characters. (Since ASCII characters are represented identically in UTF-8 and in legacy code pages, the last case only matters if you edit a file which contained only ASCII characters so that it contains one or more non-ASCII characters. In that case, it is important to set your intended encoding depending on how the file will be used.)

    What you’re confronting is the difference between how Windows detects UTF-8 (must have a byte order mark) and how Notepad++ detects UTF-8 (valid UTF-8 byte sequence, which is statistically highly unlikely to be a legacy encoding).

    There is no good solution to this without inventing a time machine and changing decisions that were made over three decades ago.

    Well… no good solution that does not sacrifice reasonable backward compatibility. I consider that one of Windows’ best features, and I admire Microsoft for sticking to it. Twenty-year old programs can still run on current versions of Windows. I hate the culture of “If it’s not constantly maintained and upgraded, junk it!” that’s overtaken most of the computing world. A job once done well should stay done. (I suspect this has a lot to do with Microsoft’s dominance in business applications.) Not everyone shares my view.

  • 0 Votes
    3 Posts
    33 Views
    Tristan HilamanT

    @PeterJones Thank you!

  • 0 Votes
    5 Posts
    370 Views
    EkopalypseE

    @h-jangra

    I doubt that you can implement this in Scintilla in a reasonable way, but the other idea of having a preview is there, and there are at least two plugins, here and here that can give you some ideas.

  • 0 Votes
    5 Posts
    60 Views
    Andrei Mincov 0A

    @PeterJones I think I found the culprit behind this.

    Looks like I had my Avast autoupdater to ON, and probably it was the reason behind quiet updates for both Notepad++ and my Mozilla Thunderbird 42.

    It became a routine for me to reinstall old versions over and over and over agian.

    Thank you for your response.

    Really appreciate your help and detailed approach.

  • 0 Votes
    7 Posts
    194 Views
    PeterJonesP

    @guy038 said in How to Print Pretty with missing close tags.:

    Let’s start from your solution

    I’d hardly call it “my” solution. In that I used your generic find/replace-in-region formula, and plugged in reasonable values for the “variables” from that generic formula. The whole point of that generic formula is to make it really easy for anyone to just plug in their BSR/ESR/FR into the formula, and have it “just work”, without having to optimize or tweak.

    If I run, successively,

    As @Doctor-Rashir said here, “There are many closed tags”… In other words, it’s not just SONRQ and SIGNOMSGSRQV1, and trying to manually run a separate regular expression for each of the “many closed tags” is thus not practical. That is why I went to a script to automate it.

  • Flex your customizations

    General Discussion
    3
    0 Votes
    3 Posts
    119 Views
    h-jangraH

    @PeterJones nice I will try and upload this theme as well.

  • Move left scroll arrow to left side of tab bar?

    General Discussion
    2
    0 Votes
    2 Posts
    50 Views
    PeterJonesP

    @jeffs555-s ,

    With more tabs than will fit on screen, most programs put the left scroll arrow on the left side of the tab bar and the right scroll arrow on the right side of the tab bar.

    I am not sure I’d agree with the word “most”.

    Microsoft’s new Windows 11 Notepad app (the one that handles multiple tabs) does. But Chrome just keeps shrinking the tab shape, and after a few dozen, I stopped trying to see if I ever got it to show scroll controls OpenOffice/LibreOffice Calc (and my memory of Excel) put both the ◀ go-left and ▶ go-right and add-sheet buttons on the lower left Google Sheets webapp puts both the < and > on the lower right As far as I can tell, Visual Studio doesn’t give such buttons; instead, they just have the ▼ pulldown, similar to the one on Notepad++'s menu bar. Mozilla Thunderbird (email client), like Chrome, seems to just shrink the tabs; again, I could never get it to show scroll controls.

    So I tried a variety of apps, from different categories of tabbed-like interfaces, and only one of them puts the left-scroll on the left and the right-scroll on the right. In my quick experiment, “most” put them immediately next to each other, wherever they go. But really, it seems there’s no global consistency on such scroll controls. That’s not to say that there aren’t a gazillion other apps that do split them between left and right sides of the Tab Bar – just that it apparently depends on one’s set of applications that they use.

    I can understand wanting it as a feature, if it’s what you are used to. It isn’t currently an option in Notepad++ (though it could be requested, as described in our feature request FAQ); and, as far as I know, there aren’t any plugins that currently move the Tab-Bar-scroll-left button to the left side of the Tab Bar (and I don’t know who would win the war between a plugin and the main app as far as trying to position that button, so I don’t know if a plugin could enforce a different location for it)

  • 0 Votes
    5 Posts
    79 Views
    Doctor RashirD

    @PeterJones
    Thank you for the reply. Yes, I understood that inference. I was hoping there was additional tweaks to try. Yes, I could do a reply. It was triggered on a very minor edit. Maybe the site support would be interested in the issue. But it’s not important to me now.

  • Notepad++ 8.8.8 release

    Pinned Announcements
    11
    1 Votes
    11 Posts
    2k Views
    Lukas MayrL

    @PeterJones
    Thank you for adding the MSI-Installer section.

    The usual switches for silent/passive/… installation work just fine out of the box with the .msi.

    @donho
    For the .exe installer there are the Notepad++ -specific options, like /noUpdater
    These options seem to be missing from the .msi package

    For instance: in the putty installer you have the option to set your own install-directory by changing the property of INSTALLDIR

    msiexec /i "putty-64bit-0.83-installer.msi" /q INSTALLDIR="C:\Tools"

    Screenshot 2025-11-21 070153.png

    Those Options seem to not yet exist in the npp-msi installer
    Screenshot 2025-11-21 070257.png

  • 0 Votes
    11 Posts
    261 Views
    N

    @PeterJones

    i have to hand it to you this worked, thank you :-)

    I couldnt find this description elsewhere, i tested all the 3 thirdparty apps, wthy didnt work though

    I seems to have missed the reg addition of defaulticon should be in the string sith notepad++

    best Nolan

  • 0 Votes
    9 Posts
    363 Views
    Alan KilbornA

    When the Fill Find Field with Selected Text option, in settings, is unchecked, and the user invokes Select And Find …, perhaps the program should (simply) run the code for the “volatile” version of the command.

    (I should have said this in my previous post.)

  • 0 Votes
    5 Posts
    222 Views
    László BotkaL

    @Rick-Kosters

    You can try the free Agent Ransack utility from https://www.mythicsoft.com
    It works with .doc, .docx and .pdf files too.

  • sha512 certificate cannot be validated

    General Discussion
    4
    0 Votes
    4 Posts
    204 Views
    PeterJonesP

    @bvklaveren said in sha512 certificate cannot be validated:

    I have seen the instructions, but installing the self-signed certificate on all computers in the organization is not a practical solution.

    Okay. Then ignore the self-signed, since there’s a commercially-signed alternative that can give you confidence that the binary is being distributed by the one who it claims to be.

    It only takes one certificate to give the confidence, but it also means that you can ignore any other certificate on the same file, because having two certificates (one self-signed that you choose to distrust and the other commerically-signed which you choose to trust) gives you exactly the same amount of confidence that the binary is valid as does having just the commercially-signed certificate with none others. Whereas for someone who does trust the self-signed, they can choose to trust that self-signed and ignore the commercially-signed as being tainted by money.

    Also, why would you include a self-signed certificate if you also have “real” one that can be validated without extra steps?

    The “why’s and wherefore’s” are all available in the public, in various discussions on this forum (search for certificate) and the relevant section of the User Manual and in the various announcement pages in the official website. But I’ll sum it up, from my outside perspective:

    Because for months, there wasn’t a commercial certificate available, because the corporations behind the certificates are set up to make things difficult to open source projects. And once he did get the new globalsign cert, he didn’t feel it was worth it to undo all the effort he had put into creating the self-signed certificate.

    Lastly, it is not in the msi, so why is it in the exe?

    apples and oranges?

    The MSI is a container, which can be signed, and is signed separately from any EXE or DLL that might be contined therein. So the developer apparently chose to only sign that MSI with the commercially-derived – probably because his system was already setup to sign the EXE with both (because it was setup to sign with just the self-signed, then he added the globalsign cert on top of that once it was available), whereas the MSI didn’t come until a month or two after the globalsign was available, so he probably didn’t think it was worth the extra effort to figure out how to sign the MSI with the self-signed as well.

  • Making a new release...

    Humour
    6
    5 Votes
    6 Posts
    265 Views
    xomxX

    @donho
    Good attempt, just for surety, why not ;-)

    And I’ve to admit that I used to “abuse” churches too - in the summer it was nice and cool there and, most importantly, quiet, so I could study there and prepare for my exams :-)

    @Terry-R @Lycan-Thrope

    Otherwise on topic - there are IMO no complete atheists (in the sense of believing in something that is beyond my reach or ordinary understanding), everyone has their own faith. But while someone believes e.g. that gravity will still work tomorrow when they wake up, someone else believes in the virgin conception of the Virgin Mary, when the Holy Spirit entered her. For me, religion just parasites on and shackles the natural human need to believe in something better/bigger, something that gives human existence true meaning and a greater dimension.

  • autoupdater and connection temp.sh

    Security
    9
    0 Votes
    9 Posts
    3k Views
    donhoD

    @John-Smith-4

    I see in v8.8.8 release there was an issue addressed with WinGup. Could you elaborate what caused this behavior?

    Unfortunately I can’t provide more facts than what we already know.
    We are not aware of any confirmed exploitation of this vulnerability in the wild.
    The fix in v8.8.8 is the best I could do to address the issue of WinGUp being hijacked.

  • 0 Votes
    5 Posts
    483 Views
    C

    after a look at jn-npp-plugin on github it seems Win32 API is not available in win x64 and i didn’t find other way to use openfiledialog…
    i am looking at python plugin now .

    thanks for your help

  • Scripts to align text

    Notepad++ & Plugin Development
    4
    4 Votes
    4 Posts
    2k Views
    sound-fxS

    The following code supports PythonScript 3.0.23 as well as earlier versions of PythonScript 3.x.

    #------------------------------------------------------------------------ # If the character specified in the current selection is a white space, # then prompt the user to enter the alignment character (or characters), # using this character as the initial default. #------------------------------------------------------------------------ default_align_char = ',' from enum import Enum class PaddingSide(Enum): LEFT = 0 RIGHT = 1 def align_selected_text(max_align_char_count = None, padding_side = PaddingSide.LEFT): """Insert padding into the lines in the selection, as needed, to align up to max_align_char_count instances of a specific character or string of characters The default is to align all instances of the specific character. At present, the alignment character is taken as the character at the top of the current selection. You can uncomment some code below to change this policy to instead take the alignment character from within the selection at whichever end has the cursor. Either way, if that character is white space, the user is prompted to type the character (or characters). If you really wish to align on a white space character, you can just click OK at the prompt. When prompted to type the alignment character, the user may enter a sequence of characters, e.g., "-->", in which case the alignment is on the instances of that entire character sequence. For example, if the user enters "-->" at the prompt, then instances of the "-" character get aligned only if they're followed immediately by the characters "->", while instances of, say, "-1" and "- " remain unaltered. If there is no current selection, then aligns all lines in the editor. If there is a current selection, then aligns only the lines that are at least partially included in the selection, and the selection is changed to the entire block of newly-padded lines. Parameters ---------- max_align_char_count : positive integer, optional The maximum number of instances to align of the specific character. For example, set to 1 to align only the first instance of the character on each line. The default is to align all instances of the specific character. """ from Npp import editor #---------------------------------------------------------------------------- # For the alignment character, take the character just inside the bounds of # the selection block (at either the start or the end, as determined below). #---------------------------------------------------------------------------- editor.targetFromSelection() selected_text = editor.getTargetText() # Use this code to get the align_char unconditionally from the start # of the selection. align_char = selected_text[0] # Optionally use this code to get the align_char from within the selection # at whichever end has the cursor. # (startByte, endByte) = editor.getUserCharSelection() # if startByte == editor.getCurrentPos(): # align_char = selected_text[0] # else: # align_char = selected_text[-1] # If the character from the selection seems implausible as the # align_char, then prompt the user for it. if align_char.isspace(): from Npp import notepad global default_align_char align_char = notepad.prompt('Align character:', 'Enter Alignment Character', default_align_char) if align_char is not None: default_align_char = align_char #---------------------------------------------------------------------------- #%% Get the lines of text within the selected alignment block #---------------------------------------------------------------------------- (startLine, endLine) = editor.getUserLineSelection() startPos = editor.positionFromLine(startLine) endPos = editor.getLineEndPosition(endLine) text_lines = editor.getTextRangeFull(startPos, endPos).splitlines(True) #---------------------------------------------------------------------------- # Remember whether there is a user-selected block, so we can restore a # corresponding selection after aligning the text. #---------------------------------------------------------------------------- restore_selection = editor.getSelectionStart() != editor.getSelectionEnd() #---------------------------------------------------------------------------- # Align all instances of align_char within the lines of text #---------------------------------------------------------------------------- if align_char is not None: # Enable the following to save the align_char, however it was determined, # to be the default_align_char when prompting for it next time. # default_align_char = align_char padding_side_offset = padding_side.value * len(align_char) if max_align_char_count is None: align_char_count = max(line.count(align_char) for line in text_lines) else: align_char_count = max_align_char_count start = 0 for instance in range(align_char_count): # Set the target column using the index of the align_char, ignoring # immediately preceding space, or the length of the line tgt_char_col = max(len(line[:line.find(align_char, start)].rstrip()) for line in text_lines) for (idx,line) in enumerate(text_lines): align_char_col = line.find(align_char, start) if align_char_col >= 0: text_lines[idx] = line[:align_char_col+padding_side_offset].rstrip().ljust(tgt_char_col) \ + line[align_char_col+padding_side_offset:] start = tgt_char_col + len(align_char) editor.setTarget(startPos, endPos) editor.replaceTarget(''.join(text_lines)) if restore_selection: startPos = editor.positionFromLine(startLine) endPos = editor.getLineEndPosition(endLine) editor.setSelectionStart(startPos) editor.setSelectionEnd(endPos) if __name__ == '__main__': align_selected_text()