stevearc / aerial.nvim

Neovim plugin for a code outline window
MIT License
1.55k stars 76 forks source link

feature request: autofocus while toggle #364

Closed onns closed 1 month ago

onns commented 2 months ago

Did you check existing requests?

Describe the feature

mostly, toggling means I want to see the outline or jump to another function. It would be nice to automatically focus on it so I do not need to switch window.

Provide background

No response

What is the significance of this feature?

strongly desired

Additional details

No response

stevearc commented 1 month ago

:AerialOpen or :AerialToggle automatically place the cursor in the aerial window. How are you toggling Aerial and can you reproduce the issue with a minimal neovim config?

onns commented 1 month ago

:AerialOpen or :AerialToggle automatically place the cursor in the aerial window. How are you toggling Aerial and can you reproduce the issue with a minimal neovim config?

Sorry, I wrote the wrong config without following the guide.

With ! cursor stays in current window

{
        'stevearc/aerial.nvim',
        opts = {},
        -- Optional dependencies
        dependencies = {
            "nvim-treesitter/nvim-treesitter",
            "nvim-tree/nvim-web-devicons"
        },
        keys = {
            {
                "<leader>t",
                "<cmd>AerialToggle!<cr>",
                desc = "AerialToggle"
            }
        }
    },

image

Remove the ! and that's what I expect.