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
    CoisesC
    @sevem47 said: I think there is a small visual glitch in search/replace history Yes, that is an error. Thank you for catching and reporting it! I will find the cause and fix it.
  • 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]