several bugfixes in saving/loading cursor position
[?]
Jun 8, 2023, 8:02 AM
SW7BSBMJZLUDRMHO2HMCHQW6PPGCEBL4JSDTAHVYPCZLBEKY54XQCDependencies
- [2]
NFI42KGXmore correct absolute path detection - [3]
ZQDQLLCLbugfix - [4]
5RDWSYK2consistently use App names for methods everywhere - [5]
AF253GHLbugfix - [6]
EWJZ6XHBbetter formatting - [7]
2L5MEZV3experiment: new edit namespace - [8]
CQYKYJJUremember window positions across restart/ctrl+e - [9]
QZ2SXLHFsome debug prints - [10]
ZJOSQFN6bugfix: path munging on Windows - [11]
7VGDIPLCmore robust state validation - [12]
KKMFQDR4editing source code from within the app - [*]
BJ5X5O4Alet's prevent the text cursor from ever getting on a drawing
Change contents
- replacement in run.lua at line 22
if #arg > 0 thenif #arg > 0 and Editor_state.filename ~= absolutize(arg[1]) then - edit in run.lua at line 156[4.653]→[7.198:204](∅→∅),[7.198]→[7.198:204](∅→∅),[7.204]→[7.182570:182611](∅→∅),[7.182570]→[7.182570:182611](∅→∅),[7.182611]→[2.652:793](∅→∅)
endlocal filename = Editor_state.filenameif is_relative_path(filename) thenfilename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows - replacement in run.lua at line 161
filename=filename,filename=absolutize(Editor_state.filename), - edit in run.lua at line 166
function absolutize(path)if is_relative_path(path) thenreturn love.filesystem.getWorkingDirectory()..'/'..path -- '/' should work even on Windowsendreturn pathend - replacement in edit.lua at line 112
or edit.invalid1(State, State.cursor1)or edit.invalid_cursor1(State) - edit in edit.lua at line 125
end-- cursor loc in particular differs from other locs in one way:-- pos might occur just after end of linefunction edit.invalid_cursor1(State)local cursor1 = State.cursor1if cursor1.line > #State.lines then return true endlocal l = State.lines[cursor1.line]if l.mode ~= 'text' then return false end -- pos is irrelevant to validity for a drawing linereturn cursor1.pos > #State.lines[cursor1.line].data + 1 - edit in Manual_tests.md at line 8
- run with a filename on commandline, scroll around, quit; restart without a filename; window opens running the text editor in same position+dimensions- run with a filename on commandline, scroll around, quit; restart with same filename; window opens running the text editor in same position+dimensions- run with a filename on commandline, scroll around, quit; restart with new filename; window opens new filename with cursor up top- run editor, scroll around, move cursor to end of some line, quit; restart with new filename; window opens running the text editor in same position+dimensions