-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Error when opening link-not-found #1215
Comments
@vhyrro This is coming from this commit: 603b633 where you added the the second argument As you can see here:
What I'm confused tho is that even though you added this change, I don't see a place that calls the above function with two arguments, so this change was only added to introduce this error lol. Could you explain why you made this change @vhyrro ? Second, more verbose code is always better and we should've done something like this, especially when we silently ignore a return value (purposely). local link_not_found_buf = module.required["core.ui"].create_split("link-not-found")
local selection = module.required["core.ui"]
.begin_selection(link_not_found_buf)
:listener({
"<Esc>",
}, function(self)
... Reference: local function foo(a, b)
vim.print(string.format([[a: %s]], vim.inspect(a)))
vim.print(string.format([[b: %s]], vim.inspect(b)))
vim.print(string.format([[b or a: %s]], vim.inspect(b or a)))
end
local function two_rets()
return 10, 20
end
local args = two_rets()
foo(args) -- a = 10, b = nil
foo(two_rets()) -- a = 10, b = 20
-- BTW you can wrap `two_rets` with parens `()` to purposefully fetch only the first return value,
-- but this is not well-known and I don't think this is documented anywhere in lua docs lol
foo((two_rets())) -- a = 10, b = nil |
Should be fixed now! @pysan3 the change was introduced as it's necessary for the upcoming GTD implementation which can be found in the not-so-hidden |
I see. Yah, can't wait to see gtd coming! Thanks for fixing it. |
Prerequisites
Neovim Version
v0.9.4
Neorg setup
Actual behavior
I get an error when pressing enter on a link which doesn't exist.
Expected behavior
The 'link-not-found' buffer should open
Steps to reproduce
Press enter on a link which doesn't exist
Potentially conflicting plugins
Maybe barbar.nvim messes with the buffers?
Other information
No response
Help
No
Implementation help
No response
The text was updated successfully, but these errors were encountered: