blu3mania / npp-papyrus

Notepad++ plugin to provide Papyrus scripting language support to Notepad++, such as syntax highlighting with automatic recognition of class names/functions/properties, keywords matching, and hyperlinks to referenced scripts. It also comes with a compiler that can provide compilation errors in a separate list window, as well as inline annotation and indication where errors are reported, plus support anonymization of compiled .pex files.
GNU General Public License v3.0
24 stars 7 forks source link

Papyrus plugin settings didn't save #8

Closed Zaflis closed 3 years ago

Zaflis commented 3 years ago

I made changes to directories for Skyrim compiling, and after closing dialog and then restarting Notepad++, the old settings are always back.

I figured a workaround from your configuration doc file; from "%APPDATA%\Notepad++" i found Papyrus.ini and Papyrus++.ini that were actually saved with info i had changed. It's weird that they weren't actually loaded though. I copied those 2 files to "C:\Program Files\Notepad++\plugins\Config" and then they loaded.

This is on Win10-64bit, also 64-bit plugin because of that.

blu3mania commented 3 years ago

Interesting, the code uses NPP's API to get config folder location (https://github.com/blu3mania/npp-papyrus/blob/main/src/Plugin/Plugin.cpp#L201) so it suggests that NPP reports "%APPDATA%\Notepad++\plugins\config" as config folder but actually uses "C:\Program Files\Notepad++\plugins\Config" itself.

To help me reproduce this issue, can you provide the following info?

  1. The Notepad++ version you are using
  2. Installation folder (I assume it's "C:\Program Files\Notepad++" but need confirmation)
  3. If there is a file named doLocalConf.xml under installation folder (see https://npp-user-manual.org/docs/config-files/ for more info, and https://community.notepad-plus-plus.org/topic/16996/new-plugins-home-round-2 about this file's impact)
  4. Is "--settingsDir" option used when launching NPP?
  5. What is displayed in NPP's "Debug Info" menu (under "?")?
  6. Papyrus++.ini is not from this plugin, but the old plugin. Did you check its content and last update timestamp, and confirm that it was updated? If so, do you have the old plugin installed as well?

Thanks.

Zaflis commented 3 years ago
  1. At the time of report it was 7.9.5, after the workaround fix i still updated it to 8.1.1 just in case.
  2. C:\Program Files\Notepad++\
  3. No, it wasn't in %appdata% either.
  4. No parameters at all.
  5. Notepad++ v8.1.1 (64-bit) Build time : Jul 1 2021 - 14:10:53 Path : C:\Program Files\Notepad++\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : OFF Cloud Config : OFF OS Name : Windows 10 Home (64-bit) OS Version : 2009 OS Build : 19043.1052 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll Papyrus.dll
  6. Last time Papyrus++.ini was modified was december 2019. The Papyrus.ini was changed today. As far as i can tell i do not have the Papyrus++.dll under plugins. Last time i only used it with old separate NP++ version.

One thing i do change for actual compiling is change the work folder of shortcut for papyrus compiling to D:\games\Skyrim\ScriptCompile\ , because i do not read scripts from the Skyrim\Data. I had enough of the old plugin actually writing compiler output into source files, ruining them. It was very rare but led to obvious further errors trying to compile.

blu3mania commented 3 years ago

Although I couldn't reproduce this issue, I did find a bug that after changing game settings and closing the dialog without switching tab, these settings are not properly saved. I am not sure if you ran into this issue, then updated the settings again and it properly saved that time, so copying the config file to installation folder might just be red herring? Anyway, can you try the new 0.2.2 release and let me know if it works? Thanks.

Zaflis commented 3 years ago

I made backup and removed the config file from "program files", installed 0.2.2.

  1. The About... -page says it's 0.2.1 version but i see it was modified just now.
  2. The moment i started NP++ i went to settings and saw that my changes were in. They were still left in the appdata so this tells to me it's working.
  3. I also backed up and deleted the file from appdata, then started it again, changed settings. Restarted app and the settings were loaded as expected.

So i suppose it's solved although it's a bit hazy on what the problem was. Back then i also suspected permissions issues so i had even tried launching NP as administrator but that too didn't fix it back then, only adding the file to config... which now doesn't even need to exist. So it does now save and load from the appdata.

blu3mania commented 3 years ago

Thanks for the confirmation. Yeah, I am not sure what happened. The only change I made was just to make sure all settings are properly saved when closing settings dialog. But I am glad it is solved for you.

As for the version number, I didn't bump it because this "release" is just to test if it addresses your issue, and may need more changes before I can finally call it 0.2.2. Since it's confirmed now, I will bump up the version and re-create the release. I will let you know when the official 0.2.2 release is tagged.

blu3mania commented 3 years ago

@Zaflis 0.2.2 has been re-created. I had to do it twice because VirusTotal misreported on one of the zip files. Thanks.