handle missing cursors in settings
This commit is contained in:
parent
690a1c334c
commit
2f7b08fb8b
12
source.lua
12
source.lua
|
@ -129,9 +129,15 @@ function source.load_settings()
|
||||||
end
|
end
|
||||||
Editor_state = edit.initialize_state(Margin_top, Margin_left, right, settings.font_height, math.floor(settings.font_height*1.3))
|
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 = settings.filename
|
||||||
File_navigation.cursors = settings.cursors
|
if settings.cursors then
|
||||||
Editor_state.screen_top1 = File_navigation.cursors[Editor_state.filename].screen_top1
|
File_navigation.cursors = settings.cursors
|
||||||
Editor_state.cursor1 = File_navigation.cursors[Editor_state.filename].cursor1
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
function source.set_window_position_from_settings(settings)
|
function source.set_window_position_from_settings(settings)
|
||||||
|
|
Loading…
Reference in New Issue