-
-
Notifications
You must be signed in to change notification settings - Fork 159
org_return
passes non-string to nvim_feedkeys()
#799
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
Comments
It happened to me a few times also, but I wasn't able to reproduce it consistently to debug it. There are some autopairs plugins that also uses the callback, but they need to be eval-ed IIRC. Would the fix for this just ignore doing anything if both callback result and rhs is |
I've checked the docs for
So I think the fix might be as simple as putting an |
As for your question regarding feedkeys (almost forgot this one, sorry!), it looks like nvim-cmp does that in Though I can't say I completely comprehend this code, there's a lot going on in there 😅 |
I pushed a change that should do the check and return early. Pull the latest master and let me know if it happens again. If not, we can close this in a week or two. |
I've done the steps I did last time to reproduce it under my lazy-loading setup.
and it seems to work now! I'll report back if I notice any bug though. |
I had the problem also often in the past and can confirm, that it didn't happen to me since you pushed your fix @kristijanhusak. I think, we can close this issue. |
Describe the bug
Under some conditions, pressing
<CR>
in insert mode results in the following message:The editor then hangs until ctrl-c is pressed, which will interrupt a call to
vim.cmd[[redraw!]]
.As far as I can tell, this is caused by these lines in the
org_return
action handler:orgmode/lua/orgmode/org/mappings.lua
Lines 574 to 593 in 0683da9
In cases where this bug occurs,
b:org_old_cr_mapping
has a fieldcallback
but no fieldrhs
. The fallback then correctly callscallback()
. However, it seems the return value is unconditionally passed tonvim_feedkeys()
, even ifeval
is false and the return value is, say,nil
.This should be easily fixable and I wouldn't mind submitting a PR. I'd just like someone who knows the code to look over it and make sure my train of thought is correct.
Steps to reproduce
Not quite clear what is necessary. I think this is caused by orgmode setting up its
imap <CR> ...
after nvim-cmp has set up itsimap <CR>
. Lazy-loading makes this trigger reliably, but it should be possible to hit this with eager loading, too.Expected behavior
No error message,
org_return
forwards<CR>
to nvim-cmp, which then falls back to a regular line break.Emacs functionality
No response
Minimal init.lua
N/A
Screenshots and recordings
No response
OS / Distro
Fedora 40
Neovim version/commit
0.10.1
Additional context
No response
The text was updated successfully, but these errors were encountered: