SAATXLBLJS4VRZAFGDCKO45AKVFLS7TNXN4SZLBNOSPE7SKGKB2AC Y7UTUTXR5YTRQTXQJXYHFXYY5R4RRI2YJDUESNTJYRNDGGKI7PXQC Y6PFNT7WA3C36JCPR4ZD4PKKB4JIIW46CDAKKP2C5EHGDVVCIONAC U3MJNFUY4ER65BIKP4D7JGVYWFPXA55KBJYD4RH5KRRKRQXBAW5AC R5QXEHUIZLELJGGCZAE7ATNS3CLRJ7JFRENMGH4XXH24C5WABZDQC 2L5MEZV344TOZLVY3432RHJFIRVXFD6O3GWLL5O4CV66BGAFTURQC 3VHUIIATPOF7FXB7NTL5MESCV5BCQACII2D7QZ4UIUCBX3CWXMMAC 7VGDIPLCFDG3PVE4JH3WDKZ4A7PG5UYW7TLFFFOWN2JEUZYYTFJQC JOPVPUSAMMU6RFVDQR4NJC4GNNUFB7GPKVH7OS5FKCYS5QZ53VLQC QODI6X4IBV44K2RLBGW6QMILEXGKWJZWWERLQF22FN75QKZTWOPAC 7SPB6HJVEIJUBSADN6DN76Z42NJ46I3VMUXGRPCHJFVRRPMZ4TLAC LLQC2M2IMEJBJQXZTKC3OAKG5WKHSERXKAKCYHQRUZZD6CVRIHAQC 3PSFWAILGRA4OYXWS2DX7VF332AIBPYBXHEA4GIQY2XEJVD65UMAC FXI74QCLOZ4BS7UVZ3U2PE3LOL7MX3FWGHZCTGH3DYFXGTXVVIRAC 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 Text.le1(State.screen_top1, State.cursor1) thenState.screen_top1 = {line=1, pos=1}endendfunction edit.invalid1(State, loc1)return loc1.line > #State.linesor loc1.pos > #State.lines[loc1.line].dataendState.cursor1 = {line=1, pos=1}
edit.check_locs(Editor_state)-- We currently start out with side B collapsed.-- Other options:-- * save all expanded state by line-- * expand all if any location is in side Bif Editor_state.cursor1.line > #Editor_state.lines thenEditor_state.cursor1 = {line=1, pos=1}endif Editor_state.screen_top1.line > #Editor_state.lines thenEditor_state.screen_top1 = {line=1, pos=1}endedit.eradicate_locations_after_the_fold(Editor_state)if rawget(_G, 'jit') thenjit.off()jit.flush()endendfunction source.load_settings()local settings = Settings.sourcelove.graphics.setFont(love.graphics.newFont(settings.font_height))-- maximize window to determine maximum allowable dimensions
edit.check_locs(Editor_state)love.window.setTitle('text.love - '..Editor_state.filename)endfunction run.draw()edit.draw(Editor_state)endfunction run.update(dt)Cursor_time = Cursor_time + dtedit.update(Editor_state, dt)endfunction run.quit()edit.quit(Editor_state)endfunction run.settings()edit.check_locs(Editor_state)love.window.setTitle('text.love - '..Editor_state.filename)if #arg > 1 thenprint('ignoring commandline args after '..arg[1])endif rawget(_G, 'jit') thenjit.off()jit.flush()endendfunction run.load_settings()love.graphics.setFont(love.graphics.newFont(Settings.font_height))
next_save = nil,-- undohistory = {},next_history = 1,-- searchsearch_term = nil,search_text = nil,search_backup = nil, -- stuff to restore when cancelling search}return resultend -- App.initialize_state
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)return loc1.line > #State.linesor loc1.pos > #State.lines[loc1.line].dataendfunction 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)