IGRACH
IGRACH

Reputation: 3635

Separate Build for every file/tab in Sublime Text

When you run Build System is Sublime by default it creates a bottom pop-up that is bound to that sublime window. When you change to other tabs bottom pop-up will still stay for the Build that you have started.

I would like to have separate Build/Build pop-up for every tab that is opened in that window. For example; there are two tabs open, file01 and file02. I run Build System for file01 and while its running I switch to other tab, file02, and there is no Build pop-up. I can edit file02 and also run build on it separately while build on file01(tab one) is running. Also starting and stopping Builds for for different files will not affect Builds for other files/tabs. Essentially every tab in a window would have separate Build System and Build pop-up.

Upvotes: 0

Views: 71

Answers (1)

OdatNurd
OdatNurd

Reputation: 22791

The short answer to your question is, there is no out of the box way to do this; by design build systems are executed in the context of a window and not a file tab within a window.

The longer form answer is that builds are executed by an instance of a WindowCommand, which is a command that is specific to a window. That command can do anything that it likes in order to drive the build.

By default, the command used is named exec, and its implementation can be found by using the command palette by using View Package File and looking at Default/exec.py.

The implementation that ships with Sublime follows the rule that there is one build per window, and so when you trigger a build if one is already running, it is cancelled in favor of the new one.

To do what you want, you would need an implementation of what that command does that instead tracks the build per tab instead of per window. Such a command would need to cover all of the edge cases inherent in this as well, such as the commands that navigate through errors not working if there is more than one build result, or what happens if you close a file while a build is running, etc.

Upvotes: 1

Related Questions