-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Yeah, an issue for a Minecraft version of vi.
Anyway,
Steps to reproduce
- Open
vi
on any CC: Tweaked computer. - Enter insert mode, write something on the first line and return to normal mode
- Write
dd
Expected behaviour
The first line should be blanked, returning you to an empty file
Actual behaviour
vi.lua:573: attempt to get length of field '?' (a nil value)
|Line 573
| if newX > #lines[newY] then
|
> _
I do see that it is marked with TODO: Fix
, and I think the time may be approaching when the number of users (approximately 1) has risen so high that the application may require maintenance again.
Non-expert diagnosis
You're deleting the line. That's fine, unless we're on the first line, in which case setCursor
tries to read the length of that line. lines
should be used safely if it can ever be empty, or unsafely only if it is guaranteed to never be. I've personally taken the liberty of defining
local function removeLine(lineY)
table.remove(lines,lineY)
if #lines == 0 then
table.insert(lines, "")
end
end
and replaced each table.remove(lines,y)
with it. This seems to have largely repaired the issue.
Metadata
Metadata
Assignees
Labels
No labels