source: support only relative paths within the app

This commit is contained in:
Kartik K. Agaram 2022-09-19 00:08:52 -07:00
parent 6d1dee38f0
commit aae35c7e04
1 changed files with 2 additions and 5 deletions

View File

@ -260,16 +260,13 @@ function source.settings()
--? print('reading source window position')
Settings.source.x, Settings.source.y, Settings.source.displayindex = App.screen.position()
end
local filename = Editor_state.filename
if is_relative_path(filename) then
filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
end
--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)
print(Editor_state.filename)
return {
x=Settings.source.x, y=Settings.source.y, displayindex=Settings.source.displayindex,
width=App.screen.width, height=App.screen.height,
font_height=Editor_state.font_height,
filename=filename,
filename=Editor_state.filename,
screen_top=Editor_state.screen_top1, cursor=Editor_state.cursor1,
show_log_browser_side=Show_log_browser_side,
focus=Focus,