File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -187,12 +187,13 @@ def mark_selected_line(line_number)
187187 def scroll_ruby_to_selected_ast
188188 @ast_view . selection_model . selected_item_property . add_change_listener do |ast_tree_cell |
189189 start_line = ast_tree_cell . node . position . start_line
190+ # first mark the line then scroll to it
191+ mark_selected_line ( start_line )
190192 line_pixels = self . class . pixel_height_of_line
191193 # calculate the actual height of the current line in pixels
192194 scroll_to_pixels = line_pixels * start_line
193195 # scroll to start position of current ast tree cell
194196 @ruby_view . set_scroll_top ( scroll_to_pixels )
195- mark_selected_line ( start_line )
196197 end
197198 @ast_view . selection_model . set_selected_item ( @ast_view . root )
198199 end
You can’t perform that action at this time.
0 commit comments