2023-06-23 07:43:03 +01:00
|
|
|
initialize_item = function(id, depth)
|
2023-07-16 21:45:30 +01:00
|
|
|
local path
|
|
|
|
if depth == 0 then
|
|
|
|
path = full_path(id)
|
|
|
|
else
|
|
|
|
path = comment_path(id)
|
|
|
|
end
|
2023-06-23 07:43:03 +01:00
|
|
|
local result = {
|
|
|
|
type='text',
|
2023-07-16 21:45:30 +01:00
|
|
|
id=id, filename=path,
|
2023-06-23 07:43:03 +01:00
|
|
|
width=Width, depth=depth,
|
|
|
|
metadata=load_metadata(id),
|
|
|
|
border=Border_color,
|
|
|
|
}
|
2023-06-19 04:10:20 +01:00
|
|
|
load_from_disk(result)
|
2023-06-21 01:13:01 +01:00
|
|
|
-- massage schema slightly; this isn't an editor state
|
|
|
|
result.data = result.lines
|
|
|
|
result.lines = nil
|
2023-06-19 04:10:20 +01:00
|
|
|
return result
|
2023-06-23 02:17:01 +01:00
|
|
|
end
|