-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing scripts from menu items causes issues with shortcuts #92
Comments
|
@Yaron10 thanks. Notepad++ v7.5.6 (32-bit) And I still have the same issue. Created 2 new scripts, assigned Ctrl+F1 and Ctrl+F4 to them. Contents of shortcuts.xml has not changed after item removal:
So the problem that the N++ config is not synced. And I think there is no simple workaround, |
You're welcome. I suppose that @chcg and/or @ClaudiaFrank will look into the issue you've reported. |
Confirmed. |
@ClaudiaFrank My suggestion is to check whether some other plugins have similar option to register / unregister items in N++ and look how the shortcut mapping behaves. If it is same issue than it should be solved in N++ source code I suppose. Though frankly I've never used any plugins other than PS so can't be very helpful. |
I guess typically the other plugins I have seen are not modifying their menu and therefore are not facing such an issue. Maybe it is just a matter of first checking if a shortcut for the menu entry exists and than removing the menu entry. I'm not sure if the plugin itself has access to that information of the shortcut mappings. Maybe this contains some info on it: Checking how https://github.com/dail8859/LuaScript behaves might give some hint how to handle this issue. |
Question: what exactly happens when I press "Remove" button in the configuration GUI? I have tried to change PythonScriptStartup.cnf manually to add and remove an item - and it works (though I cant give 100% guarantee about possible side effects). |
@Mikhail22 From my current understanding, this are the following possibilities
I prefer solution 1, simply because npp is aware that there is something to do. @chcg |
Maybe there is a 5. option:
|
Would be the best, yes, but from the past experience I guess it takes quite some time before such feature is available. |
@ClaudiaFrank I am not sure what options 1, 2, 3 would bring, and what npp dialog you mean? As a temporary solution I propose the following: make the PS plugin track the mappings |
@ClaudiaFrank As for Option 4. - I suppose it can work only by closed n++, |
@Mikhail22 by dialog I mean npps shortcut mapper (run->modify shortcut/delete command) TO ALL Edit: Forget the test - I was ignoring the start index npp reports to PS. |
Hello Claudia,
I think this is a perfectly legit solution which many apps would use in similar cases. Thank you for your work. I appreciate it. |
Hi Yaron, |
I think there's no need to open "Please remove the shortcut to this item (Options -> Shortcut Mapper) and restart Notepad++." What do you think? |
This does not delete the entry in shortcuts.xml and thus next restart will assign the shortcuts wrong. |
I haven't tested the case. I'll do it now. |
@ClaudiaFrank
I can edit and save the Xml, yes, but if I do it while opened n++ and then open and close the
Yes! the entry with the corresponding ID must be removed from Xml. script A <PluginCommand... internalID="7" ... >
script B <PluginCommand... internalID="8" ... >
script C <PluginCommand... internalID="9" ... > When I remove the first one "7", this line must be removed and IDs must be RENUMBERED. script B <PluginCommand... internalID="7" ... >
script C <PluginCommand... internalID="8" ... > AND this should be done with closed n++ because the contents of Xml by opened n++ does NOT |
If you assign a shortcut and (at the same session) remove the item, you won't have an entry to select. |
@Mikhail22 thx for confirming,
I don't see why this "has to be done with closed npp". |
Claudia, Would closing NPP and running a script rearranging the shortcuts in |
Ok I see. Still seems that user script ID alwys start from 7 and added items become IDs in incremental
Well if you want to leave that up to the user - then its ok :-D My idea about standalone tool implies it would be the only way to remove items and which |
@Mikhail22, you're right, as more and more I think about it, the only PS "save" way to do it is to ignore The only true solution would be @chcg option - npp provides a message which can be used to inform |
Are people just noticing this issue NOW?? I've known about this one for years (but it seemed from 2014 until just very recently there was no one maintaining P.S., ...so I never complained), and I have some Python code (not Pythonscript) to deal with it...that is, to fix it. :-) |
Until I saw the issue opened, I forgot about it but you are right it has been an issue almost from the start. |
Right, I wasn't proposing a real fix for it using an independent Python, just sharing what I do to mitigate the pain of this problem. At least deleting Pythonscripts (assigned to shortcuts) isn't an everyday thing, so this pain is infrequent. Doesn't lessen the severity, though! :-) |
Asked for a new feature - notepad-plus-plus/notepad-plus-plus#4674. |
@ClaudiaFrank Thanks for creating the N++ issue. |
PR created - notepad-plus-plus/notepad-plus-plus#4687 |
👍 |
@ClaudiaFrank Thanks a lot for keeping your eye on it! That would be really good once it works. Your work is appreciated! |
Yes, good work...but will anything happen with the PR... |
Time will tell |
@ClaudiaFrank Did you already impl the pythonscript part based on the N++ PR? |
If you are asking whether I did test based on the PR, then yes I did but |
@ClaudiaFrank See preparation at https://github.com/chcg/PythonScript/tree/issue_92, if your N++ PR get merged. |
N++ PR merged, needs next N++ release (>7.5.8) to be checked with the impl here. |
from N++: Add new plugin API NPPM_REMOVESHORTCUTBYCMDID to allows plugins to remove unneeded shortcuts Fix #4674, close #4687 Needed for #92
Too bad @ClaudiaFrank left Notepad++ for good before seeing this come to fruition! :-( |
- switch to html version of docu, because singlehtml doesn't provide an index/search - adapted zip and msi build therefore
Fixed with Pythonscript v1.3 and now available https://notepad-plus-plus.org/news/notepad-7.5.9-released.html |
Since you were able to solve this problem it would be nice if you could help in this discussion. |
Recently I removed a script from Menu items list (in Plugin configuration GUI, remove button).
Restarted N++, as usual but there is a problem - now in the shortcut mapper the shortcuts
are all out of sync. So the item is removed, but the bindings are not updated properly,
the order of internal IDs is changed but the order of bindings is not correct.
So if I remove the first script from menu item list, all the bindings are shifted.
And this is frustrating - now I need to rebind all shortcuts again.
How to reproduce:
I am using PS plugin version 1.0.8
Notepad++ v7.5 (32-bit)
Admin mode : OFF
Local Conf mode : ON
OS : Windows 10 (64-bit)
Plugins : mimeTools.dll NppConverter.dll NppExport.dll PythonScript.dll
PS:
Is there any newer version of the Plugin? I have seen comments here about 1.2 version.
But I don't see any info about newer version and how to install.
The text was updated successfully, but these errors were encountered: