PythonScript
PythonScript copied to clipboard
New script -> SaveAs remembers wrong folder
I have two portable installs of N++ and PS:
N++ 7.2.2 with PS 1.0.8.0 (32-bit) N++ 7.5.6 with PS 1.1.0.0 (64-bit)
From the 64-bit version, when I execute Plugins -> Python Script -> New Script, it brings up a SaveAs box with the default folder shown being the ...\plugins\Config\Pythonscript\scripts\ folder from the 32-bit version. I expect it to be the equivalent folder underneath the 64-bit version's folder structure.
If, in the 64-bit version, I navigate to its "correct" (the one in the 64-bit folder hierarchy) scripts\ folder, complete my SaveAs, continue working, etc., then when I need to make another new script it remembers the correct scripts\ folder to use. I can restart the 64-bit N++ and it still remembers...all good.
However, if I go back to the 32-bit version and make a new script there (it ALWAYS knows its "correct" scripts\ folder), then the NEXT time I come back to the 64-bit version and make a new script, it is back suggesting a default new script folder from the 32-bit version's folder hierarchy again.
Kinda minor...but also kinda annoying. I guess it goes away when I am fully ported to 64-bit and I erase the 32-bit version...
I do have both installed, one in x86 and one in x64 and depending on which one I use I always get the correct path. You do have both with local config or with %APPDATA% configuration?
@claudiafrank, both with local config. Local config seems to be the default when you use the portable version of Notepad++ (which makes sense).
I also don't observe the described behaviour with PS 1.1.0.0 for 32bit and 64bit on 7z local installations of N++ 7.5.6. But I observed a wrong path the first time I called "New Script" for the 64bit version. After selecting cancel and calling "New Script" again that behaviour disappeared and I couldn't reproduce it again.
There is something strange here - I wiped everything I tested previously, because I did want to double check if I had the same "first wrong path and right path after cancel" as chcg reported and created two new npps -> now I do have the same issue as sasumner reported. Will try to see if this can be replicated under debugger.
And now it is back to the state I reported first. Wiping everything and recreating two new clean npp directories doesn't create the issue. @sasumner, if you still have the issue would you mind testing if notepad.getPluginConfigDir() is returning the 32bit directory instead of the 64bit as well? Because PS is asking notepad for the current plugin directory using this
https://github.com/bruderstein/PythonScript/blob/master/PythonScript/src/PythonScript.cpp#L118
which is basically the same notepad.getPluginConfigDir() does.
@ClaudiaFrank can't get it to replicate when I want it to. Will monitor it and post back here the results of that function call the next time it happens.
@sasumner Did this issue happen again to you? Or could it be closed as not reproducible.
Oooh, I wish I'd seen this issue before. Because it happens to me as well. I have a "normal use" Notepad++ that I do everything in (highly customized) but when I want to test scripts for publishing I run a "clean" portable version alongside (could be a different N++ version) with PythonScript installed.
It gets tedious when I go to create a new script in the clean-portable, and it prompts me to save the script in the folder of my normal-use. What to do when that happens? To far away to browse to the correct place without annoyance, so I end up doing a SaveAs on another tab containing a script for the quickest way to be the script in the correct place.