@@ -73,6 +73,17 @@ def get_status(self):
73
73
'message' : self .file_history .current_commit .message ,
74
74
}
75
75
76
+ def _update_mapping (self , start , finish ):
77
+ mapping = self .file_history .line_mapping (start , finish )
78
+ new_highlight_line = mapping .get (self .highlight_line )
79
+ if new_highlight_line is not None :
80
+ self .highlight_line = new_highlight_line
81
+ else :
82
+ # The highlight_line setter validates the value, so it makes
83
+ # sense to set it to the same value here to make sure that it's
84
+ # not out of range for the newly loaded revision of the file.
85
+ self .highlight_line = self .highlight_line
86
+
76
87
def _move_commit (self , method_name ):
77
88
start = self .file_history .current_commit .sha
78
89
@@ -83,15 +94,7 @@ def _move_commit(self, method_name):
83
94
84
95
finish = self .file_history .current_commit .sha
85
96
86
- mapping = self .file_history .line_mapping (start , finish )
87
- new_highlight_line = mapping .get (self .highlight_line )
88
- if new_highlight_line is not None :
89
- self .highlight_line = new_highlight_line
90
- else :
91
- # The highlight_line setter validates the value, so it makes
92
- # sense to set it to the same value here to make sure that it's
93
- # not out of range for the newly loaded revision of the file.
94
- self .highlight_line = self .highlight_line
97
+ self ._update_mapping (start , finish )
95
98
96
99
@ModalScrollingInterface .key_bindings (']' )
97
100
def next_commit (self , times = 1 ):
0 commit comments