Skip to content

[No Name] buffer is sometimes not replaced #3624

@lutalli

Description

@lutalli

Description

I noticed that opening a file in Telescope sometimes won't replace the empty [No Name] buffer. After some testing I figured out this happens only if the target file has been opened at least once in a NeoVim session (not necessarily by Telescope, :e ... or Nvim-Tree can also cause this).

Neovim version

NVIM v0.11.6
Build type: RelWithDebInfo
LuaJIT 2.1.1767980792
Run "nvim -V1 -v" for more info

Operating system and version

Arch Linux x86_64

Telescope version / branch / rev

Telescope master

checkhealth telescope

Checking for required plugins ~
- ✅ OK plenary installed.

Checking external dependencies ~
- ✅ OK rg: found ripgrep 15.1.0
- ✅ OK fd: found fd 10.3.0

Steps to reproduce

  1. Launch NeoVim (with nvim -nu minimal.lua)
  2. Open a file using Telescope
  3. See that the [No Name] buffer is replaced by the target file

  1. Restart NeoVim
  2. Open a file using either Telescope, Nvim-Tree or :e ..., etc.
  3. Close the file
  4. Re-open the same file using Telescope
  5. See that the [No Name] buffer is no longer replaced by the target file
  6. Open a different file
  7. See that the [No Name] buffer is replaced again

Expected behavior

When the [No Name] buffer is focused and it is completely empty, Telescope should always replace it with the target file.

Actual behavior

As described above

Minimal config

local Plug = vim.fn["plug#"]

vim.call("plug#begin")
    Plug "nvim-lua/plenary.nvim"
    Plug "nvim-telescope/telescope.nvim"
    Plug ("nvim-telescope/telescope-fzf-native.nvim", { ["do"]="cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release" })
vim.call("plug#end")

require("telescope").setup {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions