An application suddenly stopped processing a Notepad++ text file
-
Hello everyone. There is a program called Weidu, used for installing mods for Infinity Engine role-playing games like Baldur’s Gate and Icewind Dale. It processes files with installation code and the tp2 extension. They are text files that Notepad++ recognizes.
Now, I don’t know anything about the code of Weidu itself, but most likely the problem I suddenly started having is due to some switch or midway error in Notepad++. It is this: going through a tp2 file created in Notepad++ Weidu suddenly began objecting to what, I guess, it now considers special characters. The installation stopped at a line with an asterisk; when I deleted that for a test, it bucked at a left parenthesis; then the right; then the plus sign; then the colon. What is strange is that just a few paragraphs above in the tp2 file I used all of the same commands and symbols, and Weidu blew past them. Now, in the middle of this tp2 file, it objects - even to code from above, accepted before but not when inserted down below!
I blamed encoding at first. I have had problems with installation results (though not the process) when the tp2 file had been encoded as ANSI. This time the file is in UTF-8, the language is English everywhere. To repeat, the same code that was accepted just above no longer works below.
Any help with this would be appreciated.
-
I think the files may not be pure text, or if so are formatted such that the original application is the only correct way the file is opened and read.
Notepad++ will open any file, even binary (executable, or DLLs), that doesn’t make it the correct program to edit such a file.
Since you now have issues you may need to find an original version to get functionality back.
Terry
-
@temnix
I’ve done some background reading on this file format and you appear to be correct, it’s a “plain” text file.However even though others have used Notepad++ to edit/create these files I think the formatting of the commands would need to comply with the structure requirements. With your issues, I suspect you have not and thus Weidu is not processing the file, rather it is showing errors.
I stand by my original theory, Notepad++ isn’t the best application to edit or create these files as it does NOT understand the compliance requirements, that rests with you.
Terry
-
@Terry-R Okay, thank you for trying to help. The problem turned out to be completely on my end - some missing tildas that were throwing off the code. They are difficult to spot in a massive block of text, that is all I can say in my defense. I’m going to leave here this observation about a previous problem I had in Notepad++, when I accidentally pressed some combination of buttons that converted one of the spaces into some kind of special space - longer than usual. I don’t know what exactly that was, but it was quite invisible between the lines, and I only discovered it by moving the cursor up by hand. Whatever that was exactly, it threw off the compiler, and I think Notepad++ needs to have some warning system for these types of very casual replacements. I probably held down Shift or Control or Alt, and voila. Maybe a beep?
Again, thanks.
-
This post is deleted! -
@temnix said in An application suddenly stopped processing a Notepad++ text file:
Okay, thank you for trying to help. The problem turned out to be completely on my end - some missing tildas that were throwing off the code.
So my theory about you not typing within the rules was correct.
My previous post I deleted as it was in reply to what you originally typed (before you overwrote it), and wasn’t relevant anymore. Somehow I was looking at an old cached version which hadn’t updated.
Glad you got it sorted, but realize that Notepad++ has no idea of those rules so cannot keep you safe. You either need to learn the rules better or use the correct program.
There is possibly a third option, UDLs. User defined languages, which are built (by you) within Notepad++. These allow you to colour code the weidu code according to the rules. It would be a very large undertaking. It won’t necessarily stop your problem but would make it easier to spot due to the colour coding. Reference the the online manual here.
Notepad++ will display other types of characters, read the online manual reference here, maybe that can identify your problem next time if it is a hidden character.
Terry
PS and before you ask, noone has created a UDL for this type of file, at least it is not listed in the user collection, which is extensive. Maybe look through the collection, you may find one similar that you can use as a template.
-
@Terry-R said in An application suddenly stopped processing a Notepad++ text file:
at least it is not listed in the user collection, which is extensive
Well, that’s very interesting. On a whim I Googled “weidu udl notepad++”. See here for just what the doctor ordered. There are other references so have a look around.
Good luck
Terry -
@temnix said in An application suddenly stopped processing a Notepad++ text file:
… a previous problem I had in Notepad++, when I accidentally pressed some combination of buttons that converted one of the spaces into some kind of special space - longer than usual. I don’t know what exactly that was, but it was quite invisible between the lines, and I only discovered it by moving the cursor up by hand. Whatever that was exactly, it threw off the compiler, and I think Notepad++ needs to have some warning system for these types of very casual replacements. I probably held down Shift or Control or Alt, and voila. Maybe a beep?
There are two issues:
- Notepad++ has many keyboard shortcuts.
- If you fumble or fat finger a series of keys that is not a shortcut then it may get added to the file you are working on.
Fortunately, there are fixes for both of these though they are messy.
Notepad++ has many keyboard shortcuts.
I don’t know if it would help or hurt you but it’s possible to disable the various keystroke sequences that you could fumble-finger.
Go to Settings / Shortcut Mapper.
For each of the commands in the Main menu, Macros, Run commands, and Plugins commands sections of the mapper review the list of shortcuts. If you see one you don’t want then select it and press the
Clear
button.The Scintilla section’s behavior is different in a couple of ways. Some of the commands have more than one shortcut. For those, double click on the line to bring up the modify dialog box and then click the
Remove
button on the left. Once you are down to one shortcut for a Scintilla command you need to set the keyboard code in the upper-right drop down toNone
which is the first option and then clickApply
and thenOk
. TheClear
button does not work in the Scintilla section section.You should make a backup of your shortcuts.xml file before going wild with removing shortcuts.
Dealing with random Ctrl key related characters
This forum thread mentions two methods that allow you to set up Notepad++ so that if you do Ctrl and some letter and it’s not a shortcut that the key code won’t get added to the file you are working on. The fixes involve adding the PythonScript plugin.
-
@mkupper said in An application suddenly stopped processing a Notepad++ text file:
I accidentally pressed some combination of buttons that converted one of the spaces into some kind of special space - longer than usual. I don’t know what exactly that was, but it was quite invisible between the lines, and I only discovered it by moving the cursor up by hand.
It’s a pity you don’t have more exact information about this, because I’m fairly certain you can’t get a “special space” in this way (although @Coises recently pointed out some non-English keyboard where a special keycombo involving the spacebar inserts a “special space” – so maybe that’s it? – see HERE).
Notepad++'s default settings, shown here:
should show you if you get any kind of “special character” inserted into your document. The effect would be very obvious, e.g. see
ZWNJ
character in the sample below:Notepad++ needs to have some warning system for these types of very casual replacements. I probably held down Shift or Control or Alt, and voila. Maybe a beep?
I think the visual effect is enough. There shouldn’t be any other sort of “casual replacement” – if you think there is, please provide further detail.