undotree icon indicating copy to clipboard operation
undotree copied to clipboard

Breaks telescope

Open Ascyii opened this issue 3 months ago • 6 comments

I have a minimal config with lazy.nvim as the package manger that just loads undotree and telescope without any further configurations. Now when I toggle undotree followed by telescope the telescope menu breaks. Breaking here means that the cursor is in the telescope preview and the floating window cannot be focussed or closed anymore. Please help me to fix this problem as it makes undotree unusable for me.

Ascyii avatar Aug 31 '25 13:08 Ascyii

try adding TelescopePrompt to undotree_DisabledFiletypes

AshishBhattarai avatar Sep 25 '25 13:09 AshishBhattarai

The fix

I put this in my undotree.lua in my .config/nvim

vim.g.undotree_DisabledFiletypes = { 'TelescopePrompt' }

@AshishBhattarai Thank you so much. this helps a lot. This should be the default it fixes it and it's acting exactly how it should be. even when I'm inside the undo tree buffer it works too

Image Image

[OLD] Adding more detail to the problem. still a bug

https://github.com/user-attachments/assets/b3bb8460-08cf-4077-868e-0cb295dc20fd

yes I have the same issue too

Image

when undotree is open if you try to bring a telescope window it does this.

but if you toggle undo tree back

Image

then hit the window

it works

Image Image

so it's a problem with the undotree, I'm just toggling undo tree on and off a lot lately. another alternative I found is telescope undotree extentsion

Image

the extension surprisinly works fine with undo tree

Image

but I can't exist the telescope window well... here.... I did :q and I got this because I couldn't hit escape or my C-q to remove telescope window

Image

if I hit :q to exit undotree window

Image

the telescope window is stuck on the screen.

to fix it I have to toggle the telescope window again then hit escape

Image

There is a problem with undotree

gitdexgit avatar Sep 29 '25 10:09 gitdexgit

sounds like an easy fix, feel free the send a PR

mbbill avatar Sep 29 '25 21:09 mbbill

@mbbill https://github.com/mbbill/undotree/pull/204 this should make things a bit better with neovim

AshishBhattarai avatar Sep 29 '25 21:09 AshishBhattarai

sounds like an easy fix, feel free the send a PR

Hello @mbbill in addition to telescope I noticed the same issue with toggleterm.

currently I have

vim.g.undotree_DisabledFiletypes = { 'TelescopePrompt', 'toggleterm' }

toggleterm pop up when exiiting it steals focus from undo tree.

[Notice] without that , toggleterm }` section it will always steal focus and give that 0 master thing and move your cursor to undotree.

https://github.com/user-attachments/assets/811b8a25-b0cc-4e7c-9ef8-44acc4c1604f

gitdexgit avatar Oct 01 '25 06:10 gitdexgit

@gitdexgit try updating undotree, it should ignore terminal buffers by default now.

AshishBhattarai avatar Oct 01 '25 07:10 AshishBhattarai