Skip to content

Commit 24d5d84

Browse files
authored
fix: correctly show error when the third parameter is not passed (#153)
The UNC path error was not shown when the third parameter was passed, because the parameter normalization happened after it.
1 parent 7bae9bc commit 24d5d84

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎packages/launch-editor/index.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ let currentChildProcess = null
6464
function launchEditor(file, specifiedEditor, onErrorCallback) {
6565
const { fileName, lineNumber, columnNumber } = parseFile(file)
6666

67+
if (typeof specifiedEditor === 'function') {
68+
onErrorCallback = specifiedEditor
69+
specifiedEditor = undefined
70+
}
71+
72+
onErrorCallback = wrapErrorCallback(onErrorCallback)
73+
6774
if (process.platform === 'win32' && path.resolve(fileName).startsWith('\\\\')) {
6875
return onErrorCallback(
6976
fileName,
@@ -76,13 +83,6 @@ function launchEditor(file, specifiedEditor, onErrorCallback) {
7683
return
7784
}
7885

79-
if (typeof specifiedEditor === 'function') {
80-
onErrorCallback = specifiedEditor
81-
specifiedEditor = undefined
82-
}
83-
84-
onErrorCallback = wrapErrorCallback(onErrorCallback)
85-
8686
const [editor, ...args] = guessEditor(specifiedEditor)
8787
if (!editor) {
8888
onErrorCallback(fileName, null)

0 commit comments

Comments
 (0)