mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Fix #3800: daft bug
I really feel like the tooling should have told us about this
This commit is contained in:
parent
baae7018a9
commit
1a4dcddec2
1 changed files with 5 additions and 2 deletions
|
@ -337,6 +337,7 @@ export async function editor() {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ans
|
||||||
try {
|
try {
|
||||||
let text = ""
|
let text = ""
|
||||||
let line = 0
|
let line = 0
|
||||||
|
@ -347,18 +348,20 @@ export async function editor() {
|
||||||
})(elem)
|
})(elem)
|
||||||
const file = (await Native.temp(text, document.location.hostname)).content
|
const file = (await Native.temp(text, document.location.hostname)).content
|
||||||
const exec = await Native.editor(file, line, col)
|
const exec = await Native.editor(file, line, col)
|
||||||
|
console.log(exec)
|
||||||
if (exec.code == 0) {
|
if (exec.code == 0) {
|
||||||
fillinput(selector, exec.content)
|
fillinput(selector, exec.content)
|
||||||
|
|
||||||
// TODO: add annoying "This message was written with [Tridactyl](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/)" to everything written using editor
|
// TODO: add annoying "This message was written with [Tridactyl](https://addons.mozilla.org/en-US/firefox/addon/tridactyl-vim/)" to everything written using editor
|
||||||
return [file, exec.content]
|
ans = [file, exec.content]
|
||||||
} else {
|
} else {
|
||||||
logger.debug(`Editor terminated with non-zero exit code: ${exec.code}`)
|
logger.debug(`Editor terminated with non-zero exit code: ${exec.code}`)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error(`:editor failed: ${e}`)
|
throw new Error(`:editor failed: ${e}`)
|
||||||
} finally {
|
} finally {
|
||||||
return removeTridactylEditorClass(selector)
|
removeTridactylEditorClass(selector)
|
||||||
|
return ans
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue