source: load cursor position from settings

This commit is contained in:
Kartik K. Agaram 2022-09-19 00:17:36 -07:00
parent 34dc49849b
commit 12b1d19761
1 changed files with 5 additions and 2 deletions

View File

@ -86,6 +86,8 @@ 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
-- We currently start out with side B collapsed.
-- Other options:
@ -127,8 +129,9 @@ 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.screen_top1 = settings.screen_top
Editor_state.cursor1 = settings.cursor
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
end
function source.set_window_position_from_settings(settings)