nvim-neo-tree / neo-tree.nvim

Neovim plugin to manage the file system and other tree like structures.
MIT License
3.9k stars 225 forks source link

BUG: Slow work when remap keys #1386

Closed dyrkow closed 8 months ago

dyrkow commented 8 months ago

Did you check docs and existing issues?

Neovim Version (nvim -v)

v0.9.1 2.1.0-beta3

Operating System / Version

MacOS 13.1

Describe the Bug

When you press the enter key, files and folders open instantly. But when I specify the opening of files and folders through the "о" button, it is an order of magnitude slower

In mapping_options i set up nowait = true, but steel not working

Screenshots, Traceback

https://github.com/nvim-neo-tree/neo-tree.nvim/assets/8726541/2f1c528b-07c7-4a2e-b046-b7af6f11b91a

Steps to Reproduce

  1. Set up configuration
  2. Open neotree space + n
  3. Try open folder o or enter

Expected Behavior

The open function must be executed at the same speed

Your Configuration

require('keys/map')

require("neo-tree").setup({
    close_if_last_window = false, -- Закрывает окно дерева, если оно последнее
    enable_git_status = true, -- Показывать статусы гита
    default_component_configs = {
        indent = {
            with_markers = true,
            indent_marker= "¦",
            last_indent_marker = "└",
        },
        -- Можно использовать вот эти символы для гита ○ ◌ ◍ ◎ ∴ ✖ ✕ ▲ ☉ ☭ ± ✓ ☠ 🍺 ☐ ☑ ☒
        git_status = {
            symbols = {
                -- Change type
                added     = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
                modified  = "", -- or "", but this is redundant info if you use git_status_colors on the name
                deleted   = "✕",-- this can only be used in the git_status source
                renamed   = "",-- this can only be used in the git_status source
                -- Status type
                untracked = "◌",
                ignored   = "",
                unstaged  = "○",
                staged    = "✓",
                conflict  = "",
            }
        },
        icon = {
            folder_closed = "",
            folder_open = "",
            folder_empty = "■",
            -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
            -- then these will never be used.
            default = "",
            highlight = "NeoTreeFileIcon"
        },
        modified = {
            symbol = "",
            highlight = "NeoTreeModified",
        },
        name = {
            trailing_slash = false,
            use_git_status_colors = true,
            highlight = "NeoTreeFileName",
        },
    },
    window = {
        mapping_options = {
            noremap = true,
            nowait = true,
        },
        mappings = {
            -- Включаем режим, при котором содержимое файла под курсором будет показываться в виде окна
            ["P"] = { "toggle_preview", config = { use_float = false, use_image_nvim = true } },
            ["o"] = "open",
        }
    },
})

-- Neotree plugin
nm('<leader>n', '<cmd>:Neotree toggle<CR>')
nm('<leader>gs', '<cmd>:Neotree float git_status<CR>')

https://github.com/dyrkow/dotfiles/blob/master/vimlua/lua/plugins/neotree.lua
pysan3 commented 8 months ago

What is keys/map.

This is not a place to dump in your config and make us debug it for you.

Please follow the instructions in the template and make sure that the issue is reproducible with a SINGLE file.

Your config only calls setup function, but the template also includes installing the plugin etc.

pysan3 commented 8 months ago

Please read other issues before making an issue.

https://github.com/nvim-neo-tree/neo-tree.nvim/discussions/1345