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,
|
right = right,
|
||||||
width = right-left,
|
width = right-left,
|
||||||
|
|
||||||
filename = love.filesystem.getUserDirectory()..'/lines.txt',
|
filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows
|
||||||
next_save = nil,
|
next_save = nil,
|
||||||
|
|
||||||
-- undo
|
-- undo
|
||||||
|
|
5
run.lua
5
run.lua
|
@ -141,8 +141,9 @@ function run.settings()
|
||||||
Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
|
Settings.x, Settings.y, Settings.displayindex = love.window.getPosition()
|
||||||
end
|
end
|
||||||
local filename = Editor_state.filename
|
local filename = Editor_state.filename
|
||||||
if filename:sub(1,1) ~= '/' then
|
local os_path_separator = package.config:sub(1,1)
|
||||||
filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
|
if filename:sub(1,1) ~= os_path_separator then
|
||||||
|
filename = love.filesystem.getWorkingDirectory()..os_path_separator..filename
|
||||||
end
|
end
|
||||||
return {
|
return {
|
||||||
x=Settings.x, y=Settings.y, displayindex=Settings.displayindex,
|
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()
|
Settings.source.x, Settings.source.y, Settings.source.displayindex = love.window.getPosition()
|
||||||
end
|
end
|
||||||
local filename = Editor_state.filename
|
local filename = Editor_state.filename
|
||||||
if filename:sub(1,1) ~= '/' then
|
local os_path_separator = package.config:sub(1,1)
|
||||||
filename = love.filesystem.getWorkingDirectory()..'/'..filename -- '/' should work even on Windows
|
if filename:sub(1,1) ~= os_path_separator then
|
||||||
|
filename = love.filesystem.getWorkingDirectory()..os_path_separator..filename
|
||||||
end
|
end
|
||||||
--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)
|
--? print('saving source settings', Settings.source.x, Settings.source.y, Settings.source.displayindex)
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -100,7 +100,7 @@ function edit.initialize_state(top, left, right, font_height, line_height) -- c
|
||||||
right = right,
|
right = right,
|
||||||
width = right-left,
|
width = right-left,
|
||||||
|
|
||||||
filename = love.filesystem.getUserDirectory()..'/lines.txt',
|
filename = love.filesystem.getUserDirectory()..'/lines.txt', -- '/' should work even on Windows
|
||||||
next_save = nil,
|
next_save = nil,
|
||||||
|
|
||||||
-- undo
|
-- undo
|
||||||
|
|
Loading…
Reference in New Issue