Closed icefed closed 4 days ago
0.10.0
MacOS 14.5
{ "stevearc/oil.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, -- enabled = false, opts = { view_options = { -- Show files and directories that start with "." show_hidden = true, }, delete_to_trash = true, float = { -- Padding around the floating window padding = 2, max_width = 90, max_height = 0, border = "rounded", win_options = { winblend = 0, winhighlight = "NormalFloat:Normal,FloatBorder:Normal", }, }, }, },
This is my oil config, I set float win_options: winhighlight = "NormalFloat:Normal,FloatBorder:Normal",, the first time I open Oil float window it works, until I change to another directory(in Oil).
winhighlight = "NormalFloat:Normal,FloatBorder:Normal",
I read the oil code, found the issue caused by https://github.com/stevearc/oil.nvim/blob/65c53dbe4f2140236590a7568a5f22a77d16be39/lua/oil/init.lua#L264-L266
If I remove scope = "local" all fine.
scope = "local"
minor (annoyance)
init.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) vim.g.mapleader = "," require("lazy").setup({ { "ellisonleao/gruvbox.nvim", lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() require("gruvbox").setup({}) vim.cmd("colorscheme gruvbox") end, }, { "stevearc/oil.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, -- enabled = false, opts = { view_options = { -- Show files and directories that start with "." show_hidden = true, }, delete_to_trash = true, float = { -- Padding around the floating window padding = 2, max_width = 90, max_height = 0, border = "rounded", win_options = { winblend = 0, winhighlight = "NormalFloat:Normal,FloatBorder:Normal", }, }, }, keys = { { "<leader>t", "", desc = "Toggle" }, { "<leader>tt", ":Oil --float<CR>", desc = "Oil Open parent directory" }, }, }, })
<leader>tt
winhighlight
../
float win_options works if I change directory.
No response
...
nvim -u repro.lua
Did you check the docs and existing issues?
Neovim version (nvim -v)
0.10.0
Operating system/version
MacOS 14.5
Describe the bug
This is my oil config, I set float win_options:
winhighlight = "NormalFloat:Normal,FloatBorder:Normal",
, the first time I open Oil float window it works, until I change to another directory(in Oil).I read the oil code, found the issue caused by https://github.com/stevearc/oil.nvim/blob/65c53dbe4f2140236590a7568a5f22a77d16be39/lua/oil/init.lua#L264-L266
If I remove
scope = "local"
all fine.What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
init.lua
<leader>tt
( open oil in float mode )winhighlight
not work)../
and press enter (back to parent,winhighlight
work)Expected Behavior
float win_options works if I change directory.
Directory structure
No response
Repro
Did you check the bug with a clean config?
nvim -u repro.lua
using the repro.lua file above.