Categories

  • Announcements regarding our community

    341 Topics
    5k Posts
    andrecool-68A
    @donho The portable version 8.9.9-8.9.9.1 of Notepad++ creates empty directories C:\Users\Uzzer\AppData\Roaming\Notepad++\plugins\config For example, my old portable version 8.8.5 of Notepad++ does not create such empty directories.
  • Frequently Asked Questions and Guides (about Notepad++ and this Forum)

    38 Topics
    64 Posts
    PeterJonesP
    Corrupted Session Starting in Notepad++ v8.6.5, it will store session.xml.inCaseOfCorruption.bak next to session.xml, and will automatically use that if session.xml is corrupted. However, if you ever find that you open Notepad++ (especially after an update or a system crash) and find that the files opened weren’t in the same state as when you let them, you can try this procedure: Exit Notepad++ Windows Explorer, go to %AppData%\Notepad++ (or in your appropriate config-file location if you aren’t using AppData for config) Rename session.xml to session.xml--keep Copy session.xml.inCaseOfCorruption.bak to session.xml Run Notepad++ → If it’s now showing the right copy of your files, great! If not, exit Notepad++, delete session.xml, and rename session.xml--keep back to session.xml .
  • Notepad++ discussions that don’t fit in other Categories

    5k Topics
    23k Posts
    J
    Greetings, everyone! I recently discovered this post when I was looking for a way to bookmark the class line number at the top of the file and this helped me a lot. However, I wasn’t satisfied and I wanted to upgrade it to have those bookmarks / shortcut links in a side panel but I didn’t know how and if it was even possible to create a panel with PythonScript plugin. So I discovered this jN Notepad++ plugin that enables user to extend the Scintilla interface with JScript / Javascript wrapper and I came up with this with help of AI: (function () { // Removed trailing $ so \r\n line endings from view.lines.get(i).text never block a match var COMMENT_REGEX = /(?:\/\/|<#|#|\/\*|--)\s*(TODO|FIXME|BOOKMARK|SECTION):?\s*([^\r\n#*]*)/i; var dock = null; var listContainer = null; function jumpToLine(lineIndex) { var view = Editor.currentView; if (!view || lineIndex >= view.lines.count) return; var maxLine = view.lines.count - 1; var screenOffset = 35; view.line = 0; view.line = Math.min(maxLine, lineIndex + screenOffset); view.line = lineIndex; } function refreshBookmarks() { if (!listContainer || !dock) return; listContainer.innerHTML = ""; var view = Editor.currentView; if (!view) return; var count = view.lines.count; var found = 0; for (var i = 0; i < count; i++) { var lineText = view.lines.get(i).text; var match = COMMENT_REGEX.exec(lineText); if (match) { found++; var tag = match[1].toUpperCase(); var desc = (match[2] || "").replace(/</g, "<"); var item = dock.document.createElement("div"); item.className = "bookmark-item"; item.innerHTML = "<span class='tag'>[" + tag + "]</span> "+"<span class='line-num'>Line " + (i + 1) + "</span><br />"+"<span class='icon'></span> " + "<span class='desc'>" + desc + "</span>"; (function (targetLine) { item.onclick = function () { jumpToLine(targetLine); }; })(i); listContainer.appendChild(item); } } if (found === 0) { listContainer.innerHTML = "<div class='empty'>No special comments found.</div>"; } } function showSidebar() { if (dock) { dock.visible = true; refreshBookmarks(); return; } dock = Editor.createDockable({ name: "Comment Bookmarks", docking: "right", onbeforeclose: function () { dock.visible = false; return false; }, onclose: function () {} }); var doc = dock.document; doc.open(); doc.write( "<html><head><style>" + "body { font-family: Segoe UI, Tahoma, sans-serif; font-size: 12px; margin: 0; padding: 6px; background: #f5f5f5; }" + ".toolbar { margin-bottom: 6px; }" + "button { width: 100%; padding: 4px; cursor: pointer; }" + ".bookmark-item { padding: 5px 6px; margin-bottom: 4px; background: b; border: 1px solid #ddd; cursor: pointer; }" + ".bookmark-item:hover { background: #e6f2ff; border-color: #99caff; }" + ".line-num { color: #666; font-weight: bold; }" + ".tag { color: #0066cc; font-weight: bold; }" + ".empty { color: #888; font-style: italic; padding: 8px; }" + ".icon { display: inline-block; width: 12px; height: 12px; vertical-align: middle; margin-right: 4px; background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFBSURBVChThVK/S8NAGH25RiimdBARQRAcHHTSUQpO/gVODv4XWgIWm6GpVgo1WHBwdhRRN1dHi0uWOiloqTa0wVC4/uJ6XuJFghF98PHd3ffe9x33TrFtm09qGgAuQhERQuzDI5n7vT6UluPwVCD4H5RSkGhPH4wxFPaOUC2dBuufIP60EGPOYehF1G88zLgrqJgnMdH3BC7I+WwBD9ce3mgTt/dJTHUysMyqaDSWLCGQGbs7ZVyca2B8FfOpJaS5iqc6wePdBoq5M8mKCBgbgA5ddIcM73QRc+kPdGgSXvsZbOBJVkRQOc5haxtQ2ZW4UgPtro1R7xIL6zXky1nJiggIIShZBaxtLmNWfUHTbWE6M8KBZQS1EIojfNAiPvivYugmVDKB/UMdiURCVr58iAn+QiB4bTR+dZrHvgrQoxSfR8eMDpy8I5cAAAAASUVORK5CYII=') no-repeat center center; color: #0066cc; font-size: 11px; margin: 0 2px; }" + "</style></head><body>" + "<div class='toolbar'><button id='refreshBtn'>Refresh List</button></div>" + "<div id='list'></div>" + "</body></html>" ); doc.close(); listContainer = doc.getElementById("list"); doc.getElementById("refreshBtn").onclick = refreshBookmarks; refreshBookmarks(); } function insertBookmarkAtCursor() { var view = Editor.currentView; if (!view) return; var path = (view.files && view.files[view.file]) ? view.files[view.file].toLowerCase() : ""; var prefix = /\.(ps1|psm1|psd1|py|sh|yml|yaml)$/.test(path) ? "# " : "// "; view.selection = prefix + "BOOKMARK: "; refreshBookmarks(); } var menu = Editor.addMenu("Comment Bookmarks"); menu.addItem({ text: "Show Comment Bookmarks", cmd: showSidebar }); menu.addItem({ text: "Insert Bookmark Comment at Cursor", cmd: insertBookmarkAtCursor }); // Use setTimeout (300ms) instead of addIdleHandler so Notepad++ finishes loading UI and tabs first System.setTimeout({ millis: 300, cmd: showSidebar }); Editor.setListener({ BUFFERACTIVATED: function () { if (dock && dock.visible) refreshBookmarks(); }, FILESAVED: function () { if (dock && dock.visible) refreshBookmarks(); } }); })(); This basically creates a side panel (Dockable) and traverses the document to find comment lines beginning with specific strings such as: • // BOOKMARK: name of bookmark • # SECTION: name of section • /* TODO: name of todo */ • – FIXME: name of fixme before #, //, /*, – you can write whatever you want because regex is searching for those characters + space and then matches whether KEYWORD + colon used after, Note: every subsequent space character between comment start character and KEYWORD don’t matter as long as KEYWORD is in same line. Same goes for the spaces between KEYWORD: and the name of the Shortcut. Here are some screenshots: [image: 1795537210575-1.png] [image: 1795537230312-2.png]
  • 10k Topics
    55k Posts
    PeterJonesP
    @DanielCollins said: if you only need it occasionally. In the Find dialog, set Search Mode to Regular expression and write each accented letter as a small character class, for example Rene as R[eéèêë]n[eéèêë] (and add the capital variants at the start if the name can be capitalised). If it’s just occasional then use @coises solution from the very first reply : [[=r=]][[=e=]][[=n=]][[=e=]] … That doesn’t require you to know every possible accented variant, nor need to remember that n can be accented, too, which you forgot. Just manually put the brackets and equals around all the characters.
  • Technical discussion of building or contributing to Notepad++ or Plugin codebases

    1k Topics
    9k Posts
    guy038G
    Hello, @coises, @thomas-knoefel and All, For some obscure reasons, one day, my usual USB key for tests was just considered as containing RAW text. I did not even succeeded to reformat it ! So I threw it in the trash and from a ( not too old ) copy of that key, I was able more or less, to reconstruct the original contents of this USB drive ! Now, when I asked Google about “softwares able to search canonical and compatibility Unicode characters”, the IA answer, at the beginning, proposed, among other things, the CLI software ripgrep (rg). Although it does not seem to really treat canonical and compatibility Unicode forms AFAIK, it is quite fast and has plenty of interesting options ! Refer to https://github.com/BurntSushi/ripgrep. The last release is version 16.0 . Download, preferably, the ripgrep-16.0.0-x86_64-pc-windows-msvc.zip archive which is compatible with 64-bit Windows 11 laptops After extraction of the rg.exe software, in a CMD window, run rg -h for short descriptions or rg --help for more details ! Following my usual procedure, I searched for any file, including binary ones as well, of my new USB key, the string Fi, with this exact case, in regex mode and I got these results : Search "Fi" (32 189 hits in 624 files of 1 119 searched) [RegEx: Case] with native N++ v8.9.9.1 Search "Fi" (32 189 hits in 624 file(s)) [1 119 file(s) searched] with MultiReplace v6.2.0.38 32 189 matches in 624 of 1 118 files (Regex, match case): Fi with Search++ v0.8 (x64) And running the DOS command "rg -a --stats Fi", it displayed, at the end : 32189 matches 24492 matched lines 624 files contained matches 1118 files searched 12462212 bytes printed 498369521 bytes searched 0.173930 seconds spent searching 0.573693 seconds total As you can see, the count of matches and the files concerned are identical for these 4 tests However, the number of files analyzed varies : 1,119 for N++ and MultiReplace 1,118 for Search++ and rg.exe I figured out why ! On my D: key, I have only : One directory which is hidden : System Volume Information One file which is hidden : Thumbs.db As the Hidden folders option was unchecked, N++ and MultiReplace did not consider the folder System Volume Information but did take in account the Thumbs.db file ! Whereas, the Search++ plugin and the rg software did not consider, both, hidden files AND folders. Thus, it did not analyse the Thumbs.db, as well ! Consequently, @coises, I suppose that you have enough place to modify the label of the option from Hidden files to Hidden files and folders. Alternatively, you could also decide to add a new option Hidden folders. Do as you like ! Now, I ran the same tests again, on txt files ONLY and there are the results : •==============•==========•========•===========•===============•===============•==========================• | Software | Hits | In | Scanned | First Time | Second Time | Command | | / Plugin | | Files | Files | After Restart | Right after | | •==============•==========•========•===========•===============•===============•==========================• | Notepad++ | 10600 | 311 | 641 | 17 s 25 " | 5 s 32 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | MultiReplace | 10600 | 311 | 641 | 11 s 80 " | 1 s 78 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | Search++ | 10600 | 311 | 641 | 16 s 94 " | 0 s 66 " | | •--------------•----------•--------•-----------•---------------•---------------•--------------------------• | rg.exe | 10600 | 311 | 641 | 16 s 69 " | 0 s 55 " | rg -a -ttxt --stats Fi | •==============•==========•========•===========•===============•===============•==========================• Best Regards, guy038 P.S. : Please note that the tests were all conducted BEFORE I wrote this post, which, obviously, modify the results !
  • Security shouldn’t be the privilege of rich people

    76 Topics
    377 Posts
    PeterJonesP
    same user also posted similar in this issue in comment in #17480
  • All the issues (publications/questions) about binary translation

    76 Topics
    480 Posts
    U
    @xomx Thank you very much for the work you have done, which will lead to improvements in Notepad++ in the future. I am very grateful to you.
  • Say fuck to Notepad++ here, and only here

    99 Topics
    572 Posts
    M
    How would you like a shortcut definition UI to be designed then?
  • No support request and bug report here, only unconditional praise and worship

    3 Topics
    9 Posts
    F
    @Maddox-Armstrong said: @FreeMeow I goon to Notepad++ :P 666还有蜥蜴人
  • Share personal tips and cool uses for Notepad++, and similar

    63 Topics
    244 Posts
    S
    That’s a clever little experiment! I never really thought about using regular expressions to represent mathematical patterns like multiples of 3, but it makes sense when you look at the binary sequence. Definitely a fun way to explore just how powerful regex can be beyond ordinary text searching.
  • Computer/Programming Jokes are welcome here

    59 Topics
    190 Posts
    Lycan ThropeL
    @xomx , Dave Bowman: "Open the pod bay doors, HAL. " HAL: “I’m sorry, Dave. I’m afraid I can’t do that.” [image: 488a3017b34fe587.png]