now editor wont wipe files when ctrl+c
This commit is contained in:
parent
f4441b77b4
commit
c913d4657d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue