• Save session

    2
    1 Votes
    2 Posts
    229 Views
    Alan KilbornA

    @Joe-Cool2021

    I agree. Session management functions are underdeveloped.

  • Is there a way to search for duplicate records in Notepad++?

    9
    0 Votes
    9 Posts
    192k Views
    Alan KilbornA

    @guy038 said in Is there a way to search for duplicate records in Notepad++?:

    Why do you want to mark all the duplicate lines ?

    A practical reason (not involving copy/cut/delete) for this might be so that each duplicate line can be visited and manually edited to be made unique in some way.

  • Linebreak after text with number in different lengh

    3
    1 Votes
    3 Posts
    272 Views
    AndiA

    @Coises That worked perfectly, many thx for the fast response. Have a nice day.

  • 0 Votes
    6 Posts
    1k Views
    Fuel DZNF

    @Alan-Kilborn said in PythonScript: How to interact with dialogue boxes?:

    That was my exact experience too. And even though inspect.exe shows the search result window, pywinauto still can’t find it.

    I instead opted to use this code made by someone here. With it I could create a script that suited my own uses, which I’ve now adapted it into something more general purpose below. It searches across multiple directories, reads the search results and allows you to open the files. (To anyone that uses it: make sure ‘Purge for every search’ is enabled in the search results context menu.)

    # encoding=utf-8 from ctypes.wintypes import BOOL, HWND, LPARAM import ctypes import os.path import re import time from Npp import editor from pywinauto.application import Application console.clear() console.show() console.editor.setReadOnly(False) def get_search_results(): WNDENUMPROC = ctypes.WINFUNCTYPE(BOOL, HWND,LPARAM) FindWindow = ctypes.windll.user32.FindWindowW GetWindowText = ctypes.windll.user32.GetWindowTextW GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW EnumChildWindows = ctypes.windll.user32.EnumChildWindows GetClassName = ctypes.windll.user32.GetClassNameW curr_class = ctypes.create_unicode_buffer(256) search_results = '' def foreach_window(hwnd, lParam): global search_results length = GetWindowTextLength(hwnd) if length > 0: buff = ctypes.create_unicode_buffer(length + 1) GetWindowText(hwnd, buff, length + 1) if buff.value.startswith('Search "'): search_results = str(buff.value) return False return True EnumChildWindows(FindWindow(u'Notepad++', None), WNDENUMPROC(foreach_window), 0) def open_files(): try: file_list = re.findall(r'(C:\\.*)(?: \([0-9] hits?\))', search_results) except: console.editor.addStyledText(Cell('\nNo search results detected', [1])) count = str(len(file_list)) if count == '0': console.editor.addStyledText(Cell('\nNo files in results', [1])) return prompt = notepad.messageBox('Open all ' + count + ' files?', '', 1) if prompt == 1: for file in file_list: if os.path.isfile(file): notepad.open(file) else: console.editor.addStyledText(Cell('\nFiles/directory not found', [1])) break app.wait_cpu_usage_lower(threshold=20, timeout=600) # wait until CPU usage is lower than 20% notepad.menuCommand(MENUCOMMAND.SEARCH_FINDINFILES) app = Application().connect(path=r"C:\Program Files\Notepad++\notepad++.exe") find_in_files = app.FindInFiles directories_list = 'list of directories' pattern = r'pattern' for directory in directories_list: notepad.menuCommand(MENUCOMMAND.SEARCH_FINDINFILES) app.find_in_files.FindWhat_Edit.set_text(pattern) app.find_in_files.Directory_Edit.set_text(directory) app.find_in_files.FindAll.click() app.wait_cpu_usage_lower(threshold=20, timeout=600) get_search_results() open_files() time.sleep(0.1) # this is needed if the prompt is removed from open_files()
  • T-SQL highlighting problem: backslash is not an escape character here

    3
    0 Votes
    3 Posts
    329 Views
    mpheathM

    @PeterAdam

    The styling looks like the SQL lexer (for SQLite3,…) which is not the correct lexer for T-SQL. The @variables are not colored as they should. Problems with escapes…

    From the Language menu, select the Microsoft Transact-SQL lexer and you may see

    t-sql.png

    Should I try to edit the langs.xml file?

    The langs.xml file in %AppData%\Notepad++ may need updating if Microsoft Transact-SQL is not in the menu. Compare it with langs.model.xml that is in %ProgramFiles%\Notepad++ .

  • Request for Comment from Regulars: Forum Reputation Limit

    13
    5 Votes
    13 Posts
    2k Views
    EkopalypseE

    @PeterJones

    I’m team Option1 as well :-D

  • 0 Votes
    5 Posts
    690 Views
    mkupperM

    @FlavioB said in New Install - How to get open files list from old install...:

    Does this work/apply also for all the open files which have not been saved anywhere yet?

    The session.xml file has all of the tabs including the ones named “new #” where # is a number.

    By default, Notepad++ backs up all tabs/files you are working on every 7 seconds into the backup folder.

    Look at @Terry-R’s reply to you as that link is to an article both finding your old session.xml file and Notepad++'s backup folder.

  • Unicode problem !

    12
    1 Votes
    12 Posts
    716 Views
    CoisesC

    @guy038 said in Unicode problem !:

    But, nowadays, with the Unicode standard and the universal UTF-8 encoding, I suppose that any computer language should handle these Unicode chars properly !

    TLDR: Unicode is hard.

    You know the joke that goes, “There’s a sort of person who sees a problem and thinks, ‘I know! I’ll use regular expressions!’ Now that person has two problems.”? One could say the same of Unicode.

    Modern Windows is natively Unicode… but it’s UTF-16. Nearly everything else (including Scintilla) that uses Unicode does it as UTF-8.

    And most programming languages — as well as most regular expression implementations! — think of “characters” as fixed-length entities in memory. By choosing UTF-16, Windows at least makes handling the Basic Multilingual Plane fairly straightforward, so long as you don’t mind converting nearly everyone else’s version of Unicode to Windows’ version. OK for short strings… not so good when you have megabytes or gigabytes of file data.

    C++ had some limited Unicode-related functions in its standard library, but has now deprecated even those and just says one should use an appropriate library.

    Even if you’re willing to convert to UTF-32 (which means quadrupling the storage requirements of ASCII characters), so that every Unicode code point is the same size in memory, not all Unicode characters are a single Unicode code point. The complexity just keeps increasing, and increasing… the hope that Unicode would “simplify” using all the world’s scripts has not exactly been realized.

    When I wanted to incorporate Boost.Regex directly into my Columns++ plugin, I first thought to use its Unicode facilities. Then I saw that while Boost.Regex is a header-only library (if you don’t know C++, read that as “easy to include in a project without changing the way the project is structured”), its Unicode facilities require ICU4C — and if there’s any simple, straightforward way to incorporate that monstrosity into an otherwise simple, straightforward project, I couldn’t find it. I settled for the same “hack” that Notepad++ itself uses: convert UTF-8 to UTF-16 on the fly, use Windows’ support of UTF-16 where needed, and let the chips fall where they may for anyone bold enough to use combining characters or characters outside the basic multilingual plane.

    Unicode is so complex, so full of details (What characters are “the same” when you ignore case? Well, that depends on the current locale…), that support is a project in itself, and attempts to be reasonably complete (ICU) are gigantic and constantly being updated.

  • 3 Votes
    21 Posts
    9k Views
    PeterJonesP

    @PeterJones said in Guide: How to correctly check for available Notepad++ updates using your web browser::

    Yeah, I would vote for “FAQ” rather than “FAQ Desk” too. And I’m the one who started the “FAQ Desk” nomenclature. I originally thought it was a good idea, especially when there was no FAQ category, to indicate that this was the answer to the FAQ (“you’ve been sent to the FAQ Desk to find the answer to your question…”). But in the intervening time, I’ve liked that nomenclature less.

    And yet, 4.5 years later, I still hadn’t changed those prefixes. But I finally found the elusive Round Tuit™ today, so all the FAQ entries are now listed as “FAQ: …” rather than “FAQ Desk: …”

    And while I haven’t renamed the section, I am perfectly happy to put Guide-like entries into the FAQ (and looking back over the entries, many of the historical FAQ entries really are more of a guide than an answer to a single Frequently Asked Question).

  • CR LF line ending translation bug

    3
    0 Votes
    3 Posts
    378 Views
    Mark OlsonM

    I’d also note that if you have mixed CR and LF you can easily convert those all to CRLF with this find/replace:
    FIND: \R
    REPLACE WITH: \r\n
    Regular expressions ON
    BEFORE:
    be5003c8-89b3-497d-a3d1-f2aac078829e-image.png
    AFTER:
    3bc6fcca-3d23-45ea-ad4f-338f1842aa52-image.png

  • notepad++ store version for windows 11?

    9
    0 Votes
    9 Posts
    6k Views
    H

    I think it will be a nice idea to get it with ms store and hope to see it soon.

  • Windows .reg recognized, but no syntax highlighting? (2)

    7
    1 Votes
    7 Posts
    604 Views
    Laurie StearnL

    @PeterJones :
    Bit late to get back in order to say thank you muchly, “Registry” language looks great now.
    Quite a few /corrections changes in Langs and Stylers since 2014, PREPROCESSOR is now omitted for Java, and DIRECTIVE, DIRECTIVE OPERAND for VHDL, heck never used those. As for the changes in GlobalStyles in missing out on the pleasures of Bookmark margin, Change History margin, Document map, EOL custom color and Non-printing characters custom color, good to have them in!

    (Note to self for next time: On a manual copy only worry about the GlobalStyles in Stylers as running a weird darkish theme under “Light Mode” where the styling for ini, reg, XML CSS and the like is easy on the eye albeit a little dark.)

  • How to insert image in Notepad++

    2
    0 Votes
    2 Posts
    3k Views
  • Project Search Shortcut

    2
    1 Votes
    2 Posts
    208 Views
    Alan KilbornA

    @Max-Yaffe

    It’s been requested before and received a hard-rejection from the developer; for details, see https://github.com/notepad-plus-plus/notepad-plus-plus/issues/13256

  • Help with regular expression

    29
    0 Votes
    29 Posts
    10k Views
    guy038G

    Hi, @mark-olson and All,

    Oh…, my God : you’re a thousand times right, Mark ! Of course, negative class character like [^...] does not depend at all on the status of the . matches newline option, nor of the possible leading modifiers (?s) and (?-s). I should have remembered that !

    Indeed, place this simple text in a new tab :

    Test in order to verify the maximum range of characters matched by the regex expression

    And use, for example, any of the regexes below :

    With the . matches newline option unchecked

    - SEARCH [^=]+.+[^=]+ - SEARCH (?-s)[^=]+.+[^=]+ - SEARCH (?s)[^=]+.+[^=]+

    With the . matches newline option checked

    - SEARCH [^=]+.+[^=]+ - SEARCH (?-s)[^=]+.+[^=]+ - SEARCH (?s)[^=]+.+[^=]+

    You can easily verify that, whatever the regex used, all text, from the very beginning to its very end, is always matched !

    Remark :

    In fact, as the in-line modifiers override the . matches newline option, there are only four distinct cases :

    SEARCH [^=]+.+[^=]+     with the . matches newline option unchecked

    SEARCH [^=]+.+[^=]+     with the . matches newline option checked

    SEARCH (?-s)[^=]+.+[^=]+

    SEARCH (?s)[^=]+.+[^=]+

    Thus, in my previous post, I should have expressed myself :

    May be, the fact, that a negative class character is used ( [^ ...] syntax ), led to the The complexity… message ??

    Best Regards,

    guy038

  • Mark lines with blue balls and jump between them

    15
    0 Votes
    15 Posts
    8k Views
    Alan KilbornA

    @guy038 said in Mark lines with blue balls and jump between them:

    Thus, Alan, could you show us, by screenshots, the first steps to do ?

    I could (and will if you really want it), but I suspect that Windows has diverged so much in what it looks like (around the world) that doing so is of dubious value. I think it has already been shown (to me) how different your (admittedly Win10) setup appears.

    Conclusion : I can’t remember, for sure, of the set of actions really done !

    Yes, it does seem to get confusing in a hurry! :-)

    when you hit the Ctrl + shift + 0 shortcut, after some consecutive Ctrl + 0 hits, the caret move, first, from the end of current marked word to its beginning, then move back to the beginning of previous word and so on… !

    And that’s how it is supposed to work, correct?

  • 0 Votes
    4 Posts
    290 Views
    Luis Piña IIIL

    Thank you both. I don’t know why I didn’t see the option yesterday.

  • How to Enable Strikethrough feature

    5
    1 Votes
    5 Posts
    14k Views
    mkupperM

    @Simanta-Sarkar

    This forum includes an article, FAQ: “Notepad++ is a Text Editor, not a Word Processor”, that goes into this.

    Many of the comments on the superuser and stackoverflow links you provided are saying the same thing. That said, people can coerce Notepad++ into behaving where some of the markdown syntax displays in ways similar to how they would display if you had a full markdown processor.

    Part of the problem within Notepad++ is that it does not support the concept of a preview window. Many people have asked for this, mainly so they could type HTML and instantly see the results. These requests/suggestions have always been rejected as Notepad++'s focus is the underlying text that then may be processed by other applications such as a web browser or markup/markdown processor to render the text into what end-users see. Notepad++ is not supposed to be a WYSIWYG editor.

    That all said, it’s cool to see that Notepad++ can be coerced into displaying strikethrough or strikeout text.

  • Semi-space in NP++

    18
    0 Votes
    18 Posts
    2k Views
    JamesWebbJ

    @ guy038

    You just have to create a new macro

    Thank you for providing the macro. The solution was already present, but I wasn’t aware of it.
    View menu>Show Symbol submenu> turn off Show Non-Printing Characters

  • What is reputation?

    3
    0 Votes
    3 Posts
    342 Views
    PeterJonesP

    @freezer2022 , @_ ,

    I’ve put in a feature-improvement request with the NodeBB folks. They have agreed that they will fix NodeBB software so that @-mention and the automatic reply links will not count for the “links require 1 reputation” restriction.

    After the updated NodeBB is released, we’ll try to get our NodeBB-instance updated so it has that fixed feature, so then hitting “reply” will work without 0-reputation users having to delete stuff that’s automatically put in the post.

    Sorry for the inconvenience, but it’s a constant balance between ease of use and fighting spam links. The user experience on this aspect should improve again in the near future.