Skip to content

keybind is not working when open multiple buffers (nvchad) #26

@phamngocquy

Description

@phamngocquy

I'm using nvchad + tabby-nvim and realize a problem while open multiple buffers:
open nvim with first buffer opened:
Screenshot 2024-12-30 at 14 46 33
when open new buffer:
Screenshot 2024-12-30 at 14 46 51

After checking around I see that, the function tabby#inline_completion#keybindings#Setup is just initilized when open fisrt buffer.

function! tabby#inline_completion#Install()
  call tabby#inline_completion#events#Install()
  call tabby#inline_completion#keybindings#Setup()
  call tabby#inline_completion#virtual_text#Setup()
endfunction

sulution here is create an autocmd

function! tabby#inline_completion#Setup()
  augroup tabby_inline_completion_events
    autocmd!
    autocmd User tabby_lsp_on_buffer_attached call tabby#inline_completion#Install()
  augroup end
  autocmd BufNewFile,BufRead * call tabby#inline_completion#keybindings#Setup()
endfunction

I have created pull request here: #26
Noted: I'm quite new in lua and nvim plugin, please help to review

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions