Merge pull request #1483 from tridactyl/improve_editor

Actually make tridactyl listen for `:editor` return code
This commit is contained in:
Oliver Blanthorn 2019-04-19 10:38:23 +01:00 committed by GitHub
commit 9b02a1ac22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -250,11 +250,14 @@ export async function editor(file: string, line: number, col: number, content?:
: config.get("editorcmd")) : config.get("editorcmd"))
.replace(/%l/, line) .replace(/%l/, line)
.replace(/%c/, col) .replace(/%c/, col)
let exec
if (editorcmd.indexOf("%f") !== -1) { if (editorcmd.indexOf("%f") !== -1) {
await run(editorcmd.replace(/%f/, file)) exec = await run(editorcmd.replace(/%f/, file))
} else { } else {
await run(editorcmd + " " + file) exec = await run(editorcmd + " " + file)
} }
if (exec.code != 0)
return exec
return read(file) return read(file)
} }