now editor wont wipe files when ctrl+c

This commit is contained in:
Productive2 2021-02-18 22:27:36 +01:00
parent f4441b77b4
commit c913d4657d
1 changed files with 5 additions and 1 deletions

View File

@ -14,11 +14,15 @@ if paramCount() > 0:
let arg = paramStr(1)
if fileExists(arg):
e.content = readFile(arg).fromString()
var save = false
e.bindKey("ctrl+s"):
e.finish()
save = true
e.prompt = ""
e.populateDefaults(enterSubmits = false, shiftForVerticalMove = false)
let result = e.read()
if paramCount() > 0:
if save and paramCount() > 0:
writeFile(paramStr(1), result)