tiny refactor

remotes/origin/HEAD
pseudometa 2022-11-22 00:29:28 +01:00
parent 03e8711488
commit b9f04ae0f2
1 changed files with 6 additions and 7 deletions

View File

@ -64,15 +64,14 @@ local function fileOp(op)
cmd("edit " .. filepath) cmd("edit " .. filepath)
cmd("bdelete #") cmd("bdelete #")
vim.notify(" Renamed '" .. oldName .. "' to '" .. newName .. "'.") vim.notify(" Renamed '" .. oldName .. "' to '" .. newName .. "'.")
elseif op == "new" then elseif op == "new" or op == "newFromSel" then
cmd("edit " .. filepath)
cmd("write " .. filepath)
elseif op == "newFromSel" then
cmd("edit " .. filepath) cmd("edit " .. filepath)
cmd("write " .. filepath) cmd("write " .. filepath)
if op == "newFromSel" then
cmd("put z") cmd("put z")
fn.setreg("z", prevReg) -- restore register content fn.setreg("z", prevReg) -- restore register content
end end
end
end) end)
end end