Commits

nakamura committed 4becf5b

scroll to terminal if focused

Comments (0)

Files changed (1)

                                            self.do_term_commit, term_frame)
         term_frame.terminal.connect_object('key-press-event',
                                            self.do_term_key_press, term_frame)
+        term_frame.terminal.connect_object('grab-focus',
+                                           self.do_term_grab_focus, term_frame)
 
         term_frame.show_all()
         self.resize_layout()
                 self.child_focus(Gtk.DirectionType.TAB_BACKWARD)
                 return True
 
+    def do_term_grab_focus(self, term_frame):
+        alloc = term_frame.get_allocation()
+        self._scrolled.get_hadjustment().set_value(alloc.x)
+        self._scrolled.get_vadjustment().set_value(alloc.y)
+
     def sync_all(self, is_synced):
         for t in self.terminals:
             t.set_sync(is_synced)