示例#1
0
    def on_done(self, index):
        if index == -1:
            return

        file_name_with_args = self.files[index][0]
        file_name, line, column, view_id = file_name_with_args.split(":")
        settings = sublime.load_settings("set_window_title.sublime-settings")

        for window in sublime.windows():
            for idx, view in enumerate(window.views(), start=0):
                if not str(view.id()) == view_id:
                    continue

                project = self.get_project(window)
                official_title = self.get_official_title(
                    window.active_view(), project, settings)

                wmctrl_out = os.popen(
                    "wmctrl -dliGux | grep '{sublime_title}'".format(
                        sublime_title=official_title)).read()
                wmctrl_out = wmctrl_out.split('\n')[0]

                current_window = WmctrlWindow(wmctrl_out)
                current_window.set_focus()
                sublime_api.window_focus_view(window.id(), view.id())
                view.sel().clear()
                view.sel().add(
                    sublime.Region(view.text_point(int(line), int(column))))
                view.show(view.text_point(int(line), int(column)))
                break
示例#2
0
 def select(self, index):
     if index != -1:
         if not isSt2:
             wid = sublime.active_window().id()
             vid = sublime.active_window().views()[index].id()
             sublime_api.window_focus_view(wid, vid)
         else:
             sublime.active_window().focus_view(self.views[index])
示例#3
0
 def select(self, index):
   if index != -1:
     if not isSt2:
       wid = sublime.active_window().id()
       vid = sublime.active_window().views()[index].id()
       sublime_api.window_focus_view(wid, vid)
     else:
       sublime.active_window().focus_view(self.views[index])
示例#4
0
文件: sublime.py 项目: ronnyzxr/aml
 def focus_view(self, view):
     sublime_api.window_focus_view(self.window_id, view.view_id)
示例#5
0
 def focus_view(self, view):
     if view:
         sublime_api.window_focus_view(self.window_id, view.view_id)