Skip to content

Commit a68d561

Browse files
committed
improve opening relevant file
1 parent 5241435 commit a68d561

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/python-debugger-view.coffee

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ class PythonDebuggerView extends View
111111

112112
if lineNumber && fileName
113113
lineNumber = parseInt(lineNumber)
114-
options = {initialLine: lineNumber-1, initialColumn:0}
115-
atom.workspace.open(fileName, options) if fs.existsSync(fileName)
116-
# TODO: add decoration to current line?
114+
atom.workspace.open(fileName).then (editor) ->
115+
position = Point(lineNumber - 1, 0)
116+
editor.setCursorBufferPosition(position)
117+
editor.unfoldBufferRow(lineNumber)
118+
editor.scrollToBufferPosition(position)
119+
# TODO: add decoration to current line?
117120

118121
@addOutput(data_str.trim())
119122

0 commit comments

Comments
 (0)