stevearc / stickybuf.nvim

Neovim plugin for locking a buffer to a window
MIT License
246 stars 7 forks source link

Bug: The window pinned by `stickybuf.nvim` might be covered by empty buffer. #30

Open nullptr-yxw opened 7 months ago

nullptr-yxw commented 7 months ago

Neovim version (nvim -v)

NVIM v0.10.0-dev-2526+g6525832a8

Operating system/version

Windows 11

Describe the bug

The window pinned by stickybuf.nvim might be covered by empty buffer.

https://github.com/stevearc/stickybuf.nvim/assets/96286337/17733e17-3495-4167-83a8-458c62935b62

What is the severity of this bug?

tolerable (can work around it)

Steps To Reproduce

  1. create a empty file called empty.txt
  2. nvim -u repro.lua empty.txt
  3. Do what I do in the video, and find that the help window, which should be pinned by the stickybuf.nvim, will be covered by empty buffer. And if I type some words in the empty buffer, the help window will not be covered.

Expected Behavior

The window pinned by stickybuf.nvim should not be covered by empty buffer.

Minimal init.lua

-- save as repro.lua
-- run with nvim -u repro.lua
-- DO NOT change the paths
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "runtime", "cache" }) do
        vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
        vim.fn.system({
                "git",
                "clone",
                "--filter=blob:none",
                "--single-branch",
                "https://github.com/folke/lazy.nvim.git",
                lazypath,
        })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
        -- add any other plugins here
    {
        "tevearc/stickybuf.nvim",
        opts = {},
    }
}
require("lazy").setup(plugins, {
        root = root .. "/plugins",
})