Getting `Vim:E95: Buffer with this name already exists` error with `lean://stderr` buffer

クローズ
#562 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
lua, neovim
領域
devtools

調査の方向性

Start at stderr.show in the stderr output module, where Buffer.create is called with the name lean://stderr inside vim.schedule. Check how Buffer.create applies the name via vim.api.nvim_buf_set_name, and why a second buffer with that name collides when the existing one is still valid. Done means reproducing the E95 error, then creating the stderr buffer without the collision, with a test covering two creations.

索引モデルが issue の本文から書いたものです。

説明

I'm not entirely sure how to trigger this. It happens on this line (the Buffer.create line)

---Show stderr output in a separate stderr buffer.
---@param message string a (possibly multi-line) string from stderr
function stderr.show(message)
  vim.schedule(function()
    if not current.buffer or not current.buffer:is_valid() then
      current.buffer = Buffer.create {
        name = 'lean://stderr',
        listed = false,
        scratch = true,
        options = { buftype = 'nofile' },
      }
      current.window = nil
    end

then vim.api.nvim_buf_set_name(bufnr, opts.name).

perhaps it suffices to have an already-open lean://stderr and trigger the creation of another?

主要言語
Lua
スター
611
フォーク
63
平均マージ
1日 7時間
マージ済み PR(30日)
10

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Julian/lean.nvim のほかの issue

Julian/lean.nvim の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。