Repository: nvaccess/nvda

Issue:
Some gestures are not displayed in input gesture dialog
In some cases, not all the gestures are displayed in input gesture dialog.

### Steps to reproduce:
From a brand new NVDA config:
* Download [this minimalist test plugin](https://github.com/nvaccess/nvda/files/10539839/test.py.txt) and remove the .txt extnesion
* Enable the scratchpad and paste the plugin in the global plugins
* Reload the plugins with NVDA+control+F3
* In input gesture dialog, associate the script test123 (description in the dialog is ""This is a test script") with NVDA+shift+W, then validate
* Press NVDA+shift+W
* Open the plugin from the scratchpad and rename `script_test123` to `script_test456`
* Reload the plugins (NVDA+control+F3)
* Open the input dialog and associate test456 (description in the dialog is ""This is a test script") with the previously used shortcut NVDA+shift+W; then validate.
* Close input gesture dialog
* Press NVDA+shift+W
* Reopen input gesture dialog


### Actual behavior:
In both cases (test123 and test456), the script is run with NVDA+shift+W, i.e. association is working.

But when you open input gesture dialog last time, the shortcut NVDA+shift+W does not show up for the script ""This is a test script".

### Expected behavior:
In both cases, in the input gesture dialog, the shortcut NVDA+shift+W should be displayed for the script ""This is a test script".

### NVDA logs, crash dumps and other attachments:
Not provided.
### System configuration
#### NVDA installed/portable/running from source:
Installed
#### NVDA version:
2022.4
#### Windows version:
Windows 10 2004 (x64) build 19041.388
#### Name and version of other software in use when reproducing the issue:
N/A
#### Other information about your system:
N/A
### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
No, but not needed; probably here for some time.
#### If NVDA add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Not tested, unrelated.



Discussion:

Resolving patch:
diff --git a/source/inputCore.py b/source/inputCore.py
--- a/source/inputCore.py
+++ b/source/inputCore.py
@@ -1,7 +1,7 @@
 # A part of NonVisual Desktop Access (NVDA)
 # This file is covered by the GNU General Public License.
 # See the file COPYING for more details.
-# Copyright (C) 2010-2022 NV Access Limited, Babbage B.V., Mozilla Corporation
+# Copyright (C) 2010-2023 NV Access Limited, Babbage B.V., Mozilla Corporation, Cyrille Bougot
 
 """Core framework for handling input from the user.
 Every piece of input from the user (e.g. a key press) is represented by an L{InputGesture}.
@@ -729,9 +729,12 @@ def addGlobalMap(self, gmap):
 					try:
 						script = getattr(cls, "script_%s" % scriptName)
 					except AttributeError:
+						log.debugWarning(f"Unable to bind gesture: script '{scriptName}' not found in class {cls}.")
+						self.handledGestures.remove(key)
 						continue
 					scriptInfo = self.makeNormalScriptInfo(cls, scriptName, script)
 					if not scriptInfo:
+						# Scripts with no description are not displayed in the Input gesture dialog.
 						continue
 				self.addResult(scriptInfo)
 			scriptInfo.gestures.append(gesture)


Test patch: