folke / trouble.nvim

🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.
Apache License 2.0
5.24k stars 178 forks source link

bug: Lsp reference file entry disappear #331

Closed ShiChenCong closed 11 months ago

ShiChenCong commented 11 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.1

Operating system/version

MacOS 13.3.1

Describe the bug

Untitled

Steps To Reproduce

  1. TroubleToggle lsp_references
  2. press \<CR>
  3. File entry disappear

Expected Behavior

  1. TroubleToggle lsp_references
  2. press \<CR>
  3. File entry not disappear

Repro


local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

require("lazy").setup({
  {
    'catppuccin/nvim',
    name = 'catppuccin',
    config = function()
      require('theme')
    end
  },

  { "svban/YankAssassin.vim", event = 'BufEnter' },
  {
    "folke/trouble.nvim",
    dependencies = "kyazdani42/nvim-web-devicons",
    config = function() require('conf.trouble') end,
    event = 'BufEnter'
  },
  {
    'nvim-treesitter/nvim-treesitter',
    build = ':TSUpdate',
    config = function()
      require('conf.treesitter')
    end
  },

  {
    "numToStr/Comment.nvim",
    config = function() require('conf.comment') end,
    event = 'BufEnter',
    dependencies = {
      { 'JoosepAlviste/nvim-ts-context-commentstring' },
    }
  },

  { "neovim/nvim-lspconfig", config = function() require('lsp') end },

  {
    "Shougo/defx.nvim",
    dependencies = {
      "kristijanhusak/defx-git", "kristijanhusak/defx-icons",
      { "onsails/lspkind.nvim" },
    },
    keys = "fi",
    config = function() require('conf.defx') end,
  },

  {
    'rmagatti/auto-session',
    config = function()
      require("auto-session").setup {
        log_level = "error",
        auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
      }
    end
  },
}, {
  defaults = {
    lazy = false
  }
})

require('trouble').setup({
  -- position = 'left',
  -- width = 30
  padding = false,
  height = 8,
  include_declaration = {},
  action_keys = {
    jump_close = {},
    toggle_fold = { "o" }
  }
})