handle missing cursors in settings

[?]
Sep 19, 2022, 7:41 AM
S3PNFXTB4EF4PR4RMDK3YX5HTBJP2U6GRBX5UWAMUFBC5CRPOWZAC

Dependencies

  • [2] SDO4DHNU source: load cursor position from settings
  • [3] JMUD7T3O get rid of ugly side-effects in tests
  • [4] KKMFQDR4 editing source code from within the app

Change contents

  • replacement in source.lua at line 132
    [3.169643][2.181:394]()
    File_navigation.cursors = settings.cursors
    Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1
    Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1
    [3.169643]
    [3.169733]
    if settings.cursors then
    File_navigation.cursors = settings.cursors
    Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1
    Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1
    else
    -- migrate old settings
    Editor_state.screen_top1 = {line=1, pos=1}
    Editor_state.cursor1 = {line=1, pos=1}
    end