Open ImmanuelHaffner opened 7 months ago
Hi there! Do you mean it enters file in insert mode or highlights it as insert one, but actually in normal mode?
Because if it's the first one, I don't really know how it can be possible as I don't use nvim_feedkeys
or :startinsert
to actually change mode, but I'll recheck the codebase again.
Did you see this comment in that issue? Can you please try this autocommand? https://github.com/nvim-telescope/telescope.nvim/issues/2027#issuecomment-1561836585
Hey @rasulomaroff , thanks for the quick response. I meant it enters insert mode. I did already see the comment you linked and I am using that workaround. Still, I wanted to raise awareness for that issue.
Could it be that you are clearing some augroup that Telescope is using? Just a wild guess. I don't know your or Telescope code base.
Hmm, don't think so
The only place where I could possibly lose third-party highlights is the "winhl" option, but I save all the previous window highlights before applying mine and then apply them together.
You don't have troubles with highlights themselves, right? Or do you?
You pointed that your problem is that Telescope enters insert mode, so, I would wait for their clarification, 'cause as I said I don't manipulate modes at any level.
Highlights are not affected. Sure, let's see what Telescope folks have to say. So far, they say it may be because of a nvim issue that has already been fixed upstream. I don't run nightly, though. Might give it a shot to see if it fixes things.
Unsure if related, but seems so. With reactive
enabled, the third buffer opened through telescope consistently opens in insert mode.
nvim-telescope
on tag 0.1.5
,
reactive
on tag 1.2.0
Seems to be fixed by https://github.com/neovim/neovim/pull/27051. When building neovim on commit 2fce95ec4 or later (i.e. NVIM v0.10.0-dev-2110+g2fce95ec4
I can't reproduce the issue anymore.
reactive
config:
{
"rasulomaroff/reactive.nvim",
config = function()
require("reactive").setup({
builtin = {
cursor = true,
},
})
end,
},
Also fixed by adding https://github.com/nvim-telescope/telescope.nvim/issues/2501#issuecomment-1561838990 when running older versions of neovim:
-- Quickfix for this issue https://github.com/nvim-telescope/telescope.nvim/issues/2501
api.nvim_create_augroup('my_telescope', { clear = true })
api.nvim_create_autocmd({ 'WinLeave' }, {
group = 'my_telescope',
pattern = '*',
callback = function()
if vim.bo.ft == "TelescopePrompt" and fn.mode() == "i" then
api.nvim_feedkeys(api.nvim_replace_termcodes("<Esc>", true, false, true), "i", false)
end
end,
})
@thelinmichael just tested on my machine and there's no such a problem..
Seems a bit crazy for me because I don't really know how I can trigger insert mode without firing something like :startinsert
or other methods
@thelinmichael just tested on my machine and there's no such a problem.. Seems a bit crazy for me because I don't really know how I can trigger insert mode without firing something like
:startinsert
or other methods
Hm, I suppose the change to insert mode is done by TelescopePrompt
.
I think I have the same issue, but its not really insert mode it just looks like it. With reactive enabled, using telescope to find a file and open, status line shows mode as insert, but its not actually... its still in normal mode but it displays as insert. Disabling reactive, it does not do this and reflects the mode correctly.
ahh I think mine is how I'm getting the mode in heirline, changing from heirline to mini.statusline as a quick test, the issue goes away.
In my particular case it seems to be this in heirline which causes it when reactive is enabled. Removing this update makes the issue stop presenting and it looks to still behave as expected (heirline).
update = {
"ModeChanged",
pattern = "*:*",
callback = vim.schedule_wrap(function()
vim.cmd "redrawstatus"
end),
},
Perhaps this might give some clues to help solve this issue
@infinite-ops hi there! As far as I know the issue was fixed in the upstream Neovim. It wasn't reactive
issue because the only thing that reactive
does is updates highlights when a mode changes and redraws pending screen updates. From the latest commit pushed, it only does it when there's at least one highlight to update, but skips if there aren't.
Unfortunately, I see a lot of issues that are coming up when using those redraw
and redrawstatus
commands. May be something in the Neovim core...
I'm using Neovim nightly and I do have the issue. https://github.com/nvim-telescope/telescope.nvim/issues/2501#issuecomment-1561838990 doesn't make any difference.
% nvim -v
NVIM v0.11.0-dev-632+g33464189b-dirty
Build type: Release
LuaJIT 2.1.1716656478
Run "nvim -V1 -v" for more info
My reactive.nvim
config
return {
"rasulomaroff/reactive.nvim",
event = { "BufEnter", "WinEnter" },
opts = {
load = { "catppuccin-mocha-cursor", "catppuccin-mocha-cursorline" },
},
}
Error Description
When using Telescope together with
reactive.nvim
plugin, opening files from the picker immediately enters insert mode.X-posted in Telescope
Potentially Related Issues
My reactive config