Merge lines.love
[?]
Mar 26, 2023, 4:43 PM
Z5WOBP27DT46JXRZGX6SNDHZSTY7G77V4FB6B62QQIGUZ7MT45TACDependencies
- [2]
VN3MTXFKMerge lines.love - [3]
AF253GHLbugfix - [4]
LNUHQOGHstart passing in Editor_state explicitly - [5]
7VGDIPLCmore robust state validation - [*]
2L5MEZV3experiment: new edit namespace
Change contents
- resurrect zombie in edit.lua at line 114
if loc1.line > #State.lines then return true endlocal l = State.lines[loc1.line]if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing linereturn loc1.pos > #State.lines[loc1.line].data - edit in edit.lua at line 114
function edit.check_locs(State)-- if State is inconsistent (i.e. file changed by some other program),-- throw away all cursor state entirelyif edit.invalid1(State, State.screen_top1)or edit.invalid1(State, State.cursor1)or not edit.cursor_on_text(State)or not Text.le1(State.screen_top1, State.cursor1) thenState.screen_top1 = {line=1, pos=1}edit.put_cursor_on_first_text_line(State)endendfunction edit.invalid1(State, loc1) - edit in edit.lua at line 131
endfunction edit.cursor_on_text(State)return State.cursor1.line <= #State.linesand State.lines[State.cursor1.line].mode == 'text'endfunction edit.put_cursor_on_first_text_line(State)for i,line in ipairs(State.lines) doif line.mode == 'text' thenState.cursor1 = {line=i, pos=1}breakendendend