dense-analysis / neural

AI Vim/Neovim code generation plugin (OpenAI, ChatGPT, and more)
MIT License
455 stars 19 forks source link

The error notifications showed when I enter the prompt. #1

Closed blitzkrieg-jvonngu-foo closed 1 year ago

blitzkrieg-jvonngu-foo commented 1 year ago

This is my config of it (in after/plugin), sorry because I cannot show the api key.

neural.setup({
    mappings = {
        prompt = '<Tab><space>',
    },
    open_ai = {
        api_key = "***",
    }
})

The error I get:

Error executing vim.schedule lua callback: Vim:E885: Not possible to change sign AnimationSign_dots_4
stack traceback:
        [C]: in function 'sign_place'
        ...k/packer/start/significant.nvim/lua/significant/init.lua:134: in function 'sign_place_fn'
        ...k/packer/start/significant.nvim/lua/significant/init.lua:99: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue

Although it's worked after I press q but the result is not completely correct:

print the name in English form of current Vietnamese president  # My request.

Nguyen Xuan Phuc  # Correct result.

Nguyen Phu Trong  # Result I got.

But it's not as important as how I do to hidden the error.

From my Fedora 37, neovim 0.8 in kitty (surely I installed two require plugin).

Thanks for your help and sorry for my non-native English.

Angelchev commented 1 year ago

Thank you for the feedback.

With respect to the accuracy of facts, the OpenAI Model uses training data up to Jun 2021 - therefore it cannot know about facts that may have changed since then.

I updated the README.md to mention this in the Disclaimer


As for the animated sign error, this issue is caused by generating text/code on the first line of the buffer. I have added a workaround fix for it at https://github.com/dense-analysis/neural/commit/5d6890caf80da86931740e6c0dfc94f039d43ab3

There is a weird interaction I have to investigate that happens where when setting the sign on the same line as the output, it is removed and the significant library tries to update a sign that doesn't exist.

blitzkrieg-jvonngu-foo commented 1 year ago

@Angelchev Thank you very much.