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

'Failed to save undo information' with nvim-notify #91

Closed
mojjominion opened this issue Apr 2, 2024 · 10 comments · Fixed by #88
Closed

'Failed to save undo information' with nvim-notify #91

mojjominion opened this issue Apr 2, 2024 · 10 comments · Fixed by #88
Assignees
Labels
bug Something isn't working

Comments

@mojjominion
Copy link

Hi, thanks for the nice tool really appreciate the efforts.

I am using AstroNvim v3.45.3.

  • v1.9.0 : While doing g + ? + v key combo I am getting an error.
  • v1.8.0 : It works fine.

I am not really sure how to get more information that might help in debugging. This is all I could manage for now.

E5108: Error executing lua: ...hare/nvim/lazy/nvim-notify/lua/notify/render/default.lua:18: Failed to save undo information
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        ...hare/nvim/lazy/nvim-notify/lua/notify/render/default.lua:18: in function 'render'
        ...nvim/lazy/nvim-notify/lua/notify/service/buffer/init.lua:107: in function 'render'
        .../share/nvim/lazy/nvim-notify/lua/notify/service/init.lua:53: in function 'push'
        ...ocal/share/nvim/lazy/nvim-notify/lua/notify/instance.lua:77: in function 'notify'
        .../share/nvim/lazy/debugprint.nvim/lua/debugprint/init.lua:79: in function 'filetype_configured'
        .../share/nvim/lazy/debugprint.nvim/lua/debugprint/init.lua:149: in function <.../share/nvim/lazy/debugprint.nvim/lua/debugprint/init.lua:147>

Screenshot from 2024-04-02 19-46-02

@mojjominion mojjominion changed the title Logging throwin error on v1.9.0 Logging throwing error on v1.9.0 Apr 2, 2024
@andrewferrier
Copy link
Owner

Thanks for making me aware of this issue.

Firstly, I think you mean 0.8.0 and 0.9.0? NeoVim hasn't reached 1.0 yet.

Secondly, looking at the stacktrace, I can tell you that it looks like debugprint is trying to tell you it doesn't have a configuration for the type of file you're editing (here's the debugprint line of code). What filetype are you editing when you see this issue?

Thirdly, I've managed to recreate your issue. Not 100% sure how to fix it yet, but it looks like it's something to do with this. Thanks for making me aware.

@andrewferrier andrewferrier added the bug Something isn't working label Apr 2, 2024
@andrewferrier andrewferrier self-assigned this Apr 2, 2024
@andrewferrier andrewferrier changed the title Logging throwing error on v1.9.0 'Failed to save undo information' with nvim.notify() Apr 2, 2024
@andrewferrier andrewferrier changed the title 'Failed to save undo information' with nvim.notify() 'Failed to save undo information' with nvim-notify Apr 2, 2024
@andrewferrier
Copy link
Owner

(Note to self: experiment with vim.fn.feedkeys rather than expr).

@andrewferrier
Copy link
Owner

I believe I've fixed this issue now; you should now see warnings about unsupported files directly as comments in the file instead, which alleviates this issue. Please update and retest - thanks!

@mojjominion
Copy link
Author

Thanks for making me aware of this issue.

Firstly, I think you mean 0.8.0 and 0.9.0? NeoVim hasn't reached 1.0 yet.

Secondly, looking at the stacktrace, I can tell you that it looks like debugprint is trying to tell you it doesn't have a configuration for the type of file you're editing (here's the debugprint line of code). What filetype are you editing when you see this issue?

Thirdly, I've managed to recreate your issue. Not 100% sure how to fix it yet, but it looks like it's something to do with this. Thanks for making me aware.

I was referring to debug.print versions v1.9.0/v1.8.0 not the Neovim versions.
Understood. Thanks for the explanation.

I was using it in .tsx files. Although it used to work on debug.print v1.8.0 it started throwing error in v1.9.0.

@andrewferrier
Copy link
Owner

D'oh, of course those are the versions you meant :) Sorry I missed the obvious here.

Looks like from the thumbs up the issue is fixed now for you but let me know if not.

@mojjominion
Copy link
Author

D'oh, of course those are the versions you meant :) Sorry I missed the obvious here.

Looks like from the thumbs up the issue is fixed now for you but let me know if not.

Yes, with latest version (v2.0.0) it prints out a message referring to the issue as you have mentioned.
Looks like I will have to do the file_type setup. I haven't been able to check that yet, I am sure doing that will allow the normal flow.

I would like to know though how come it used to work in v1.8.0 out of the box?

@andrewferrier
Copy link
Owner

One of the main changes I made on the main branch (v2.0 hasn't been released yet, so you are just using the main branch) was to provide a built-in way to configure key bindings for you. My guess would be that before you were configuring the key bindings yourself, but you weren't using the expr=true param (which was technically 'wrong', in that it didn't support dot-repeat, but you might not have noticed if you don't use dot-repeat). It's the combination of the expr=true param and use of the nvim-notify plugin which triggers the error message you opened this bug with. This is a good example of why I introduced that new mechanism for configuring keybindings, as it makes sure it's being done consistently.

Anyway, with the new way I've incorporated of providing feedback when there's no filetype setup, this shouldn't happen anymore. Arguably not being able to use expr=true and nvim-notify is a limitation in NeoVim, but that's nothing I can immediately fix.

I am a bit concerned also to see you're needing to configure the filetype though. You said you're editing .tsx files, right? NeoVim should recognize those as typescriptreact files, which debugprint has built-in support for:

["typescriptreact"] = js,

@andrewferrier
Copy link
Owner

Aha, I've just recreated the tsx problem, I see the same issue! I've opened a new bug for it here: #93

@andrewferrier
Copy link
Owner

OK, #93 is now fixed also, so .tsx files should "just work" for you. This problem was introduced also recently due to another change regarding handling embedded Treesitter languages. Thanks for spotting that too!

@mojjominion
Copy link
Author

It works now. Thank you.

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

Successfully merging a pull request may close this issue.

2 participants