[TxMt] Re: showing preview of css colors

Jacob Carlborg doob at me.com
Tue May 31 06:52:37 UTC 2016


On 2016-05-30 21:45, Allan Odgaard wrote:

> And related to this thread, beta 9.3 (nightly build) has support for
> both a “did open” command callback and setting multi-color images in the
> gutter (I decided on making it so that monochrome images must have a
> “Template” suffix to follow the system convention).
>
> So now someone just needs to a) create a script to find everywhere a
> color is specified in a CSS file and b) generate an image from a CSS
> color specification.

I'm a bit worried about the this "did open" callback in combination with 
TextMate's synchronous way of executing bundle commands.

If a command that uses "did open" takes some time to execute, TextMate 
will block/freeze until the command completes. If the user at the same 
time tries to use the application it kind of queues up the actions and 
when the command completes TextMate acts really weird [1].

If this CSS command is going to read and parse files and generating 
images that needs to be written to disk I'm starting to get concerned.

[1] The behavior of a blocking command taking long time to execute is 
easy to simulate by creating a new command (or use the existing "SCM 
Diff Gutter" bundle) with the semantic class 
"callback.document.did-open". For the actual code, add this:

#!/usr/bin/env ruby
sleep 5

That simulates a command taking five seconds to execute.

-- 
/Jacob Carlborg



More information about the textmate mailing list