separate error log from Cache

This commit is contained in:
Kartik K. Agaram 2022-11-20 13:40:22 -08:00
parent 1fcaf1f905
commit 0446035e17
3 changed files with 4 additions and 8 deletions

View File

@ -997,9 +997,7 @@ function command.reload_all()
table.insert(column_names, column.name)
end
Surface = {}
cache_errors = Cache['errors']
Cache = {}
Cache['errors'] = cache_errors
local old_viewport = {x=Display_settings.x, y=Display_settings.y}
local old_cursor_pane = Cursor_pane
Cursor_pane = {col=0,row=1}

View File

@ -1,7 +1,7 @@
function add_error(err)
print(err)
table.insert(Cache['errors'].lines, {mode='text', data=err})
table.insert(Cache['errors'].line_cache, {})
table.insert(Error_log.lines, {mode='text', data=err})
table.insert(Error_log.line_cache, {})
Current_error = err
Current_error_time = App.getTime()
Current_error_text = App.newText(love.graphics.getFont(), err)

View File

@ -49,8 +49,6 @@ function run.initialize_globals()
-- share data between such aliases:
-- line contents when panes are not editable (editable panes can diverge)
-- links between files (never in Surface, can never diverge between panes)
-- One constraint on Cache: it must always include a properly saved 'errors'
-- element (created further down in this function).
Cache = {}
-- LÖVE renders N frames per second like any game engine, but we don't
@ -123,8 +121,8 @@ function run.initialize_globals()
-- blinking cursor
Cursor_time = 0
-- errors are not persisted, and stored in Cache['errors']
Cache['errors'] = {id='errors', filename=Directory..'errors', left=0, right=Display_settings.column_width, lines={}, line_cache={}}
-- a read-only buffer for errors
Error_log = {id='errors', filename=Directory..'errors', left=0, right=Display_settings.column_width, lines={}, line_cache={}}
Current_error = nil
Current_error_text = nil
Current_error_time = nil