diff options
Diffstat (limited to 'source.lua')
-rw-r--r-- | source.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source.lua b/source.lua index c582953..dbf1640 100644 --- a/source.lua +++ b/source.lua @@ -86,8 +86,13 @@ end function source.initialize_edit_side() load_from_disk(Editor_state) Text.redraw_all(Editor_state) - Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1 - Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1 + if File_navigation.cursors[Editor_state.filename] then + Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1 + Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1 + else + Editor_state.screen_top1 = {line=1, pos=1} + Editor_state.cursor1 = {line=1, pos=1} + end -- We currently start out with side B collapsed. -- Other options: @@ -129,6 +134,7 @@ function source.load_settings() end Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3)) Editor_state.filename = settings.filename + Editor_state.filename = basename(Editor_state.filename) -- migrate settings that used full paths; we now support only relative paths within the app if settings.cursors then File_navigation.cursors = settings.cursors Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1 |