[TxMt] Re: UI blocked while running command with “Output: Discard”

Jacob Carlborg doob at me.com
Sun Aug 7 08:15:40 UTC 2016


> On 06 Aug 2016, at 23:21, Stefan Daschek <stefan at daschek.net> wrote:
> 
> I’m working on a new RuboCop bundle. I want the linting to take place everytime a Ruby document is saved, with warnings then displayed in the gutter.
> 
> So I implemented a very simple command using `callback.document.did-save` and `TextMate::Executor.run`, and it works great so far. However, if I set the command to “Output: Discard”, TextMate’s UI seems to be blocked (no cursor movement or other editing possible) while the command is running.
> 
> Interestingly this does not happen with “Output: New Window”: In this case I can continue editing the document even while the command is still running.
> 
> Is this a bug? Or is there are workaround?

It’s intended behavior. The reason is that the command should not be able to run and possibly edit the document simultaneously while the user is editing the document.

The solution is to run the command in the background/daemonized. See this post for an example [1].

My I ask why you’re creating a new RuboCop bundle when this one [2] exists?
You might also want to take a look at this pull request that adds a RuboCop formatter command to the Ruby bundle [3].

[1] http://lists.macromates.com/textmate/2016-May/039535.html
[2] https://github.com/mrdougal/textmate2-rubocop
[3] https://github.com/textmate/ruby.tmbundle/pull/99

—
/Jacob Carlborg



More information about the textmate mailing list