Sublime Forum

Mouse Map always attach current event in its args

#1

I want to bind lsp_prev_diagnostic/lsp_next_diagnostic to my mouse4/5, but sublime seems to unable to disable the additional arg, which will cause:

command: lsp_next_diagnostic {"event": {"button": 4, "x": 706.5, "y": 373.5}}
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text\Lib\python38\sublime_plugin.py", line 1687, in run_
    return self.run(edit, **args)
TypeError: run() got an unexpected keyword argument 'event'
```
0 Likes

#2

That’s a bug of LSP plugin.

It’s commands generelly opt in to receiving events via LspTextCommand but not all derived commands are designed to take those arguments.

0 Likes

#3

Yes, LSP can simply ignore them, but currently I wonder if I can manually disable passing the additional args (I tried set it to null, but seems useless)

0 Likes

#4

No you can’t. If a command opted-in via API it is receiving those events.

0 Likes