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 emptyInput = newName == ""
|
||||
|
||||
if invalidName or sameName or emptyInput then
|
||||
if invalidName or sameName or (emptyInput and op ~= "new") then
|
||||
if op == "newFromSel" then
|
||||
cmd.undo() -- undo deletion
|
||||
fn.setreg("z", prevReg) -- restore register content
|
||||
|
|
@ -77,6 +77,9 @@ local function fileOp(op)
|
|||
return
|
||||
end
|
||||
|
||||
-- exception: new file creaton allows for empty input
|
||||
if emptyInput and op == "new" then newName = "Untitled" end
|
||||
|
||||
-- DETERMINE PATH AND EXTENSION
|
||||
local hasPath = newName:find("/")
|
||||
if hasPath then
|
||||
|
|
|
|||
Loading…
Reference in New Issue