Skip to content

Commit

Permalink
chore: make luacheck happy
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Dec 27, 2023
1 parent 3afbadb commit 9021c7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/neorg/modules/core/tangle/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,15 @@ module.on_event = function(event)

for file, content in pairs(tangles) do
local upward_count = 0

for _ in string.gmatch(file, "%.%.[\\/]") do
upward_count = upward_count + 1
end

if upward_count > 0 then
-- adding one because the filename also has to be removed
local base = vim.fn.fnamemodify(vim.fn.expand("%"), ":p" .. string.rep(":h", upward_count + 1))
local path, _count = string.gsub(file, "%.%.[\\/]", "")
local path = string.gsub(file, "%.%.[\\/]", "")
file = vim.fs.joinpath(base, path)
end

Expand Down

0 comments on commit 9021c7c

Please sign in to comment.