Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ function buffer.op_undo(b, sl)
if sl.op == "del" then
return b:bufins(sl, true)
elseif sl.op == "ins" then
return b:bufdel(sl.ci+#sl-1, sl.cj+ulen(sl[#sl]), true)
if #sl == 1 then -- Insertion was limited to part of a single line
return b:bufdel(sl.ci+#sl-1, sl.cj+ulen(sl[#sl]), true)
else -- Insertion spanned multiple lines
return b:bufdel(sl.ci+#sl-1, ulen(sl[#sl]), true)
end
else
return nil, "unknown op"
end
Expand Down
7 changes: 6 additions & 1 deletion ple.lua
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,12 @@ function e.exiteditor(b)
end
if anyunsaved then
local ch = readchar(
"Some buffers not saved. Quit? ", "[YNQynq\r\n]")
"Some buffers not saved. Quit? ", "[YNQynq\r\n\24]")
if ch == "\24" then -- ^X
msg("^X")
e.prefix_ctlx(b)
return
end
if ch ~= "y" and ch ~= "Y" then
msg("aborted.")
return
Expand Down