Skip to content

Commit b674433

Browse files
committed
set the focus to the console window each time it's open or called from a sampy command
1 parent 95a9994 commit b674433

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tools/message.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ def create_panel(self, direction='down', extra_name=None):
6868

6969
session = self
7070

71+
def set_focus(self):
72+
"""Set focus
73+
74+
Sets the focus to the console window
75+
"""
76+
window = sublime.active_window()
77+
window.focus_view(self.output_view)
78+
7179
def print(self, text):
7280
"""
7381
Adds the string in the deque list
@@ -210,6 +218,7 @@ def open(port):
210218
"""
211219
if(Message().recover_panel(port)):
212220
txt = session
221+
txt.set_focus()
213222
else:
214223
from ..tools import __version__
215224

tools/sampy_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def start_sampy():
5454

5555
# message printer
5656
txt = message.open(port)
57+
txt.set_focus()
5758

5859
if(port):
5960
try:

0 commit comments

Comments
 (0)