Sublime Forum

Clearing sublime.set_timeout

#1

Hello,

Is there, by chance, a counterpart of sublime.set_timeout(), which would allow canceling the timeout?
The thing I’m trying to do is to call a method on on_selection_modified, but prevent it from executing the portion of code when the user is in process of dragging the mouse (and execute the aforementioned code only once, when selection hasn’t changed in e.g. 0.05 sec). I have it already done with python Timer object, but using ST api would be more efficient, I think.

0 Likes

#2

What method are you using to detect when the user is dragging the mouse? I am very interested!

0 Likes

#3

@adzenith:
Heh heh, I’m speaking about WordHighlight plugin you are working on from time to time :smiley: — so, it should be pretty much nothing new for you (at least concerning the on_selection_modified). As for the rest, you should see a fork on github, but the changes aren’t complete yet — I have them tested under Linux, and will be testing on Windows tomorrow.

0 Likes

#4

Excellent! I look forward to it. :smile:
I’m trying to mouse-detect for my scroll-offset plugin, actually—right now selecting with the mouse near the edge of the buffer scrolls the view, which is undesirable to say the least.

0 Likes