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
    • M Andre Z EckenrodeM

      Search++ (\W)'(\w) regex replace failure

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      40
      0 Votes
      40 Posts
      1k Views
      CoisesC
      @M-Andre-Z-Eckenrode said: With v0.6.3.2 in place, I re-ran several of the tests I’ve been doing, and found no anomalies this time, so that seems to have taken care of it. Thank YOU! Thank you. This error has been there since I first designed this regular expression search technique, in Columns++. It just apparently only shows up in rare circumstances. I’ve still never seen it. Out of curiosity, is there any kind of basic explanation you can relay in layman’s terms for why it was doing what it was doing? Notepad++ uses an open source component called Scintilla to display editable text. Scintilla maintains the text in an internal “split buffer,” meaning that there can be a gap at an arbitrary position within the text. It uses that gap to be able to make changes that add or remove characters in the middle of the text without having to copy all the following text to a new location every time there’s one small change. For a few reasons, when I implemented search, I wanted to use the same regular expression engine that Notepad++ uses, Boost.regex, but I wanted to include my own copy in the plugin and manage it directly, rather than going through the hybrid Scintilla/Boost interface that Notepad++ exposes, and I wanted to access the Scintilla split buffer directly. To do that, I had to create something called iterators. In C++, an iterator is essentially an indirect way of referencing data that has simple operations like “move to the next character” and “tell me what character you’re pointed at.” I designed iterators for UTF-8, for single-byte character set ANSI and for double-byte character set ANSI that could traverse the Scintilla buffer, mind the gap, and return the results to the Boost.regex engine as if it were seeing a contiguous string of UTF-32 Unicode characters, regardless of the actual encoding. Now, there’s a caveat when you ask Scintilla for the location of its internal buffer positions. You get two segments (because of the gap). But Scintilla warns that you can’t trust those positions once you do anything else in Scintilla, or once any user interaction is possible (even if the user doesn’t change the text). So I made sure to “invalidate” my internal pointers whenever control left my plugin: such as between finding text and changing it. In order to ask Boost.regex for the replacement string when doing a change, I have to keep a particular Boost.regex structure that references the original match, so it knows how to interpret capture group substitutions. I was careful to invalidate the buffer pointers before I called Boost.regex.format. Except… The match structure in Boost.regex doesn’t store the Scintilla character positions of the match. It stores iterators. And the iterators I designed, to be as efficient as possible, hold copies of the pointers into the Scintilla split buffer. So invalidating the pointers I use to generate iterators for Boost.regex does nothing to the iterators Boost.regex already stored in the match structure. For reasons I can’t guess, both you and your brother seem to have something about your systems that causes Scintilla to reposition the gap in its internal buffer between find and replace. It never seems to happen here, but I finally realized that my attempt to protect against that happening is ineffective. What I did to test was add a Scintilla call each time I invalidate the buffer pointers that causes Scintilla to move everything to the beginning and put the gap at the end. That means all the iterators will have the same pointers. It’s not a good long-term solution, though, because in a large file moving the gap to the end every single time anything changes could make response sluggish. So it might take me a little while to decide on the best solution. I’m glad you documented the error so well. Now I know what to fix, I just have to work out the best way to do it.
    • PeterJonesP

      [BETA] Upcoming Plugin: HiddenLexers

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      15
      1
      2 Votes
      15 Posts
      673 Views
      PeterJonesP
      Since it’s essentially working at this point, I’ve renamed the Topic to “BETA” @mpheath , I have updated the README at https://github.com/pryrt/NppPlugin-HiddenLexers to enumerate available options I think I’ll be patient, and give the beta test a while longer, so won’t try to rush to release it before N++ v8.9.8’s PluginsAdmin list is finalized.
    • Afik GilboaA

      nppftp and and windows 11

      Watching Ignoring Scheduled Pinned Locked Moved Notepad++ & Plugin Development
      4
      0 Votes
      4 Posts
      180 Views
      PeterJonesP
      @PeterJones by reset itself i mean only the plugin and i mean it revert back to the state it was when i first installed it meaning no profiles, and everything else i changed also reset. simply a TOTAL reset of the plugin. That sounds like it’s not saving its config files correctly… and here is the debug info: … Admin mode: ON So this might be one thing: if you sometimes run as Admin and sometimes as normal user, config files can get their permissions messed up, which might be a culprit. In modern Notepad++, unless you are almost always editing files from the Program Files or Windows folders, there is no good reason to run As Admin consistently – as a normal run of Notepad++, if you try to save a protected file (files in Program Files, Windows, etc), Notepad++ will ask the OS, and the OS will prompt you with the elevated UAC permission to write the protected file. So unless you are saving a file to that location often enough that the UAC prompt every save becomes annoying, don’t run as Admin. Cloud Config: C:\Users\אפיק גלבוע\Documents\NppSettings Hmmm… there might be two things there, as well. First, I don’t know whether the NppFTP plugin was written with good support for Unicode characters in path names. So it might not be able to write its config to a directory like that. Second, I don’t know if NppFTP was properly written to make use of Cloud Config. If it’s using NPPM_GETPLUGINSCONFIGDIR, then it should be getting the right location, but if it’s incorrectly manually figuring out the plugin settings directory relative to AppData, it might not be computing the right path, so it might be trying to save its config in the wrong place (maybe even to a non-existent location) Look in C:\Users\אפיק גלבוע\Documents\NppSettings and see if there is an NppFTP subdirectory there. If not, then likely one of those two problems has occurred. If there is, then look at the permissions of that directory and the NppFTP.xml in it, to make sure that both your normal user and your elevated Admin have permission to write to it.
    • F

      Compare Plus (and Compare) plugins hanging

      Watching Ignoring Scheduled Pinned Locked Moved General Discussion
      3
      0 Votes
      3 Posts
      218 Views
      F
      @PeterJones said: You also mentioned “uninstalling the plugins and reinstalling them” – that sounds like you have both plugins installed at the same time. I highly doubt that it’s a good idea to have both Compare and ComparePlus installed on the same instance. Sorry, I only have Compare Plus installed now - so I tried uninstalling and re-installing it to see if it was fixed. Both are not installed. As far as I can tell, neither Compare nor ComparePlus has a “cancel” action. They have a “Clear Active Compare” action. Are you saying that you hit that “Clear Active Compare” button while it’s still working on making the comparison, to stop it in the middle? Or do you just mean that you are clearing the comparison once it’s done? I am hitting this cancel button to stop it in the middle of working; [image: 1786224004669-97162e74-5601-4918-b18e-1dfa20830fa5-image.jpeg] But with normal usage (telling it to compare, looking at the results, clearing the active compare), I have never gotten to the point that the plugin just hangs indefinitely. If you have a pair of files (with no private information) that you can get to cause the hang reliably, and can explain, in detail, the procedure that you use to cause the freeze, then I would recommend that you create an issue at the plugin’s GitHub repo so that you can let @pnedev know about the problem. I will do this - although I suspect it will not reproduce since these same files worked at first for me too. Thank you…
    • G

      Folder as Workspace not listing full content of folder (v8.9.7)

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · · faw
      3
      1 Votes
      3 Posts
      171 Views
      G
      @PeterJones Okay, yes, there are several subdir in that folder that are links (issue #18248). Actually, the first subdir is a plain one and is displayed whereas the second one is a link and is not displayed while preventing the display of the remaining data. I’ll give the RC a try. Thanks again.
    • P

      Remove lines starting by...

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      2
      0 Votes
      2 Posts
      66 Views
      PeterJonesP
      @Passant-Delarue , Initial guess: turn off “. matches newline”, otherwise your .* will greedily match the whole file.
    • Leon MeijerL

      Text selection color is gone since a few updates

      Watching Ignoring Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
      5
      0 Votes
      5 Posts
      920 Views
      PeterJonesP
      @Krzysztof-Blachnicki said: I deleted ExtSettings.ini (which was 0 byte) and… It works again. Maybe it’s n++ fault, but… For other plugins settings aren’t gone and when files are 0b they don’t cause glitchy behaviour. I’d bet it’s rather a problem with this particular plugin. If deleting the ExtSettings.ini caused the problem to go away, then I am confident it is the plugin, not Notepad++ itself, that is the culprit. The question is what now? Whom I can ask for reaction? Report the problem to @dinkumoil , the author of the plugin => https://sourceforge.net/projects/extsettings/support
    • K

      Ultimate editing package? No, but close.

      Watching Ignoring Scheduled Pinned Locked Moved Praise Notepad++
      1
      0 Votes
      1 Posts
      66 Views
      No one has replied