NeogitOrg / NeogitOrg/neogit

[bug] Buffer does not exist when opening with `nvim +Neogit`

Open
#1,771 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
5.6k
Forks
357
Avg merge
15h 47m
Merged PRs (30d)
2

Description

When opening Neogit as an after config command from the shell as nvim +Neogit and try to open a file with pressing
<CR> when over it, one gets the error:

E5108: Lua: vim/_editor.lua:0: nvim_exec2(), line 1: Vim(sbuffer):E86: Buffer 2 does not exist
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        .../.local/share/nvim/lazy/neogit/lua/neogit/lib/buffer.lua:230: in function 'close'
        ...hare/nvim/lazy/neogit/lua/neogit/buffers/status/init.lua:237: in function 'close'
        ...e/nvim/lazy/neogit/lua/neogit/buffers/status/actions.lua:1243: in function 'cb'
        .../.local/share/nvim/lazy/neogit/lua/neogit/lib/buffer.lua:745: in function <.../.local/share/nvim/lazy/neogit/lua/neogit/lib/buffer.lua:744>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by opening Neovim with nvim +Neogit, selecting a file with <CR>, and capturing the buffer error. Start with lua/neogit/lib/buffer.lua around lines 230 and 745, then inspect lua/neogit/buffers/status/init.lua around line 237 and actions.lua around line 1243. Done means opening the file no longer reports that Buffer 2 does not exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, lua, neovim
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.