forked from izaya/OC-PsychOS2
made vi not choke when opening a new file, as well as actually preserve the file name
This commit is contained in:
parent
0db31a2e27
commit
d12ec38016
@ -112,6 +112,7 @@ function ed.newBuffer()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ed.open(buffer)
|
function ed.open(buffer)
|
||||||
|
local bpath = buffer
|
||||||
if ed.buffers[buffer] then
|
if ed.buffers[buffer] then
|
||||||
buffer = ed.buffers[buffer]
|
buffer = ed.buffers[buffer]
|
||||||
end
|
end
|
||||||
@ -120,7 +121,9 @@ function ed.open(buffer)
|
|||||||
nb:load(buffer)
|
nb:load(buffer)
|
||||||
buffer = nb
|
buffer = nb
|
||||||
end
|
end
|
||||||
if type(buffer) ~= "table" then buffer = ed.newBuffer() buffer[1] = "" end
|
if type(buffer) ~= "table" then buffer = ed.newBuffer() end
|
||||||
|
buffer[1] = buffer[1] or ""
|
||||||
|
buffer.path = buffer.path or bpath
|
||||||
return buffer
|
return buffer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user