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

The telescope.nvim will open a file with insert mode while using this plugin #26

Closed
nullptr-yxw opened this issue Dec 24, 2023 · 3 comments

Comments

@nullptr-yxw
Copy link

nullptr-yxw commented Dec 24, 2023

While using this plugin, the telescope.nvim will open a file with insert mode.

nvim.2023-12-25.02-33-19.mp4

(You can see the mode in lualine)

--stickybuf.lua
return {
    "stevearc/stickybuf.nvim",
    enabled = true,
    opts = {},
}
--telescope.lua
return {
    'nvim-telescope/telescope.nvim',
    dependencies = { 'nvim-lua/plenary.nvim' },
    opts = {},
}

If I disable this plugin, the telescope.nvim will open a file with normal mode as expect

nvim.2023-12-25.02-32-16.mp4
--stickybuf.lua, which disables the plugin
return {
    "stevearc/stickybuf.nvim",
    enabled = false,
    opts = {},
}
@stevearc
Copy link
Owner

I tried reproducing this with the following minimal init file

-- 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 = {
	"folke/tokyonight.nvim",
	-- add any other plugins here
	"stevearc/stickybuf.nvim",
	{
		"nvim-telescope/telescope.nvim",
		dependencies = { "nvim-lua/plenary.nvim" },
		opts = {},
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Using Telescope find_files I could not reproduce the issue. The files seem to open in normal mode. Could you find a minimal init file where the issue repros?

@stevearc stevearc added the question Further information is requested label Dec 24, 2023
@nullptr-yxw
Copy link
Author

nullptr-yxw commented Dec 25, 2023

I tried reproducing this with the following minimal init file

-- 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 = {
	"folke/tokyonight.nvim",
	-- add any other plugins here
	"stevearc/stickybuf.nvim",
	{
		"nvim-telescope/telescope.nvim",
		dependencies = { "nvim-lua/plenary.nvim" },
		opts = {},
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Using Telescope find_files I could not reproduce the issue. The files seem to open in normal mode. Could you find a minimal init file where the issue repros?

I retried it, and find the bug will only happen when both stickybuf.nvim, the telescope and dashboard-nvim are loaded
And the minimal init file is:

-- 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
        {
                "stevearc/stickybuf.nvim",
                opts = {},
        },
        {
                "nvim-telescope/telescope.nvim",
                dependencies = { "nvim-lua/plenary.nvim" },
                opts = {},
        },
        {
                "nvimdev/dashboard-nvim",
                opts = {
                        theme = "doom",
                },
        },
}
require("lazy").setup(plugins, {
        root = root .. "/plugins",
})

-- add anything else here

Using Telescope find_files and open a file in telescope's insert mode (for example, type a file name and press enter), and the bug will be reproduced.

@github-actions github-actions bot removed the question Further information is requested label Dec 25, 2023
@stevearc
Copy link
Owner

Should be fixed

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