• 0 Votes
    5 Posts
    1k Views
    CoisesC
    @Dennis-Bulgrien said: Workarounds: If you’re up for something experimental, you can try my Search++ plugin. (Discussion thread here.) Select Plugins | Search++ | Search in Files… then set Filter to Reg. Exp. and enter: ^([^\\]++\\)?[^\\]++$ in the Filter box.
  • Search++: A work in progress

    Notepad++ & Plugin Development
    149
    6 Votes
    149 Posts
    47k Views
    CoisesC
    I had written: In the main search dialog, when the default action is active for a button (e.g., Find, Count, etc. without a scope qualification like “in Selection” or “in Marked Text”), somehow indicate what the default action would be if you pressed the button right now. That is, Find adapts to work in selection if you have a selection large enough, or in marked text, or in the whole document, but what will it actually do right now? This feels like a big missing thing to me, but I’m a bit stumped as to how to indicate it. If a put a general indicator somewhere (it will always be the same for all buttons with default scope), where, and how should it appear? I am very hesitant to take up additional space in the dialog, or to make it any more “busy” than it already is. If I show it on each button, how would I distinguish it from the marker that tells you the direct action for the button is a command with a specified scope? (Remember, this has to work for any dark mode color combination the user might pick, and some users are colorblind.) Would it be better to show it on the buttons and remove the ability to select an action with other than default scope as the action for a button by shift-clicking the drop-down menu? Does anyone even realize they can shift-click the drop-down menus (the only way to know is to do it by accident or read the help)? @guy038 wrote: Personally, I’m rather in favor of your last point. That way, we would know exactly which operation has just been performed, and it would be really helpful when pressing the Search button , at the rightmost zone of the Search++ panel — which would clearly indicate whether we’ve selected and run : a list, a selection, a mark, or just the results of a search ! and later, @guy038 wrote: I do know about using the Shift key and a click on any drop-dwon menu. However, what is your general feeling about my reply : any operation would be clearly identified and affecting a default option would not been anymore mandatory ?! While I was writing this, you clarified what you meant, and I responded to that. What I was attempting to describe is related to the problem you encountered when you did a default Show search and nothing happened. The reason was because the previous Show caused text to be marked, so when you did a new default Show, it was searching within the marked text, though you meant to search the whole document. That’s what “default scope” does: it might search selected text, it might search marked text, or it might search the whole document, depending on your settings and whether text is marked, or enough text is selected, at the time. What bothers me is that before you click the button, it’s not obvious what the current default scope will be. Maybe you forgot you had text marked. Maybe you thought your selection was over the minimums you had set in Single selections must have at least:, but it was actually a couple characters short. You could still do what you meant to do by selecting from the drop-down menu, but you might not realize that you need to use the drop-down; then you’re left puzzled by why the results were not what you expected. I’ve hit this trap myself, and I wrote the damn thing! One possibility is that my “default scope” concept is just fundamentally flawed. Maybe the user should have to indicate, each time, whether the intent is to search the whole document, search in selected text or search in marked text. Yet I fear adding that many buttons, or using some fancy, non-standard divided buttons, would make an overly busy and confusing interface; while using modifier keys or having to use the drop-downs for everything but whole document searches would be clumsy and annoying. So I’m trying to think how I can give a visual cue as to what the “default scope” is before you click the button; that way, if it isn’t what you expected, you’ll know to use the drop-down instead (or change your selections or marks). The problem then becomes, if I add a scope indicator that changes with conditions, how do I do it? The first idea I listed was a bad one. A common indicator would be in the wrong place (that is, not where you’re looking when you go to click a button), and I was wrong about it always being the same, since the unchecked states of Allow default Select command to Select in Selection and Allow default Mark command to Mark in Marked Text exclude certain scopes from those commands only. The second idea makes more sense: put the indicator on each button, letting it change as conditions change. The problem is, how would I distinguish that from the scope indicators that appear if you Shift+click the drop-down menu and select a command that does not use default scope (like “Find All in Whole Document”)? You wouldn’t (easily) know when you had selected a command with fixed scope and when you had a default scope command, except by noticing whether it ever changes when you select or mark text. The third idea questions whether being able to set a non-default scope command as the one-click command for a button is worthwhile at all. If you can never do that, then there is no problem with confusing the meaning of the scope indicator on a button: it would always mean that is the current scope of the default scope command, since other commands could not be assigned as the one-click action for a button. I don’t like any of my ideas. (For that matter, I don’t like my scope and extent icons, either. The arrows are OK, but as for the rest, I tried everything I could come up with and I still think they’re obscure, confusing, ugly and hard to read.) So I guess I was hoping someone might come up with an idea I like better than my own. Or say something that would lead to me coming up with a better idea than the ones I’ve had so far.
  • 1 Votes
    4 Posts
    2k Views
    D
    It never inserts the text at the caret’s position for me: it either moves up a line and/or replaces the existing text. What am I misunderstanding?
  • 0 Votes
    2 Posts
    66 Views
    PeterJonesP
    @Allinmyhead , Notepad++ has no notion of “post”. It just sees a big blob of text, and tries to apply the search string you give it. If you search for just your username, that’s the only piece that will match. If you use a more complicated regular expression (“regex”), you can define a fancy search that will match more. If you gave more details about what a “post” is formatted in text, we could help you come up with the right regex. For example, if the post is username: blah blah blah [newline][newline], then something like ^username: .*?\R\R would find everything from username: to the two newlines in a row. But Notepad++ is not just going to “hide” everything else, and allow you to look at just that. As you do each Find Next, it will just highlight the entire match. It might be possible, if you gave us examples of what this file would look like, to be able to strip out “posts” that aren’t yours, instead. (Similar to the above, but matching anything but your username at the start of the post). But until you give us example data that matches your formatting, and show which posts you’d like to keep and which to delete, there is no way we could randomly come up with the right regex to help you. Click the </> button in your reply. Put some data in the code-box that creates. Make sure the data matches your actual data, and is formatted exactly the same. Indicate which “posts” you’d like to keep vs delete. Make sure you give us a description of how you, as a human, would recognize where one post starts and ends. Update: it might actually be easier to use the Mark dialog to mark all the username posts, rather than the find/replace to delete the non-username posts. That would allow “copy marked lines”, and then the username-only ones could be pasted in a new file, rather than deleting the non-username posts from the original. But it depends on the shape of the data, and whether you’d prefer to just delete from your old file or create a new one…
  • Notepad++ release 8.9.8

    Pinned Announcements
    24
    6 Votes
    24 Posts
    6k Views
    PeterJonesP
    @GrobiDev , I assume you are using scoop, or some other package manager that uses junctions in the path to Notepad++. v8.9.8 introduced an issue where that will not work. It has already been fixed in the codebase, so the next version will not have that problem (release candidate for v8.9.8.1 should be soon). In the meantime, you can go back to v8.9.7
  • wireloom in markdown viewers

    Notepad++ & Plugin Development
    7
    0 Votes
    7 Posts
    335 Views
    rdipardoR
    @Keith-Collyer said: I ended up adding a request to the markdig library here: https://github.com/xoofx/markdig/issues/952 👍
  • [New Plugin] MultiReplace

    Notepad++ & Plugin Development
    81
    3 Votes
    81 Posts
    85k Views
    Thomas KnoefelT
    MultiReplace 6.1 is out and will land in Plugin Admin with the next Notepad++ release. The focus of this release is Replace All in One Pass, running the whole list in a single left-to-right sweep instead of one full pass per entry, together with a reworked Find/Replace in Files and a handful of list and UI improvements. Several new options live under Plugins > MultiReplace > Settings. Download: Latest build Key Features & Improvements Replace All in One Pass: Runs the whole list in a single pass instead of one full Replace All per entry, so results build on each other left to right. With cat → dog and dog → cat, sequential mode turns “cat dog” into “cat cat”, one pass turns it into “dog cat”. Much faster on large documents. Toggle per tab, right-click the list tab. Use Open Documents: Find/Replace in Files can now work on files already open in Notepad++ as the live document, unsaved changes included, instead of the copy on disk. New checkbox in Settings. Skip Binary Files: New option for Find/Replace in Files (on by default), same detection as ripgrep and VS Code. Also adds UTF-16 detection without a BOM, and skipped files are always reported, broken down by reason. CSV Header Rows: Find/Replace now always searches header rows too. “Header rows to exclude” only protects sorting and duplicate detection. Collapse to File List: New Search Results dock option folding every search block down to just file names and hit counts. Ctrl/Shift-click works in the fold margin, same as Notepad++'s own Search Results panel. Library Mode: “Keep list always visible” can now be switched right from the Use List button’s context menu, no detour through Settings. Add New Row: Takes over the dialog’s current search options instead of starting all off. Find/Replace text still starts empty. Duplicate Row Reporting: A list row that exactly duplicates an earlier enabled one is skipped as before, but the status line now tells you how many rows were skipped. [image: 1789296944806-e15a9d23-6db6-4411-a694-d44fc95300e5-image.jpeg] Issues or suggestions: GitHub. Happy replacing!
  • SetFirstVisibleLine not working?

    Notepad++ & Plugin Development
    10
    0 Votes
    10 Posts
    2k Views
    PeterJonesP
    @peter-wall said: It works if that setting is off. It works, full stop. You just need to understand the documentation. As ScintillaDoc says for SCI_SETFIRSTVISIBLELINE, “These messages retrieve and set the line number of the first visible line in the Scintilla view. The first line in the document is numbered 0. The value is a visible line rather than a document line.” (emhasis added). The “document line” in Scintilla is the same thing that Notepad++ numbers in the line number column: it’s the real line, no wrapping. The “visible line” is affected by hiding lines and/or wrapped lines: if you have lines hidden in the document, that can decrease the visible line index relative to the document line number; if you have lines wrapped, that can increase the visible line index relative to the document line number. Scintilla has commands like SCI_VISIBLEFROMDOCLINE and SCI_DOCLINEFROMVISIBLE to help transform between the two concepts, and SCI_WRAPCOUNT will help you determine how many visible lines a single document line will become. If you want to turn word wrapping off, set your visible line, then reinstate word-wrapping, that’s fine; but the Scintilla messages provide other ways to allow you to correctly handle visible-line vs display-line.
  • Set or change the default font in NP++

    General Discussion
    3
    0 Votes
    3 Posts
    201 Views
    PeterJonesP
    @Charles-Billow said: I see how to change fonts etc. for the document I am working on, but how do I change the default font/size/ and zoom level as the default for all new documents? The way you phrased that makes me think you might not understand what a text editor is. Text files are stored as the raw text: no individual text file / text-based-document has any concept of its own font or font-size. It is just text, and it is up to the text editor to decide what font or size to use. If you set Notepad++ to use a specific font or font-size, using the dialog that @markusbodensee shared with you, that will affect how Notepad++ displays it, but MS notepad.exe or VS Code or gvim will all use their own font and size, because it’s up to the app, not the file, what font and size to display text in. If you’ve changed the font and size that’s used “in the current document” in Notepad++, you’ve changed the font and size for all documents, new or old, in Notepad++. As far as Zoom level goes: Notepad++ remembers your previous zoom when you exit. But if you’ve set a reasonable font size as your default, then zoom should normally be at 100% (which is the default if you haven’t zoomed in or out yet). If you’re to the point that you start thinking you want to have the default zoom bigger or smaller than 100%, then think to yourself: do you really mean that you should change the font size bigger or smaller, instead? (Then again, some people are still killing trees from their text editor, so if you’re printing to paper, maybe you have one of the few use cases where it makes sense to use a smaller font but larger zoom, or vice versa.)
  • 0 Votes
    11 Posts
    449 Views
    B
    @PeterJones Thank YOU so much I copy Your overrideMap & udl_markdown in my folder and problem is solved. I wish program by default have this option. Thank you again dear Peter
  • [New plugin] Smart Math

    Notepad++ & Plugin Development
    6
    1 Votes
    6 Posts
    979 Views
    Vitalii DovganV
    Now the plugin supports the Dark Mode by means of “SmartMath_Dark.udl.xml” (in addition to “SmartMath.udl.xml” which is the light one) and automatically applies either light or dark one. This is achieved by listening to NPPN_DARKMODECHANGED and requesting NPPM_ISDARKMODEENABLED to understand whether the dark UDL or the bright UDL to apply. A screenshot: [image: 1788983575005-055b172d-4091-4e16-a090-23e678758707-image.jpeg] Feel free to propose better colors if you are good in that :) The UDLs are here: https://github.com/d0vgan/npp-smart-math/tree/feature/powerful-calc/Notepad%2B%2B/userDefineLangs
  • rename files

    General Discussion
    3
    0 Votes
    3 Posts
    178 Views
    guy038G
    Hello, @francisco, @gerdb42 and All, There are plenty of solutions ! The following one will ensure that the . matches newline option will not be used even it’s checked and that the Match case option is enabled even it’s not checked ! FIND (?-si)_.+(?=\.txt) REPLACE Leave EMPTY Best Regards, guy038
  • 3 Votes
    1 Posts
    221 Views
    No one has replied
  • 0 Votes
    6 Posts
    251 Views
    CoisesC
    @Midnitecata said: @PeterJones thank you for your help, ill probably steer clear of it just out of caution, but i might look into it further should the tedious formatting inconvenience me enough to learn how to spot malicious code! thanks again!! :) Just a side note to this discussion: While you certainly can manipulate *.srt files in Notepad++ (and I do on occasion), for most purposes the free and open source program Subtitle Edit (found here on GitHub) is much easier to use. It has many functions for doing things like shifting times, identifying likely errors, and so on. Before working too hard to find a way to do something with a subtitle file in Notepad++, I recommend checking first to see if Subtitle Edit already knows how to do it.
  • Code is not working

    Help wanted · · · – – – · · ·
    4
    0 Votes
    4 Posts
    297 Views
    guy038G
    Hello, @blake-g.-barrington, @peterjones, @coises and All, Here is my version to get duplicate lines, separated by any number of lines ( whatever they are : true empty lines, blank lines or lines with text ), even zero line : MARK (?-si)^(.+)(?=(.*\R)+\1$) As said by @Peterjones, and after some tests, this kind of regex get into trouble when the bunch of lines, between two duplicate lines, exceeds 15,000 empty lines about ! Now, Let’s suppose you create this text file : first 0002 0003 0004 0005 .... .... .... 9997 9998 9999 10000 first Then the (?-si)^(.+)(?=(.*\R)+\1$) regex returns : Correct result until the number of the in-between lines does not exceed 1,600, with the message 1 match in entire file Correct result until the number of the in-between lines does not exceed 12,000, although the error message Find Invalid Regular Expression ( So F.I.R.E. !! ) occurs ! NO result at all if the number of lines is over 12,000 lines, with, of course, the error message Find Invalid Regular Expression Best Regards, guy038 P.S. : I should add that my Windows11 laptop has 32 Gb of memory !
  • adverts on download page?

    General Discussion
    6
    0 Votes
    6 Posts
    456 Views
    cosmic-hyenaC
    @PeterJones I sent him an email but got no reply. Overall I’m a bit disappointed with this. I think for all his good intentions he’s allowing a strong chance of people accidentally clicking on these malware links, Got nothing more to add. Thanks.
  • ASCII Sort Order

    Help wanted · · · – – – · · ·
    7
    0 Votes
    7 Posts
    429 Views
    L
    @PeterJones, Thank you for your considered (and considerate) engagement. I actually hesitated to respond with my comment about the 70s and 80s, pretty sure I would get what you gave, but I couldn’t resist—I’m old (83 next month). Anyway, thanks again for putting up with me. …lee
  • 0 Votes
    8 Posts
    467 Views
    rdipardoR
    @PeterJones said: If you’ve got steps that work for doing a local debug build, that would be helpful. > where cmake C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe > type .\build_gup.ps1 param ( [string]$Configuration = "Debug", [string]$Platform = "x64" ) if (-not $(Test-Path "${PSScriptRoot}\wingup\.git")) { git clone --single-branch https://github.com/notepad-plus-plus/wingup.git wingup } try { pushd "${PSScriptRoot}\wingup" $CmakeArchParam=$(if ("$Platform" -imatch "x86") {"Win32"} else {"$Platform"}) $LibPlatform=$(if ("$Platform" -imatch "Win32") {"x86"} else {"$Platform"}) cmake -S ".\curl" -B ".\curl\build\$LibPlatform" -A $CmakeArchParam ` -DBUILD_SHARED_LIBS=OFF ` -DCURL_STATIC_CRT=ON ` -DBUILD_CURL_EXE=OFF ` -DCURL_USE_SCHANNEL=ON ` -DCURL_USE_OPENSSL=OFF ` -DBUILD_TESTING=OFF ` -DUSE_LIBPSL=OFF ` -DCURL_USE_LIBPSL=OFF ` -DUSE_NGHTTP2=OFF ` -DUSE_LIBIDN2=OFF cmake --build ".\curl\build\$LibPlatform" --config $Configuration pushd vcproj msbuild GUP.sln /v:m /p:configuration=$Configuration /p:platform=$LibPlatform popd } catch { $_.InvocationInfo.PositionMessage; $_.Exception.Message } finally { popd } > powershell .\build_gup.ps1 Debug x86 # ...
  • 0 Votes
    6 Posts
    2k Views
    P
    Hi! A bit late, maybe my ZeroBasedColumn plugin could help with what you’re looking for. It makes the column numbering in Notepad++ start from 0 instead of 1. https://github.com/pasqualeambrosio/ZeroBasedColumn Hope it helps!
  • [New Plugin] ZeroBasedColumn

    Notepad++ & Plugin Development
    1
    0 Votes
    1 Posts
    110 Views
    No one has replied