@@ -503,6 +503,11 @@ def on_current_diff_changed(self, widget, *args):
503503 self .actiongroup .get_action ("CopyLeftDown" ).set_sensitive (copy_left )
504504 self .actiongroup .get_action ("CopyRightUp" ).set_sensitive (copy_right )
505505 self .actiongroup .get_action ("CopyRightDown" ).set_sensitive (copy_right )
506+
507+ prev_pane = pane > 0
508+ next_pane = pane < self .num_panes - 1
509+ self .actiongroup .get_action ("PrevPane" ).set_sensitive (prev_pane )
510+ self .actiongroup .get_action ("NextPane" ).set_sensitive (next_pane )
506511 # FIXME: don't queue_draw() on everything... just on what changed
507512 self .queue_draw ()
508513
@@ -734,11 +739,8 @@ def _corresponding_chunk_line(self, chunk, line, pane, new_pane):
734739
735740 return new_line
736741
737- def action_cycle_documents (self , widget ):
738- pane = self ._get_focused_pane ()
739- new_pane = (pane + 1 ) % self .num_panes
742+ def move_cursor_pane (self , pane , new_pane ):
740743 chunk , line = self .cursor .chunk , self .cursor .line
741-
742744 new_line = self ._corresponding_chunk_line (chunk , line , pane , new_pane )
743745
744746 new_buf = self .textbuffer [new_pane ]
@@ -747,6 +749,16 @@ def action_cycle_documents(self, widget):
747749 self .textview [new_pane ].scroll_to_mark (
748750 new_buf .get_insert (), 0.1 , True , 0.5 , 0.5 )
749751
752+ def action_prev_pane (self , * args ):
753+ pane = self ._get_focused_pane ()
754+ new_pane = (pane - 1 ) % self .num_panes
755+ self .move_cursor_pane (pane , new_pane )
756+
757+ def action_next_pane (self , * args ):
758+ pane = self ._get_focused_pane ()
759+ new_pane = (pane + 1 ) % self .num_panes
760+ self .move_cursor_pane (pane , new_pane )
761+
750762 def _set_external_action_sensitivity (self ):
751763 have_file = self .focus_pane is not None
752764 try :
@@ -1862,7 +1874,6 @@ def set_num_panes(self, n):
18621874 widget .hide ()
18631875
18641876 self .actiongroup .get_action ("MakePatch" ).set_sensitive (n > 1 )
1865- self .actiongroup .get_action ("CycleDocuments" ).set_sensitive (n > 1 )
18661877
18671878 def coords_iter (i ):
18681879 buf_index = 2 if i == 1 and self .num_panes == 3 else i
0 commit comments