folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
840 stars 17 forks source link

bug: E11: Invalid in command-line window; <CR> executes, CTRL-C quits #58

Closed mp2720 closed 8 months ago

mp2720 commented 11 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

v0.9.4 and v0.10.0-dev-366d0c7

Operating system/version

Arch Linux

Describe the bug

Getting this error message when trying to open command line window (q:):

Error detected while processing BufWinEnter Autocommands for "*":
.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:70: ...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207: Error executing lua: vim/_editor.lua:0: BufWinEnter Autocommands for "*"..script nvim_exec2() called at BufWinEnter Autocommands for "*":0: Vim(wincmd):E11
: Invalid in command-line window; <CR> executes, CTRL-C quits
stack traceback:
^I[C]: in function 'nvim_exec2'
^Ivim/_editor.lua: in function 'cmd'
^I...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:208: in function <...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207>
^I[C]: in function 'nvim_win_call'
^I...er/.local/share/nvim/lazy/edgy.nvim/lua/edgy/edgebar.lua:207: in function 'layout'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:146: in function 'fn'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:103: in function 'foreach'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:145: in function 'layout'
^I...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:182: in function <...ser/.local/share/nvim/lazy/edgy.nvim/lua/edgy/layout.lua:181>
^I[C]: in function 'pcall'
^I.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:67: in function <.../user/.local/share/nvim/lazy/edgy.nvim/lua/edgy/util.lua:65>
^I[C]: in function 'pcall'

Steps To Reproduce

  1. Open any window that Edgy moves into the layout.
  2. Open command line window by pressing q:.

Expected Behavior

No error is expected.

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "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", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "folke/edgy.nvim",
        opts = {
            -- The same error occurs with other layout positions and filetypes as well.
            bottom = {
                {
                    ft = "help",
                    size = { height = 0.5 }
                }
            }
        }
  }
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
mp2720 commented 11 months ago

My fix mp1884/edgy.nvim/commit/4fcc43f49b17db8e68c36a11a50ecbcfd0d56da6.

May not be the best solution, but works for me.

folke commented 11 months ago

I can't reproduce this, neither in my dots or with the provided repro

hbiel commented 10 months ago

Having help open and managed by edgy doesn't trigger this for me. But I can reproduce this using neotree using these steps:

  1. Open Neotree (while having Edgy configured to move it into the layout)
  2. Move cursor away from Neotree but leave it open (as pressing q close neotree for me - might not be relevant otherwise)
  3. Open command line window by pressing q: