Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Error executing vim.schedule callback #70

Closed
elianiva opened this issue Jan 23, 2021 · 16 comments
Closed

Error executing vim.schedule callback #70

elianiva opened this issue Jan 23, 2021 · 16 comments
Labels
bug Something isn't working

Comments

@elianiva
Copy link
Contributor

Hi there! I have this issue which came up pretty inconsistently. Here's the error message.

Error executing vim.schedule lua callback: ...pack/packer/opt/nvim-compe/lua/compe/utils/character.lua:31: attempt to perform arithmetic on local 'byte1' (a nil value)

I think it happens when there's not enough screen to display the documentation from a completion item.
Here's how to reproduce it.

  • use this minimal init.vim
  • open this file on the left and a split on the right. I suppose you could use whatever file but I couldn't reproduce it unless I use this file (out of several ones that I have)
  • try to add + Math. on line 7, this is where the error happens
  • if it didn't happen, remove the . and add it back

Screenshot using minimal init.vim:
image

Thanks in advance!

@hrsh7th hrsh7th added the bug Something isn't working label Jan 23, 2021
@elianiva
Copy link
Contributor Author

update: this is easily reproducible in c when you type #include <std.|>. | is the cursor and that's where the error happens.

Character.match = function(byte1, byte2)
-  local diff = byte1 - byte2
+  local diff = (byte1 or 0) - byte2
  return diff == 0 or diff == 32 or diff == -32
end

Doing this solves the issue but I don't know if this is a good permanent solution

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Sorry for the lately reply.

I can't reproduce clangd/typescript-language-server both.

It is bit difficult (may be it is a potential bug of the matcher.lua because it is a complex codes)

@elianiva
Copy link
Contributor Author

no worries. I can wait however long it would take until there's a solution for this :)
I've found my workaround so this isn't that big of an issue.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Sorry for annoying.

If you can reproduce easily, please detect the error place by debug branch.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

#71

@elianiva
Copy link
Contributor Author

Ok, I've tried that and here's the debug info. https://paste.sh/zcGWAXps#HKoNPs_FWtgJpF2pGnvEG__E

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Thank you! I will debug it.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Hm... I want to detect the input and the word that cause this error.


Matcher.score(
  Matcher.bytes2string({ 105, 110, 99, 108, 117, 100, 101 }),
  Matcher.bytes2string({ 105, 110, 99, 108, 117, 100, 101 })
)

It works fine (no errors).

Could you try to detect the word/input?

@elianiva
Copy link
Contributor Author

The word is #include <. The error happens as soon as I press <
The full file is this.

#include <

int main(void)
{
  printf("Hello world");
}

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

OK. I will push debug code for the above concern.

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Realy thank you for your help.

I've pushed to debug code.
If you have a time, please provide last debug information.

@elianiva
Copy link
Contributor Author

Here's the latest one. https://paste.sh/IBEEkb1Q#gPFs1ST_c7BuAm3gFUUJ9RHh

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Thank you very much!

I get the cause may be. will fix it soon

@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

Wa--- issue automatically closed.

@hrsh7th hrsh7th reopened this Jan 24, 2021
@hrsh7th
Copy link
Owner

hrsh7th commented Jan 24, 2021

I think the issue was solved on the latest master.

@elianiva
Copy link
Contributor Author

Yep, it's fixed. Thank YOU for fixing this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants