Community
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics

    • All categories
    • CoisesC

      Search++: A work in progress

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      119
      5 Votes
      119 Posts
      34k Views
      CoisesC
      @guy038 said: I’m actually really surprised by Search++'s performance compared to Notepad++, especially when the search involves a complex regular expression. ( 0:16.36 vs 2:08.20 ! ) Please, note that the USB flash drive I used for my test is a fairly old one with a capacity of only 512 Mb, which may not be well-suited for multithreading and would explain the poor results with Search++ In any case, I assume you’re now confident in Search++'s overall performance ! I don’t entirely trust my own results. Why did my USB search in Search++ for the take longer than the search for a([^\r\n])[^\r\n]*b\1? Either the test data is erroneous or spurious, or Search++ is screwing up access to the USB in some way that’s causing it to “choke” and lose performance (what I suspect happened in your test). I’m still trying to work out how to avoid that happening without hurting the performance when reads are fast. To the best of my knowledge, Notepad++ is entirely single-threaded. It’s only ever doing one thing at a time. An i9-9900K can run sixteen threads simultaneously. So for CPU-heavy workloads (complicated regex searches) with lots of files, it’s not at all surprising that a multithreaded approach could be almost eight times faster. Thirteen times faster running a([^\r\n])[^\r\n]*b\1 against an SSD is pretty satisfying, though. :-) I’m probably getting additional gains from using memory-mapped I/O and running Boost::regex directly against the data the operating system maps into memory, while Notepad++ loads every file into a buffer, and from there into an off-screen Scintilla, before running the search through Scintilla’s API instead of directly with Boost::regex. It’s useful to have tests like yours. I won’t be able to test anywhere near all the situations that can occur. What happens when someone searches a OneDrive folder and not all the files are up-to-date? What happens when someone searches a drive that’s mounted over a VPN? What happens when the cat knocks the USB connector loose in the middle of a search? The worst case for all these is that the whole thing either crashes and takes Notepad++ down with it, or locks up and makes the user terminate Notepad++ with task manager — losing any unsaved work in progress. I don’t want to let that happen. I still have a lot to do to “harden” this against things that can go wrong. And that’s not even starting with Replace yet.
    • Troglo37T

      Is there a way to find both alphabets, with and without accents, at the same time, when searching?

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      9
      0 Votes
      9 Posts
      331 Views
      guy038G
      Hello, @troglo37, @coises, @peterjones, @dr-ramaanand and All, Préamble : @troglo37, on demand of @dr-ramaanand, I changed your initial title : Is There A Way To Ignore Letters With Accents When Searching? by this new title, which seems more acurrate : Is there a way to find both alphabets, with and without accents, at the same time, when searching? Thank you, @dr-ramaanand, for reminding me of this interesting post, which uses a more general, but more accurate, definition of accented characters ! Indeed, an accented character , let’s say the é character, may be described as : The character é LATIN SMALL LETTER E WITH ACUTE, of Unicode value 00E9 The character e LATIN SMALL LETTER E, of Unicode value 0065, followed with the character  ́   COMBINING ACUTE ACCENT, of Unicode value 0301 Note that, in this second form, the letter e is the main character of an \X sequence and the accent(s), coming next, are the subsequent chars of this \X sequence ! So, the macro, described in my previous post, should be changed as : <Macro name="Global Search" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?=\X)(.)|(?!\X)." /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="(?1\(\?=[[=$1=]]\)\\X)" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro> And it means that : If the current character found is a single character OR the main character of a current \X sequence, it must be replaced with the string (?=[[=$1=]])\X, where $1 represents the current char If the current character found is an subsequent character of the current \X sequence, thus an accent, it must just be deleted as its main character has been previously taken in account So, let’s consider the following French text, pasted in a new tab : C'est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l'aïeul ôta sa flûte et son bâton de son canoë C'est là, près de la forêt, dans un gîte, où régnait un grand capharnaüm, que l'aïeul ôta sa flûte et son bâton de son canoë Note that, within the first line, the accented characters are single chars whereas, within the second line, the accentued chars are unaccented vowels followed with an accent character If we apply our modified Global Search macro against a copy of the first line of this new tab, we get this regex : (?=[[=C=]])\X(?=[[='=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=à=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=p=]])\X(?=[[=r=]])\X(?=[[=è=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=o=]])\X(?=[[=r=]])\X(?=[[=ê=]])\X(?=[[=t=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=î=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=ù=]])\X(?=[[= =]])\X(?=[[=r=]])\X(?=[[=é=]])\X(?=[[=g=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=r=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=p=]])\X(?=[[=h=]])\X(?=[[=a=]])\X(?=[[=r=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=ü=]])\X(?=[[=m=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=q=]])\X(?=[[=u=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[='=]])\X(?=[[=a=]])\X(?=[[=ï=]])\X(?=[[=e=]])\X(?=[[=u=]])\X(?=[[=l=]])\X(?=[[= =]])\X(?=[[=ô=]])\X(?=[[=t=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=l=]])\X(?=[[=û=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=b=]])\X(?=[[=â=]])\X(?=[[=t=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=o=]])\X(?=[[=ë=]])\X Which does match the two lines of the new tab ! And if we apply our Global Search macro against a copy of the second line of this new tab, we get this regex : (?=[[=C=]])\X(?=[[='=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=p=]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=o=]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=ù=]])\X(?=[[= =]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=g=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=g=]])\X(?=[[=r=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=p=]])\X(?=[[=h=]])\X(?=[[=a=]])\X(?=[[=r=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=u=]])\X(?=[[=m=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=q=]])\X(?=[[=u=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[='=]])\X(?=[[=a=]])\X(?=[[=i=]])\X(?=[[=e=]])\X(?=[[=u=]])\X(?=[[=l=]])\X(?=[[= =]])\X(?=[[=o=]])\X(?=[[=t=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=a=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=l=]])\X(?=[[=u=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=e=]])\X(?=[[=t=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=b=]])\X(?=[[=a=]])\X(?=[[=t=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=d=]])\X(?=[[=e=]])\X(?=[[= =]])\X(?=[[=s=]])\X(?=[[=o=]])\X(?=[[=n=]])\X(?=[[= =]])\X(?=[[=c=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=o=]])\X(?=[[=e=]])\X Which does match, also, the two lines of the new tab ! In conclusion, this method allows you to search for a stream selection of characters, regardless of the syntax of the accented characters within that selection ! Best Regards, guy038
    • M

      macro question re:

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      5
      1
      0 Votes
      5 Posts
      119 Views
      guy038G
      Hello, @murraysobol, @peterjones and All, I corrected, in my first post to @troglo37, the spelling mistake on the word shortcuts.xml and rearranged a few lines to make my description more precise ! Of course, @murraysobol, it’s better to use the second version of my macro. Note, however, that this macro generally replaces a fairly short piece of text with a rather long string of characters ! Therefore, you may need to change a default setting in the Search section of Preferences... if the resulting regular expression becomes too long ! For example, in my last post to @troglo37, the two lines of the test contains, respectively, 124 and 135 chars and the resulting regexes contains, both, 1,612 chars ! So, go to Settings > Preferences... > Searching section. Then, in the part When Find Dialog is Invoked, move to the Max Characters to Auto-Fill Find field from Selection option and modify the default 1024 value to a greater value. Personally, I use the maximum 16383 value ! However, it’s obvious that your initial selection must be as short as possible This macro will be used mainly to get the different spellings of names or surnames ! An exemple with this INPUT text, below : Our friends Šarūnas, Đorđe, Ørjan, Paweł, Ștefania, Ángel and Uğur had already left Our friends Sarūnas, Đorđe, Orjan, Paweł, Ștefania, Ángel and Uğur had already left Our friends Šarunas, Đorđe, Ørjan, Pawel, Stefania, Ángel and Uğur had already left Our friends Šarūnas, Dorde, Ørjan, Paweł, Ștefania, Angel and Ugur had already left Now if I copy, at random, the third line of this INPUT text somewhere else, select that line and run the Global Search macro, I get this regex : (?=[[=O=]])\X(?=[[=u=]])\X(?=[[=r=]])\X(?=[[= =]])\X(?=[[=f=]])\X(?=[[=r=]])\X(?=[[=i=]])\X(?=[[=e=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[=s=]])\X(?=[[= =]])\X(?=[[=Š=]])\X(?=[[=a=]])\X(?=[[=r=]])\X(?=[[=u=]])\X(?=[[=n=]])\X(?=[[=a=]])\X(?=[[=s=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=Đ=]])\X(?=[[=o=]])\X(?=[[=r=]])\X(?=[[=đ=]])\X(?=[[=e=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=Ø=]])\X(?=[[=r=]])\X(?=[[=j=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=P=]])\X(?=[[=a=]])\X(?=[[=w=]])\X(?=[[=e=]])\X(?=[[=l=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=S=]])\X(?=[[=t=]])\X(?=[[=e=]])\X(?=[[=f=]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=i=]])\X(?=[[=a=]])\X(?=[[=,=]])\X(?=[[= =]])\X(?=[[=Á=]])\X(?=[[=n=]])\X(?=[[=g=]])\X(?=[[=e=]])\X(?=[[=l=]])\X(?=[[= =]])\X(?=[[=a=]])\X(?=[[=n=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=U=]])\X(?=[[=ğ=]])\X(?=[[=u=]])\X(?=[[=r=]])\X(?=[[= =]])\X(?=[[=h=]])\X(?=[[=a=]])\X(?=[[=d=]])\X(?=[[= =]])\X(?=[[=a=]])\X(?=[[=l=]])\X(?=[[=r=]])\X(?=[[=e=]])\X(?=[[=a=]])\X(?=[[=d=]])\X(?=[[=y=]])\X(?=[[= =]])\X(?=[[=l=]])\X(?=[[=e=]])\X(?=[[=f=]])\X(?=[[=t=]])\X Finally, if you select the 1,079 characters of this regex and open the Find dialog with Ctrl + F, you can easily verify that it matches, successively, the four lines of the INPUT text. Whaooou ;-)) Note that I could have chosen the first, the second or the fourth line, either. The resulting regexes would have matched the four lines of the INPUT text, as well ! Best Regards, guy038
    • guy038G

      An incredible 4-6 loss !

      Watching Ignoring Scheduled Pinned Locked Moved Blogs
      5
      0 Votes
      5 Posts
      257 Views
      David Brigden52D
      Seems they decided that it they couldn’t be the heroes, rhat they would be the villains.
    • Paolo LinxP

      Problem running a macro without any associated key combination

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      5
      0 Votes
      5 Posts
      258 Views
      PeterJonesP
      @M-Andre-Z-Eckenrode said: Possible v8.9.7 bug? I wouldn’t call it a bug. v8.9.7 intentionally made sure that running a Macro performed the same HMAC check as running a Run menu entry. If your PythonScript runs a menu command (either a macro or a run-menu command, especially), it would also trigger that check. Or, if you hadn’t used any of the intervening v8.9.6.2-4 subversions, then your HMAC would never have been updated, and Notepad++ would demand a single validate to your custom shortcuts, becaus of your PythonScript shortcut.
    • J

      Issues with XML highlighting text

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      6
      1
      1 Votes
      6 Posts
      245 Views
      J
      @PeterJones I was looking at style for CDATA instead of SGML, so that explains it. Thanks a lot for the help!!
    • M Andre Z EckenrodeM

      Search++ Config save prompt when exiting after multi-instance

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      4
      0 Votes
      4 Posts
      108 Views
      M Andre Z EckenrodeM
      @Coises You’re welcome, and thank YOU for promptly creating the new version, and for your plugins in general to begin with! The new one lets me exit without incurring any dialog.
    • arnaud deretteA

      User defined language - operator § not working

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      4
      1
      0 Votes
      4 Posts
      85 Views
      PeterJonesP
      @arnaud-derette said: I does not work in the operator 2 list either (or may be i need to do something more than just put § there ?) Like I said, because you want the § to not have spaces, like in parent§.D, it won’t work for you. § in operators 2 will only work if you can have spaces around the §
    • nft 3000N

      Feature Request: Parallel Processing (Multithreading)

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      14
      0 Votes
      14 Posts
      4k Views
      CoisesC
      @harry-brookes , @peterjones “the devil is in the details” And there are more details than I knew existed. The details have details. It’s easy for a naïve multi-threaded implementation to be slower than a single-threaded implementation, as was demonstrated when @guy038 ran a test of my search on a folder on a USB stick. I’m working now on improving it. It’s incredible how many ways there are to shoot yourself in the foot with multi-threading. I’ll feel validated if I can come up with something that is sometimes better than single-threaded and never worse than single-threaded. It remains to be seen if I can do it.
    • Sam FourieS

      New Feature - Lock a Tab

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      3
      0 Votes
      3 Posts
      142 Views
      PeterJonesP
      @Sam-Fourie , It’s been suggested before, as in issue #17430. The developer stated explicitly: It’s not my intesion to “lock” the document by using “Pin a document”. It’s just a way to make the documents grouped in front so users find them more easily. Checked with MS VC Studio, their behaviour is the same as Notepad++, and I think it’s the right behaviour. It works the way the developer wants, and he has rejected the suggestion to make it work the way you want. update: I’m not saying it’s not a good idea. Just that the developer (who is the final decision maker) is the one you’d need to convince. And, given that he’s already rejected the idea, you’d have to come up with something more than “I really want it” to convince him otherwise (and it would have to be posted in the issues tracker, presumably as a reply to the issue I linked, not in the user Community).
    • M

      HELP on Macros - security issue?

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      3
      1
      0 Votes
      3 Posts
      190 Views
      PeterJonesP
      User Manual has been updated: Renamed header to “shortcuts.xml Security” and includes mention of Macros as well: https://npp-user-manual.org/docs/config-files/#shortcutsxml-security added Macros Security on the macros page: https://npp-user-manual.org/docs/macros/#macro-security added a paragraph linking to the “shortcuts.xml Security” page in the Running External Commands page: https://npp-user-manual.org/docs/run-menu/#security-is-your-responsibility
    • Bo ChenB

      Notepad++ has a Reload false alarm / bug? "This file has been modified by another program. Do you want to reload it"? even when it hadn't been recently modified at all?!

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      37
      1 Votes
      37 Posts
      24k Views
      G
      For anyone who wants to get rid of that annoying “This file has been modified… Do you want to reload it…” prompt/dialog box, do the following: Go to Settings Click Preferences Click MISC. Under “File Status Auto-Detection” click Disable from the drop-down menu Close
    • donhoD

      Notepad++ release 8.9.7

      Watching Ignoring Scheduled Pinned Locked Moved Announcements
      6
      2 Votes
      6 Posts
      4k Views
      PeterJonesP
      @donho, Based on HELP on Macros - security issue? and Problem running a macro without any associated key combination, I would say that the Security Warning dialog needs to be slightly more explicit: now that the warning occurrs for both Run menu entries and for Macro menu entries, the message should change use “Validate shortcuts.xml” from the menu to confirm it to use “Validate shortcuts.xml” from the Run menu to confirm it, so that users can find that menu entry, whether they see the message from trying to do a saved Run command or a Macro.