bugfix: path munging on Windows
This commit is contained in:
parent
06c784b576
commit
511db8cffd
2
edit.lua
2
edit.lua
|
@ -94,7 +94,7 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c
|
|||
right = right,
|
||||
width = right-left,
|
||||
|
||||
filename = love.filesystem.getUserDirectory()..'/lines.txt',
|
||||
filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows
|
||||
next_save = nil,
|
||||
|
||||
-- undo
|
||||
|
|
5
run.lua
5
run.lua
|
@ -141,8 +141,9 @@ function run.settings()
|
|||
Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
|
||||
end
|
||||
local filename = Editor_state.filename
|
||||
if filename:sub(1,1) ~= '/' then
|
||||
filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
|
||||
local os_path_separator = package.config:sub(1,1)
|
||||
if filename:sub(1,1) ~= os_path_separator then
|
||||
filename = love.filesystem.getWorkingDirectory()..os_path_separator..filename
|
||||
end
|
||||
return {
|
||||
x=Settings.x, y=Settings.y, displayindex=Settings.displayindex,
|
||||
|
|
|
@ -257,8 +257,9 @@ function source.settings()
|
|||
Settings.source.x, Settings.source.y, Settings.source.displayindex = love.window.getPosition()
|
||||
end
|
||||
local filename = Editor_state.filename
|
||||
if filename:sub(1,1) ~= '/' then
|
||||
filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
|
||||
local os_path_separator = package.config:sub(1,1)
|
||||
if filename:sub(1,1) ~= os_path_separator then
|
||||
filename = love.filesystem.getWorkingDirectory()..os_path_separator..filename
|
||||
end
|
||||
--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)
|
||||
return {
|
||||
|
|
|
@ -100,7 +100,7 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c
|
|||
right = right,
|
||||
width = right-left,
|
||||
|
||||
filename = love.filesystem.getUserDirectory()..'/lines.txt',
|
||||
filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows
|
||||
next_save = nil,
|
||||
|
||||
-- undo
|
||||
|
|
Loading…
Reference in New Issue