GNOME Bugzilla – Bug 614140
Snippets: shortcut keys don't work
Last modified: 2019-03-23 20:53:02 UTC
Since I updated to gedit 2.29.9, shortcut keys don't work for Snippets, but still work for External Tools. To reproduce the bug: 1) Make sure Snippets are enabled in "Edit > Preferences > Plugins", and go to manage them in "Edit > Preferences > Plugins > Snippets > Configure Plugin". 2) Create a global snippet, named for example "comment": /* $1 */$0 and create a shortcut key: Control+n The "Shortcut key" field is filled with "Ctrl+N". Note: in External Tools, the shortcut key is saved as "<Control>n" (more details below). 3) In gedit, create a new file and do the shortcut key. Actual result: nothing. Expected result: the snippet "comment" should be expanded. Here's a comparison with the plugin External Tools: 1) Make sure External Tools are enabled in "Edit > Preferences > Plugins", and go to manage them in "Edit > Preferences > Plugins > External Tools > Configure Plugin". 2) Create a tool, named for example "copy-name": #!/bin/sh echo -n "$GEDIT_CURRENT_DOCUMENT_NAME" | xsel -b -i and create a shortcut key: Control+n The "Shortcut key" field is filled with "<Control>n". 3) In gedit, open a file and do the shortcut key. Actual result: the tool is run.
Luckily we got permission to break hard freeze to fix this bug, just in time for 2.30. The problem was twofold, the snippets were not properly initialized for the first empty document, and the result from the activation was not properly propagated back such that other handlers could still run. This should now be fixed.