Indeed, the command log only displays commands executed at the top level. Possibly this is because so many commands build their functionality by executing other commands and it would be hard to track what exactly is happening, but that’s just a guess on my part.
I don’t think there’s any way to detect a key up event, no.
Simplistically, this plugin creates a drop in replacement for drag_select
that lets you know that a drag selection is happening and then invokes the underlying drag_select
command to perform the selection:
import sublime
import sublime_plugin
class MyDragSelectCommand(sublime_plugin.TextCommand):
def run(self, edit, **kwargs):
print("my drag select", kwargs)
self.view.run_command("drag_select", kwargs)
def want_event(self):
return True
Replacing the drag_select
command in the standard mouse map with my_drag_select
works as I would expect it to; it outputs its arguments to the console and then the appropriate selection changes.
Note however that it’s the drag_select
command that performs the drag select, so you don’t get notifications of the selection as it changes (except through a selection changed event). As such I don’t know that this helps you much unless you can figure a way to detect when the drag_select
command has finished executing so you know to stop paying attention to selection changes.