In the meanwhile I have succeeded in doing this by taking the following drastic measures:
– use my system keymapper to remap control+l (control-L) system-wide to the ordinary enter
key
– use my system keymapper remap standard enter
key to shift+enter
if sublime text is the current application
– bind ordinary enter
to my custom soft_newline
command in sublime text IF the popup is not showing
– bind shift+ender
to an ordinary newline insertion in sublime text
After all that runaround, it works.
However, I still suspect one might be able to do it without external key remappings, with a keyboard shortcut like this, say:
{ "keys": ["ctrl+l"], "command": "press_enter", "context": [
{ "key": "overlay_visible", "operator": "equal", "operand": true},
]},
Where for the press_enter
command I tried this:
class PressEnterCommand(sublime_plugin.TextCommand):
def run(self, edit):
insert_characters(self.view, '\n')
This “almost” works in the sense that if I run, say, insert_characters(self.view, 'a')
instead of insert_characters(self.view, '\n')
it actually inserts an “a” in the popup panel. But somehow the newline “\n” isn’t registered as an “enter” keypress by the panel…