Fix function formatting getting zettel from dir
This commit is contained in:
parent
5228a3b49e
commit
e31630a8c4
4 changed files with 9 additions and 5 deletions
|
|
@ -64,12 +64,13 @@ end
|
|||
-- Take a list of zettel as an optional variable, without which
|
||||
-- it will use the (recursive) results of the zettel_root directory.
|
||||
function ls.get_zettel(anchor, all)
|
||||
local zettels = all or
|
||||
ls.get_anchors_and_paths(
|
||||
ls.get_all_files(o.zettel().rootdir, true))
|
||||
if not zettels then return end
|
||||
if not all then
|
||||
local files = ls.get_all_files(o.zettel().rootdir, true)
|
||||
all = ls.get_anchors_and_paths(files)
|
||||
end
|
||||
if not all then return end
|
||||
|
||||
return zettels[anchor]
|
||||
return all[anchor]
|
||||
end
|
||||
|
||||
return ls
|
||||
|
|
|
|||
|
|
@ -167,4 +167,5 @@ describe("get_zettel", function()
|
|||
ls.get_zettel(expected)
|
||||
assert.stub(fc).was_called_with(expected, true)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue