Merge text.love
This commit is contained in:
commit
b30b25a9f9
|
@ -31,7 +31,7 @@ Lua is dynamically typed. Tests can't patch over lack of type-checking.
|
||||||
For example, `string.sub` should never use a `_pos`, only an `_offset`.
|
For example, `string.sub` should never use a `_pos`, only an `_offset`.
|
||||||
|
|
||||||
* Some ADT/interface support would be helpful in keeping per-line state in
|
* Some ADT/interface support would be helpful in keeping per-line state in
|
||||||
sync. Any change to line data should clear line `fragments` and
|
sync. Any change to line data should clear the derived line property
|
||||||
`screen_line_starting_pos`.
|
`screen_line_starting_pos`.
|
||||||
|
|
||||||
* Some inputs get processed in love.textinput and some in love.keypressed.
|
* Some inputs get processed in love.textinput and some in love.keypressed.
|
||||||
|
|
2
app.lua
2
app.lua
|
@ -480,7 +480,7 @@ function App.disable_tests()
|
||||||
App.files = nativefs.getDirectoryItems
|
App.files = nativefs.getDirectoryItems
|
||||||
App.mkdir = nativefs.createDirectory
|
App.mkdir = nativefs.createDirectory
|
||||||
App.remove = nativefs.remove
|
App.remove = nativefs.remove
|
||||||
App.source_dir = love.filesystem.getSource()..'/'
|
App.source_dir = love.filesystem.getSource()..'/' -- '/' should work even on Windows
|
||||||
App.current_dir = nativefs.getWorkingDirectory()..'/'
|
App.current_dir = nativefs.getWorkingDirectory()..'/'
|
||||||
App.save_dir = love.filesystem.getSaveDirectory()..'/'
|
App.save_dir = love.filesystem.getSaveDirectory()..'/'
|
||||||
App.get_time = love.timer.getTime
|
App.get_time = love.timer.getTime
|
||||||
|
|
8
log.lua
8
log.lua
|
@ -21,13 +21,17 @@ function log_start(name, stack_frame_index)
|
||||||
if stack_frame_index == nil then
|
if stack_frame_index == nil then
|
||||||
stack_frame_index = 3
|
stack_frame_index = 3
|
||||||
end
|
end
|
||||||
log(stack_frame_index, '\u{250c} ' .. name)
|
-- I'd like to use the unicode character \u{250c} here, but it doesn't work
|
||||||
|
-- in OpenBSD.
|
||||||
|
log(stack_frame_index, '[ u250c ' .. name)
|
||||||
end
|
end
|
||||||
function log_end(name, stack_frame_index)
|
function log_end(name, stack_frame_index)
|
||||||
if stack_frame_index == nil then
|
if stack_frame_index == nil then
|
||||||
stack_frame_index = 3
|
stack_frame_index = 3
|
||||||
end
|
end
|
||||||
log(stack_frame_index, '\u{2518} ' .. name)
|
-- I'd like to use the unicode character \u{2518} here, but it doesn't work
|
||||||
|
-- in OpenBSD.
|
||||||
|
log(stack_frame_index, '] u2518 ' .. name)
|
||||||
end
|
end
|
||||||
|
|
||||||
function log_new(name, stack_frame_index)
|
function log_new(name, stack_frame_index)
|
||||||
|
|
|
@ -42,15 +42,15 @@ function log_browser.parse(State)
|
||||||
line.data = data
|
line.data = data
|
||||||
end
|
end
|
||||||
line.section_stack = table.shallowcopy(Section_stack)
|
line.section_stack = table.shallowcopy(Section_stack)
|
||||||
elseif line.data:match('\u{250c}') then
|
elseif line.data:match('%[ u250c') then
|
||||||
line.section_stack = table.shallowcopy(Section_stack) -- as it is at the beginning
|
line.section_stack = table.shallowcopy(Section_stack) -- as it is at the beginning
|
||||||
local section_name = line.data:match('\u{250c}%s*(.*)')
|
local section_name = line.data:match('u250c%s*(.*)')
|
||||||
table.insert(Section_stack, {name=section_name})
|
table.insert(Section_stack, {name=section_name})
|
||||||
line.section_begin = true
|
line.section_begin = true
|
||||||
line.section_name = section_name
|
line.section_name = section_name
|
||||||
line.data = nil
|
line.data = nil
|
||||||
elseif line.data:match('\u{2518}') then
|
elseif line.data:match('%] u2518') then
|
||||||
local section_name = line.data:match('\u{2518}%s*(.*)')
|
local section_name = line.data:match('] u2518%s*(.*)')
|
||||||
if array.find(Section_stack, function(x) return x.name == section_name end) then
|
if array.find(Section_stack, function(x) return x.name == section_name end) then
|
||||||
while table.remove(Section_stack).name ~= section_name do
|
while table.remove(Section_stack).name ~= section_name do
|
||||||
--
|
--
|
||||||
|
|
2
run.lua
2
run.lua
|
@ -163,7 +163,7 @@ end
|
||||||
|
|
||||||
function absolutize(path)
|
function absolutize(path)
|
||||||
if is_relative_path(path) then
|
if is_relative_path(path) then
|
||||||
return love.filesystem.getWorkingDirectory()..'/'..path -- '/' should work even on Windows
|
return App.current_dir..path
|
||||||
end
|
end
|
||||||
return path
|
return path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue