Home Download Buy Blog Forum Support

Clipboard History

Re: Clipboard History

Postby ajpalkovic on Wed Aug 10, 2011 4:39 pm

Yea, I agree, but the chances of two commands running at the same time are pretty rare. That's the only way a threading problem could have occurred. I would have to like cut and paste at the same time, that hardly every happens, there is always a delay of at least .1 or .2 seconds as my finger switches keys, idk. O well, doesn't really matter in the grand scheme of things.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Clipboard History

Postby optilude on Wed Aug 10, 2011 10:24 pm

I think no matter how likely or unlikely, you never know. You should always program for thread safety when code is executed in a multi-threaded environment. Python makes it pretty easy, thankfully.
optilude
 
Posts: 30
Joined: Sun Jan 30, 2011 2:36 pm

Re: Clipboard History

Postby ajpalkovic on Thu Aug 11, 2011 12:59 am

Actually, now that I think about it, that is not the source of the problem.

The only way a threading issue can occur is if two commands are run at the same time. But that cannot happen in sublime. Sublime is still effectively single threaded for plugins. Jon more or less has said as much in the forums. In other words, sublime will never allow the cut and paste commands to run at the same time.

Even if my fingers magically instantaneously trigger both commands at the same time, sublime will still have a queue or something to execute one, then the other. Otherwise, EVERY SINGLE plugin would need to be updated to have a lock on their global data, which I know most don't do right now.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Clipboard History

Postby colinta on Tue Jan 10, 2012 7:40 pm

I've forked and tweaked the gist above. I would like to publish it to Package Control as ClipboardManager (to differentiate it from the existing ClipboardHistory, which doesn't do all that aptitude's plugin does).

https://gist.github.com/1590661
colinta
 
Posts: 14
Joined: Wed Dec 21, 2011 9:43 pm

Re: Clipboard History

Postby ajpalkovic on Tue Jan 10, 2012 8:59 pm

I actually stopped using the plugin a while back. I would love for it to work, but it didn't play well with yank in vi mode for instance so it became useless for me.

Sublime really needs an on_before_command and on_after_command callbacks that plugins can implement.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Clipboard History

Postby and7ey on Sun Apr 08, 2012 7:34 pm

OMG, Clipboard Manager's readme leads to this topic. I've spent 30 minutes trying to understand why clipboard_history_* doesn't work. I should use clipboard_manager_* instead...
and7ey
 
Posts: 2
Joined: Sun Apr 08, 2012 7:31 pm

Re: Clipboard History

Postby colinta on Wed May 02, 2012 4:52 pm

I'll update the README to be a little clearer on that difference.
colinta
 
Posts: 14
Joined: Wed Dec 21, 2011 9:43 pm

Previous

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 8 guests