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

Unassigned keys may cause a unclose-able sticky window unless manually focused and escaped #120

Open
SublimeIbanez opened this issue Mar 26, 2024 · 3 comments

Comments

@SublimeIbanez
Copy link

SublimeIbanez commented Mar 26, 2024

Description

With the default configuration, using the base command twice - an unassigned value (e.g. <space><space>) - will open a window which then will often-times not be focused. This window will remain there even when activating the window again by using the command once and escaping out of that window. This window must be manually focused (I've only been able to do that with the mouse properly) and then escaped out then. See the video for an example.

Note: This happens mainly when the keys being pressed are not present in the assigned keys (e.g. gg is default for vim and I didn't manually assign it or <space><space> doesn't exist in any of my dictionaries or assigned keys.

Example

Steps to reproduce

In the video:

  1. I did the command: <space><space> for example one and then gg for example 2
  2. Then I saw: A window which caused weird interactions as described
  3. Error: The window remained and I had to manually target it with the mouse, click into it, and then press my escape key to force it to close.

Expected behavior

I would expect the window to pop up with <space><space> as the input rather than the current behavior.

Environment

  • Neovim version: [Nightly]
  • wf version: [Latest]
  • Plugin clash: [Uncertain]
@SublimeIbanez SublimeIbanez changed the title Double-Tap will cause a unclose-able sticky window unless manually focused and escaped Unassigned keys may cause a unclose-able sticky window unless manually focused and escaped Mar 26, 2024
@Cassin01
Copy link
Owner

Hello @JoshBenn,

Thank you for issuing!
I have tried to reproduce the issue with the latest Neovim, but I couldn't.

VIM v0.9.5
Build type: Release

Can you reproduce the issue with bellow minimal setting.
I think that your local setting or another plugin is interfering wf.nvim.

You can run the bellow configuration with;

$ nvim -u minimal.lua
minimal.lua
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",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)

vim.g.mapleader = " "

-- install plugins
local plugins = {
	-- do not remove the colorscheme!
	"folke/tokyonight.nvim",
	-- add any other pugins here
	{
		"Cassin01/wf.nvim",
		-- version = "*",
		-- branch = "Fixes#105",
		config = function()
			require("wf").setup()
			local which_key = require("wf.builtin.which_key")

			-- Which Key
			vim.keymap.set(
				"n",
				"<Leader>",
				-- mark(opts?: table) -> function
				-- opts?: option
				which_key({ text_insert_in_advance = "<leader>" }),
				{ noremap = true, silent = true, desc = "[wf.nvim] which-key /" }
			)
			vim.keymap.set(
				"n",
				"<Leader>f",
				function() print("ok") end,
				{ noremap = true })
			end,
	},
}

require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Sorry for Inconvenience.

@SublimeIbanez
Copy link
Author

I'll be able to in a few days, though please note that my entire setup has changed significantly as I was trying to get an initial setup completed (I've moved back to whichkey due to the issues I was having with wf). That being said, I don't have time just yet but I'll try to test out the requested config when I can and get back to you with the updates.

@Cassin01
Copy link
Owner

Cassin01 commented Mar 31, 2024

Hello @JoshBenn
I understand. Thank you for your cooperation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants