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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phamngocquy
Copy link

I'm using nvchad, that realize the 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

Noted: I'm quite new in mua and nvim plugin, please help to review

@peterwilli
Copy link

This bug happens on LazyVim too. I fixed it by using their PR.

return {
  {
    "phamngocquy/vim-tabby",
    lazy = false,
    dependencies = {
      "neovim/nvim-lspconfig",
    },
    init = function()
      vim.g.tabby_agent_start_command = { "npx", "tabby-agent", "--stdio" }
      vim.g.tabby_inline_completion_trigger = "auto"
      vim.g.tabby_inline_completion_keybinding_accept = "<Tab>"
    end,
  },
}

Make sure to update the repo once you changed the config file: Just run :Lazy and shift+u to replace the origin. Keep this repo until the PR is merged.

@wsxiaoys wsxiaoys requested a review from icycodes January 6, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants