Skip to content
Browse files

don't set focus to source view if build output is in same group

Strike off a todo, yay!

It turns out that we were setting the focus to the source view, which
explains why the build output is not given focus if it is placed in the
same group (as opposed to, it being given focus when placed in some other
group).
  • Loading branch information...
1 parent bac47c5 commit 2c3e5e3d8873d3fdb66ff66fb931930e846aa9d3 @rctay committed Jan 26, 2014
Showing with 5 additions and 4 deletions.
  1. +0 −2 README.md
  2. +5 −2 commands.py
View
2 README.md
@@ -61,8 +61,6 @@ Palette in either the view with build output or with source code and selecting
# Issues/TODO
- - build view does not gain focus if it is in the same tab group as the view
- that launched the build
- pin/unpin location, so that subsequent builds scrolls to the same location
- build view is "forgotten" after restarting Sublime
- improve disabling/enabling options (eg whitelists, blacklists)
View
7 commands.py
@@ -74,9 +74,12 @@ class Pipe(PlacementPolicy1, PipeViews):
def on_view_created(self, window, view, pipe):
proxy_settings(pipe, view.settings())
- window.set_view_index(view, *self.choose_group(window, self.view_launched_build))
+ group_index, view_index = self.choose_group(window, self.view_launched_build)
+ window.set_view_index(view, group_index, view_index)
- window.focus_view(self.view_launched_build)
+ source_group_index, _ = window.get_view_index(self.view_launched_build)
+ if source_group_index != group_index:
+ window.focus_view(self.view_launched_build)
class BuildListener(sublime_plugin.EventListener):

0 comments on commit 2c3e5e3

Please sign in to comment.
Something went wrong with that request. Please try again.