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

Cursor position outside of buffer #195

Closed
petobens opened this issue Dec 17, 2022 · 3 comments
Closed

Cursor position outside of buffer #195

petobens opened this issue Dec 17, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@petobens
Copy link

Hi! With the following config:

local u = require('utils')

require('aerial').setup({
    layout = {
        width = 43,
        default_direction = 'left',
        placement = 'edge',
        preserve_equality = true,
    },
    close_on_select = true,
    highlight_on_hover = true,
    highlight_on_jump = 500,
    keymaps = {
        ['v'] = 'actions.jump_vsplit',
        ['s'] = 'actions.jump_split',
    },
})

-- Autocmds
local aerial_acg = vim.api.nvim_create_augroup('aerial', { clear = true })
vim.api.nvim_create_autocmd('FileType', {
    group = aerial_acg,
    pattern = { 'aerial' },
    command = 'setlocal number relativenumber',
})

-- Mappings
u.keymap('n', '<Leader>tb', '<Cmd>AerialToggle<CR>')

If I open, as in the GIF, a lua file and a markdown file and call the aerial window from the markdown file and try to jump to a title/header not visible in the buffer I get the following error:

E5108: Error executing lua: .../pack/packer/start/aerial.nvim/lua/aerial/navigation.lua:219: Cursor position outside buffer
stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        .../pack/packer/start/aerial.nvim/lua/aerial/navigation.lua:219: in function <.../pack/packer/start/aerial.nvim/lua/aerial/navigation.lua:169>

aeriel_bug

@petobens petobens added the bug Something isn't working label Dec 17, 2022
@stevearc
Copy link
Owner

I believe I have fixed the issue. Can you try again?

@petobens
Copy link
Author

Awesome! Thanks

@MaiLunJiye
Copy link

MaiLunJiye commented Mar 29, 2024

Reproduce
image

Telescope aerial

config:

-- use lazy.nvim
    {
        'stevearc/aerial.nvim',
        opts = {
            backends = { "treesitter", "lsp", "markdown", "asciidoc", "man" },
        },
        config = true,
        -- Optional dependencies
        dependencies = {
            "nvim-treesitter/nvim-treesitter",
            "nvim-tree/nvim-web-devicons",
        },
    }
    {
        'nvim-telescope/telescope.nvim',
        dependencies = {
            'nvim-lua/popup.nvim',
            'nvim-lua/plenary.nvim',
            'stevearc/aerial.nvim',
            {'nvim-telescope/telescope-live-grep-args.nvim'},
            {'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
        },
        cmd = {"Telescope"},
        config = function()
            local actions = require('telescope.actions')
            local lga_actions = require("telescope-live-grep-args.actions")
            require('telescope').setup{
                extensions = {
                    aerial = {
                        -- Display symbols as <root>.<parent>.<symbol>
                        show_nesting = {
                            ["_"] = false, -- This key will be the default
                            json = true, -- You can set the option for specific filetypes
                            yaml = true,
                        },
                    },
                   
                    }
                }
            }
            require('telescope').load_extension('fzf')
            require("telescope").load_extension("live_grep_args")
            require("telescope").load_extension("aerial")
        end
    }

image
image

NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

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

3 participants