fix: new file w/o input uses "Untitled" as name
parent
2daec5dbd1
commit
67b663daa0
|
|
@ -64,7 +64,7 @@ local function fileOp(op)
|
||||||
local sameName = newName == oldName
|
local sameName = newName == oldName
|
||||||
local emptyInput = newName == ""
|
local emptyInput = newName == ""
|
||||||
|
|
||||||
if invalidName or sameName or emptyInput then
|
if invalidName or sameName or (emptyInput and op ~= "new") then
|
||||||
if op == "newFromSel" then
|
if op == "newFromSel" then
|
||||||
cmd.undo() -- undo deletion
|
cmd.undo() -- undo deletion
|
||||||
fn.setreg("z", prevReg) -- restore register content
|
fn.setreg("z", prevReg) -- restore register content
|
||||||
|
|
@ -77,6 +77,9 @@ local function fileOp(op)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- exception: new file creaton allows for empty input
|
||||||
|
if emptyInput and op == "new" then newName = "Untitled" end
|
||||||
|
|
||||||
-- DETERMINE PATH AND EXTENSION
|
-- DETERMINE PATH AND EXTENSION
|
||||||
local hasPath = newName:find("/")
|
local hasPath = newName:find("/")
|
||||||
if hasPath then
|
if hasPath then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue