Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit c682e73

Browse files
committed
reuse method to focus current line
1 parent c545536 commit c682e73

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

pugdebug/pugdebug.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -401,20 +401,17 @@ def focus_current_line(self):
401401
current_file = self.debugger.get_current_file()
402402
current_line = self.debugger.get_current_line()
403403

404-
self.open_document(current_file)
404+
self.jump_to_line_in_file(current_file, current_line, True)
405405

406-
document_widget = self.document_viewer.get_current_document()
407-
document_widget.move_to_line(current_line)
408-
409-
def jump_to_line_in_file(self, file, line):
406+
def jump_to_line_in_file(self, file, line, is_current=False):
410407
"""Jump to a line in a file.
411408
412409
Show the document, and scroll to the given line.
413410
"""
414411
self.open_document(file)
415412

416413
document_widget = self.document_viewer.get_current_document()
417-
document_widget.move_to_line(line, False)
414+
document_widget.move_to_line(line, is_current)
418415

419416
def handle_settings_changed(self, changed_settings):
420417
"""Handle when settings have changed.

0 commit comments

Comments
 (0)