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

Indicator "~" for expandable behaving weird #2099

Open
2 tasks done
rodhash opened this issue Nov 26, 2024 · 0 comments
Open
2 tasks done

Indicator "~" for expandable behaving weird #2099

rodhash opened this issue Nov 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rodhash
Copy link

rodhash commented Nov 26, 2024

FAQ

  • I have checked the FAQ and it didn't resolve my problem.

Announcement

Minimal reproducible full config

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

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

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/noice.nvim",
  -- add any other plugins here
  "nvim-neo-tree/neo-tree.nvim",
  "nvim-lua/plenary.nvim",
  "rodhash/nvim-web-devicons",
  "MunifTanjim/nui.nvim",
  "rcarriga/nvim-notify",
  "nvim-neorg/neorg",
  "nvim-lua/plenary.nvim",
  "nvim-treesitter/nvim-treesitter",
  "ray-x/lsp_signature.nvim",

  -- LSP
  "neovim/nvim-lspconfig",
  "williamboman/mason.nvim",
  "williamboman/mason-lspconfig.nvim",

  -- Completion
  "hrsh7th/nvim-cmp",
  "hrsh7th/cmp-nvim-lsp",
  "hrsh7th/nvim-cmp",
  "hrsh7th/cmp-buffer",

  -- vsnip
  "hrsh7th/cmp-vsnip",
  "hrsh7th/vim-vsnip",

  -- ft
  "nathom/filetype.nvim",
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

local nvim_set_hl = vim.api.nvim_set_hl
nvim_set_hl(0, "@neorg.headings.1.title"               , { fg="#d75fff", bold = true } )
nvim_set_hl(0, "@neorg.headings.1.prefix"              , { fg="#d75fff" } )
nvim_set_hl(0, "@neorg.headings.2.title"               , { fg="#ff5f00", bold = true } )
nvim_set_hl(0, "@neorg.headings.2.prefix"              , { fg="#ff5f00" } )
nvim_set_hl(0, "@neorg.headings.3.title"               , { fg="#7f7f7f", bold = true } )

require("noice").setup({
  lsp = {
    signature = {
      enabled = false,
    },
  }}
)

require("neorg").setup {
    -- configuration here
    load = {
        ["core.defaults"] = {
          config = {
              default_keybinds = false,
          },
        },
        ["core.concealer"] = {}

    }
}
require("mason").setup()
require("mason-lspconfig").setup {
    ensure_installed = { "terraformls", "ts_ls" },
}
require'lsp_signature'.setup() -- no need to specify bufnr if you don't use toggle_key

-- CMP

  -- Set up nvim-cmp.
  local cmp = require'cmp'

    cmp.setup({
      snippet = {
        -- REQUIRED - you must specify a snippet engine
        expand = function(args)
          vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
          -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
          -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
          -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
        end,
      },
      window = {
        completion = cmp.config.window.bordered(),
        documentation = cmp.config.window.bordered(),
      },
      mapping = cmp.mapping.preset.insert({
        ['<C-b>'] = cmp.mapping.scroll_docs(-4),
        ['<C-f>'] = cmp.mapping.scroll_docs(4),
        ['<C-Space>'] = cmp.mapping.complete(),
        ['<C-e>'] = cmp.mapping.abort(),
        ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
        ['<C-h>'] = function() cmp.complete() end,
      }),
      sources = cmp.config.sources({
        { name = 'nvim_lsp' },
        { name = 'vsnip' },
        { name = "buffer" },
        -- { name = 'luasnip' }, -- For luasnip users.
        -- { name = 'ultisnips' }, -- For ultisnips users.
        -- { name = 'snippy' }, -- For snippy users.
      })
    })


  -- Set up lspconfig.
  local capabilities = require('cmp_nvim_lsp').default_capabilities()
  capabilities.textDocument.completion.completionItem.snippetSupport = true
  capabilities.offsetEncoding = { "utf-16" }

  require('lspconfig').terraformls.setup({
    filetypes = { "terraform", "tf", "terraform-vars" },
    capabilities = capabilities
  })

  require('lspconfig')['ts_ls'].setup {
    capabilities = capabilities
  }

Description

This snippet indicator "~" only shows up after I put the cursor over it.

At least this is how it's behaving for these React files:
indicator

Is this a bug or feature?

Would be nice to see it right away when Pmenu options show up so that we know right away what are our options CMP is providing us.

Steps to reproduce

  1. Open nvim with the provided minimal file
  2. Try to auto import another file as it's shown in the recording above

Expected behavior

  1. Show the "~" without the need to move the cursor over it so that we know what are those entries in CMP menu

Actual behavior

I need to mover the cursor past those items for the indicator to show up

Additional context

No response

@rodhash rodhash added the bug Something isn't working label Nov 26, 2024
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

No branches or pull requests

1 participant