mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
Merge pull request #1483 from tridactyl/improve_editor
Actually make tridactyl listen for `:editor` return code
This commit is contained in:
commit
9b02a1ac22
1 changed files with 5 additions and 2 deletions
|
@ -250,11 +250,14 @@ export async function editor(file: string, line: number, col: number, content?:
|
|||
: config.get("editorcmd"))
|
||||
.replace(/%l/, line)
|
||||
.replace(/%c/, col)
|
||||
let exec
|
||||
if (editorcmd.indexOf("%f") !== -1) {
|
||||
await run(editorcmd.replace(/%f/, file))
|
||||
exec = await run(editorcmd.replace(/%f/, file))
|
||||
} else {
|
||||
await run(editorcmd + " " + file)
|
||||
exec = await run(editorcmd + " " + file)
|
||||
}
|
||||
if (exec.code != 0)
|
||||
return exec
|
||||
return read(file)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue