Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't suggest leading chars for file completions #1574

Merged
merged 1 commit into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions lua/neorg/modules/core/completion/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module.private = {
if not file:samefile(Path.new(vim.api.nvim_buf_get_name(0))) then
local rel = file:relative_to(files[1], false)
if rel and rel:len() > 0 then
local link = "{:$/" .. rel:with_suffix(""):tostring() .. closing_chars
local link = "$/" .. rel:with_suffix(""):tostring() .. closing_chars
table.insert(res, link)
end
end
Expand All @@ -160,14 +160,11 @@ module.private = {
end
local links = module.private.get_linkables(source, node_type)
local closing_chars = module.private.get_closing_chars(context, false)
return vim.tbl_map(function(x)
return leading_whitespace .. x.title .. closing_chars
end, links)
-- return vim.iter(links)
-- :map(function(x)
-- return leading_whitespace .. x.title .. closing_chars
-- end)
-- :totable()
return vim.iter(links)
:map(function(x)
return leading_whitespace .. x.title .. closing_chars
end)
:totable()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and since we're supporting 0.10+ now, I've dropped the soon to be deprecated tbl_map.

end,

--- All the things that you can link to (`{#|}` completions)
Expand Down
Loading