Did I break NPP?
-
@lycan-thrope said in Did I break NPP?:
which brings me back to the possibility that there is something going on where spurious characters are being inserted that (AFAIK), I didn’t introduce.
My guess is fat-finger syndrome / PEBKAC (typing characters you don’t notice, or not selecting the text you thought you did when copy/pasting, or having macros that do more than you think they do). You said in an earlier post, “I’m starting to wonder if frequent copy/paste ops tend to freak the system out”, and I disagree with that assessment vehemently. Copy/paste is simple for a text editor to implement, and I have never seen copy/paste get “freaked out” just by using it a bunch; I use tons of copy/paste, and never have problems with it. My guess is user-error, not a problem with the software.
This may be a flaw in the parser,
Nope.
Just like for C++ or JS or any other programming language, the syntax highlighter cannot be expected to behave identically to a compiler or official language-understanding tool (ie, it cannot show you all compiler errors and runtime errors and logic bugs and …) – it has a different purpose in life, namely, to highlight keywords and allow code folding. That’s why there are plugins, like XML Tools, to add features that shouldn’t be expected in a default syntax highlighter.
-
@peterjones said in Did I break NPP?:
My guess is fat-finger syndrome / PEBKAC (typing characters you don’t notice, or not selecting the text you thought you did when copy/pasting, or having macros that do more than you think they do).
Well, I’m most definitely guilty of that, but I also suffer from “worn-out laptop keyboarditis” as well. :-( Not every key wants to press since I am a touch typist so if you see a lot of typos, most likely I was going to fast for the keyboard and even though I know I hit the key, it doesn’t always make it in to the buffer. :-(
I can concede your points are possible, though. Most problems are user related so I’m not going to argue that point, unless I can realiably duplicate it, with pictures. :-) The syntax highlighting is the tool to find out if you’re doing things inappropriately, which is basically it’s reason for living, so although it’s not perfect, nothing is, I can hope that if it’s not supposed to allow illegal characters, regardless of where they appear, that at the least they would color funny so that you can catch it.
As for the “simple search/replace”…yeah, right. Back to the Regex. :-) LOL
Lee
-
@peterjones said in Did I break NPP?:
starting a file with the <?xml…?> is a trigger to Notepad++ to interpret any file, even if it is saved as .txt, as an XML file
Indeed.
This mechanism is seen, in general, starting HERE.
And, specifically for the xml case, HERE.
-
Those aspects of NPP (Scintlla) at least for now, are beyond my pay grade. :-). Unless they’re handing out free Visual Studio compilers and tools, or I take the time to delve into Python, it’s not in my wheelhouse at the moment.
Back to regex. I was trying to write a regex to encompass all my sins, but I get the feeling that Search & Replace is going to have to be done one variation at a time. Would that be a realistic assessment? I can’t do a catch all using the brackets only without catching all the tags, and as soon as I use a capture group it starts getting funcky, so I’m guessing that the S/R is meant to be used piecemeal in this kind of situation.
Lee
-
@lycan-thrope
Forgot, otherwise, my option since it works as is, is to use it as is and fix it later and update the files later for anyone that wants to update them after I get the angle brackets out of the equation. :sigh:: So much for a “quick” project. :-)Lee
-
@lycan-thrope
Yep, that was the ticket. Made up a couple of patterns for the more numerous and simple one’s, and then ran the XML Tools checker to finish cleaning up the more difficult ones and now the auto completion file is done, so I can now clean up the files that have more modules to go into the auto completion file before adding them in.Onward I go. :-)
Lee
-
@lycan-thrope said in Did I break NPP?:
Unless they’re handing out free Visual Studio compilers and tools,
They do, see here.
-
@lycan-thrope said in Did I break NPP?:
Those aspects of NPP (Scintlla) at least for now, are beyond my pay grade. :-). Unless they’re handing out free Visual Studio compilers and tools, or I take the time to delve into Python, it’s not in my wheelhouse at the moment.
I’m not sure what you’re talking about. What I mentioned doesn’t have anything to do with Scintilla. And you don’t need to build the code to benefit from looking at a project’s source code to infer behavior.
I merely pointed out in the source code for Notepad++ where one can see what it does to override extension-based file type detection because a string is found to be present in the file.
I did this because of what Peter mentioned, and I thought it a semi-interesting topic because the behavior is not at all obvious, and it is curious to see what other strings generate this behavior besides the one for xml.
-
@ekopalypse said in Did I break NPP?:
They do, see here
Interesting, I’ll have to check out the English website, but thanks for that info. Not sure I’ll be head banging into that just right now, but nice to know.
Lee
-
Thanks. I appeciated, and actually understood the information you were linking me to. I guess my humorous response wasn’t taken the way it was intended, so… sorry . :-)
But I definitely agree with your observation, that indeed, it is not at all obvious, which is kind of why my answer was a “flippant” so I apologize if you didn’t understand that I was agreeing with you. :-)
Lee