SmiteshP / nvim-navbuddy

A simple popup display that provides breadcrumbs feature using LSP server
Apache License 2.0
770 stars 30 forks source link

Leaving Navbuddy via either actions.insert_name or actions.select removes cursor #15

Closed Sammo98 closed 1 year ago

Sammo98 commented 1 year ago

Version

NVIM v0.9.0-dev-1117+ga4f443994-dirty Build type: Release LuaJIT 2.1.0-beta3

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-a4f4439/share/nvim"

Configuration (Lazy.nvim)

return {
    "SmiteshP/nvim-navbuddy",
    lazy = false,
    dependencies = {
        "neovim/nvim-lspconfig",
        "SmiteshP/nvim-navic",
        "MunifTanjim/nui.nvim"
    },
    keys = {
          {"<leader>nv", "<cmd>Navbuddy<cr>", desc = "Nav"},
    },
    config = function ()
        local actions = require("nvim-navbuddy.actions")
        local navbuddy = require("nvim-navbuddy")
        navbuddy.setup({
            window = {
                border = "double"
            },
            mappings = {
                ["k"] = actions.next_sibling,
                ["i"] = actions.previous_sibling,
                ["j"] = actions.parent,
                ["l"] = actions.children,
                ["h"] = actions.insert_name,
                ["<enter>"] = actions.select,

            },
            lsp = {auto_attach = true}
        })
    end
}

Additional notes

Full dot files can be found here

I should note that I have fairly unconventional mappings for movement and entering insert mode:

vim.keymap.set("n", "j", "h")
vim.keymap.set("n", "k", "j")
vim.keymap.set("n", "i", "k")
vim.keymap.set("n", "h", "i")

vim.keymap.set("v", "j", "h")
vim.keymap.set("v", "k", "j")
vim.keymap.set("v", "i", "k")

Here as an example screenshot of what normal mode looks like after exiting navbuddy by pressing enter:

navbuddy

It strangely almost looks like visual line mode, but is not, and the cursor no longer can be found.

SmiteshP commented 1 year ago

Seems related to #14

Sammo98 commented 1 year ago

My bad, did not see this, closing this.