TabbyML / vim-tabby

Apache License 2.0
38 stars 2 forks source link

nvim: stuck in "initializing" status #7

Closed sonique6784 closed 5 months ago

sonique6784 commented 5 months ago

Issue

I'm using nvim with AstroVim and Lazy.

It seems that tabby is half-loaded

in Lazy tabby is loaded:

Loaded(36)
...
    ● vim-tabby 3.67ms  Tabby

When I try to know tabby' status, I get "initializing", but it doesn't go any further.

:Tabby
Tabby is initializing.

Temporary solution

if I run :doau VimEnter then tabby initialise. so I believe the VimEnter event is not trigger by default with nvim.

Other info

When I try other commands like version or help, I get some errors:

:Tabby version
Error detected while processing function tabby#commands#Main[8]..5:
line    1:
E121: Undefined variable: g:tabby_version
:Tabby help
Error detected while processing function tabby#commands#Main[8]..6[3]..BufLeave Autocommands for "*"..function tabby
#OnInsertLeave[1]..tabby#Dismiss[2]..tabby#virtual_text#Clear:
line   12:
E121: Undefined variable: s:nvim_namespace
E116: Invalid arguments for function nvim_buf_clear_namespace
E121: Undefined variable: s:nvim_namespace
E116: Invalid arguments for function nvim_buf_clear_namespace

is there a log somewhere to know why the plugin is stuck?

icycodes commented 5 months ago

Hi @sonique6784,

Thank you for reporting this issue.

The VimEnter event triggers the initialization of some global variables in the tabby#OnVimEnter function. So if it is not triggered, commands may result in script errors.

Currently, there is no log output available for debugging the vim-tabby script. It would be helpful to know if you have added any options to enable lazy loading of vim-tabby. This could load the script after the VimEnter event has already passed, causing issues.

I think I should improve the initialization flow to support proper lazy loading in the future 🤔

sonique6784 commented 5 months ago

Hi @icycodes, thanks for your reply. please find below my nvim configuration for Tabby: After reading your message I tweaked the configuration as below and it works fine now.

-- /.config/nvim/lua/plugins/tabby.lua

return {
  "TabbyML/vim-tabby",
  cmd = "Tabby",
  lazy = false, -- < This fixed the issue and load Tabby properly
}
sonique6784 commented 5 months ago

issue is fixed, make sure to add lazy = false so the plugin is not lazy loaded