Closed abdellatif-temsamani closed 2 years ago
I encounter the same problem currently
Seeing the same on
I encounter the same problem currently
i think if downgrade to NVIM v0.7.2
it should be fixed
@abdellatif-temsamani I'm running v 0.7.0 and had it, but seems like just deleting Telescrope and reinstalling it has fixed it for me 🤷
if the issue pops back up I'll debug a bit more but unable to reproduce at the moment
@fedreg-bn i just reinstalled and it seems to be be working, thanks
Weird we haven't changed anything. Hopefully no one else runs into this issue again :grimacing:
@Conni2461 this issue popped back up for me again this morning. It happened right after I updated Telescope.
As you said, no changes in recent commits that would cause anything like this from what I could see.. could it be something not getting fully updated??
nvim 0.7.0
using vim-plug
Still using full vimscript init
only Telescope related configs are a few keybindings to call a few Telescope functions... nothing fancy.
Takes 2 seconds to reinstall so no big deal at all but just sharing in case anyone else mentions and it's helpful.
If you want any specific info, I can look if/when it happens again. Unfortunately it was at an inopportune time this morning so couldn't look into it at all.
Thanks for the great work on Telescope!!
The same problem just popped up for me after I updated the plugins. I tried to reinstall Telescope, but it did not work for me. Actually, the exact behavior is that it opens the file in the same mode telescope is in when you open the selected file.
It may be related also to this issue? #1882
Any other hints on what it could be?
Exact same issue happening with me @PopBogdan97 . Can confirm that Telescope maintains the mode it is currently on when you open the buffer.
Have you found a workaround for it?
@theoribeiro Unfortunately I did not found any workaround for it at that moment, it just started to behave correctly after a while. I don't know yet why it was not working nor why it is working now...
Thanks for the update. No idea what's causing it either, I'll try reinstalling but it's pretty annoying to be honest, lol. It breaks my flow as I end up always editing the file by mistake after I open it.
same problem
I have the same problem using neovim compiled from master and opening files with the file or the history (old_files) pickers.
Following https://www.reddit.com/r/neovim/comments/12j9jlp/neovim_sometimes_turned_into_insert_mode_when_it/ and reverting https://github.com/neovim/neovim/pull/22984 makes telescope work as expected. Note that the patch went to the release-0.9 branch and will end up in version 0.9.1 I suppose.
https://github.com/neovim/neovim/issues/22924 may also be interesting.
Yep that's a bit mind mind boggling. It's hard to track to what is actually causing it.
Also, calling "stopinsert"
doesn't seem to work, even when scheduling it. So not an optimal but at least consistent quickfix Im using for now which works with the latest nvim version is:
nx.au({ -- Prevent entering buffers in insert mode.
"WinLeave",
callback = function()
if vim.bo.ft == "TelescopePrompt" and vim.fn.mode() == "i" then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "i", false)
end
end,
})
Has there been a fix for this issue?
This is a pretty weird bug.
I experience this on nightly 801ac2acc
but rolling back to 339011f59
seemed to have solved the issue for me. But even when I was experiencing this issue, it was not consistent so I couldn't even really do a git bisect. Even if I could, clearly people have been experiencing this as early as 0.7.
In my case, the behavior only happened when I had the Codium plugin enabled. I ended up finding out it was a call to a redraw of the status line that for some reason interfered with the mode after leaving Telepresence. Disabling the redraw line solved it but I'm afraid this is just a symptom of some other problem with Telepresence.
@theoribeiro you mean Codeium? If so, is your observation that it was a call to redraw the status line that Codeium made or telescope?
@tobealive yes, sorry I misspelled it, I meant Codeium.
Codeium was making a call to redraw the status line, which caused files opened with Telescope to be opened in Insert mode for me. As soon as I commented that line in Codeium it started working properly again.
Confirmed that this issue happened after I installed nvim-treesitter-context
. That's weird.
The neovim nightly-build has this issue, I changed back to 0.9.0 release, the issue gone!
I can confirm I'm also experiencing this in Telescope as well. It appears the mode is always reflected in the buffer I open as my previous mode in Telescope. So if I have the prompt in insert
mode and select a file, I end up in insert mode. If I go to normal
mode in the prompt and select a file, I end up in normal mode. Using the autocommand described above is working great for now, but definitely hoping this gets fixed upstream!
Looks like this starts with https://github.com/neovim/neovim/commit/d52cc668c736ef6ca7ee3655a7eb7fe6475afadc
Looks like this starts with neovim/neovim@d52cc66
I can confirm this as well after doing git bisect
d52cc668c736ef6ca7ee3655a7eb7fe6475afadc is the first bad commit
commit d52cc668c736ef6ca7ee3655a7eb7fe6475afadc
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Apr 10 07:33:26 2023 +0800
vim-patch:9.0.1443: ending Insert mode when accessing a hidden prompt buffer (#22984)
Problem: Ending Insert mode when accessing a hidden prompt buffer.
Solution: Don't stop Insert mode when it was active before. (closes vim/vim#12237)
https://github.com/vim/vim/commit/05a627c3d4e42a18f76c14828d68ee4747118211
Co-authored-by: Bram Moolenaar <Bram@vim.org>
src/nvim/autocmd.c | 6 ++++++
src/nvim/autocmd.h | 1 +
test/functional/legacy/prompt_buffer_spec.lua | 6 ++++++
test/old/testdir/test_prompt_buffer.vim | 11 +++++++++++
4 files changed, 24 insertions(+)
@mehalter @catgoose I can confirm the issue caused by that commit as well. Not sure it should be fixed on neovim, or telescope.
@mehalter @catgoose I can confirm the issue caused by that commit as well. Not sure it should be fixed on neovim, or telescope.
Yeah, I'm not sure either. Do we flip a coin?
Lol. At least this issue should be reopened.
So it should be reported in upstream.
I have reported the change and it is to fix other plugins issues. Please see https://github.com/neovim/neovim/issues/22924 So the fix is conflicted...
Please see my comment.
https://github.com/nvim-telescope/telescope.nvim/issues/2501#issuecomment-1541009573
Currently hapens to me in neovim-git. neovim from arch repos doesn't have the issue.
Because the behavior is changed in recent commit. Please see my comment.
i'll keep this closed in favor of https://github.com/nvim-telescope/telescope.nvim/issues/2501, no need to have two issues open, so please report/subscribe to that issue instead. I am going to look into if, we (telescope) can work around that until there is a solution upstream, or maybe that now intended behavior ...
Yep that's a bit mind mind boggling. It's hard to track to what is actually causing it.
Also, calling
"stopinsert"
doesn't seem to work, even when scheduling it. So not an optimal but at least consistent quickfix Im using for now which works with the latest nvim version is:nx.au({ -- Prevent entering buffers in insert mode. "WinLeave", callback = function() if vim.bo.ft == "TelescopePrompt" and vim.fn.mode() == "i" then vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "i", false) end end, })
Version without using nx
plugin, just paste the following in "init.lua"
vim.api.nvim_create_autocmd("WinLeave", {
callback = function()
if vim.bo.ft == "TelescopePrompt" and vim.fn.mode() == "i" then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "i", false)
end
end,
})
Description
i selected the file that i want, the selected file opens in insert mode directly
Neovim version
Operating system and version
arch linux
checkhealth telescope
Steps to reproduce
nvim
:Telescope find_files
Expected behavior
Actual behavior
Minimal config