Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: error when bring up "cmdwin" when edge bar is available #78

Closed
3 tasks done
jackielii opened this issue Apr 18, 2024 · 0 comments · Fixed by #85
Closed
3 tasks done

bug: error when bring up "cmdwin" when edge bar is available #78

jackielii opened this issue Apr 18, 2024 · 0 comments · Fixed by #85
Labels
bug Something isn't working

Comments

@jackielii
Copy link

jackielii commented Apr 18, 2024

Did you check docs and existing issues?

  • I have read all the edgy.nvim docs
  • I have searched the existing issues of edgy.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-2952+g97c0a5241-Homebrew

Operating system/version

MacOS 14.2.1

Describe the bug

So I have edgy.nvim pinned neo-tree files view. When I tried to bring up my command history (:h cmdwin). I get error straight away:

.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:70: ...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194: Error executing lua: vim/_editor.lua:0: nvim_exec2(): 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...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:195: in function <...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194>                                                                                                                          
^I[C]: in function 'nvim_win_call'                                                                                                                                                                                                                                        
^I...ckieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/edgebar.lua:194: in function 'layout'                                                                                                                                                                                   
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:146: in function 'fn'                                                                                                                                                                                       
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:103: in function 'foreach'                                                                                                                                                                                  
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:145: in function 'layout'                                                                                                                                                                                   
^I...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:182: in function <...ackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/layout.lua:181>                                                                                                                          
^I[C]: in function 'pcall'                                                                                                                                                                                                                                                
^I.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:67: in function <.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:65>                                                                                                                            
^I[C]: in function 'pcall'                                                                                                                                                                                                                                                
^I.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:47: in function <.../jackieli/tmp/.repro/plugins/edgy.nvim/lua/edgy/util.lua:46>   

Steps To Reproduce

  1. launch with repro.lua: nvim -u repro.lua
  2. open neotree: :Neotree
  3. open cmdline-window using : followed by <C-f>
  4. error shows

Expected Behavior

no error appears

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",
  {
    "nvim-neo-tree/neo-tree.nvim",
    dependencies = {
      "nvim-lua/plenary.nvim",
      "MunifTanjim/nui.nvim",
    },
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
require("neo-tree").setup({})
require("edgy").setup({
  left = {
    {
      title = "Neo-Tree",
      ft = "neo-tree",
      filter = function(buf)
        return vim.b[buf].neo_tree_source == "filesystem"
      end,
      pinned = true,
      open = function()
        vim.api.nvim_input("<esc><space>f")
      end,
      size = { height = 0.5 },
    },
  },
})
@jackielii jackielii added the bug Something isn't working label Apr 18, 2024
jackielii added a commit to jackielii/edgy.nvim that referenced this issue Apr 18, 2024
Hacky fix, I'm sure there is a better way. But hopefully this illustrate
the problem even better. It works for in my setup though.
@folke folke closed this as completed in 1afa13e Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant