debugloop / telescope-undo.nvim

A telescope extension to view and search your undo tree 🌴
MIT License
635 stars 11 forks source link

bash on windows #14

Closed elge70 closed 1 year ago

elge70 commented 1 year ago

use_delta = true, side_by_side = true, layout_strategy = 'vertical', layout_config = { preview_height = 0.8, },

does not work on windows even if delta is present.

if opts.use_delta and vim.fn.executable("bash") == 1 and vim.fn.executable("delta") == 1 then in previewers.lua may be the issue. Windows has bash but it will spawn WSL. If you could invoke delta without bash it may work.

debugloop commented 1 year ago

I'm calculating the diff internally using nvim's own facilities. The external program is only used as a formatter, i.e. it receives the patch format diff on stdin, which is why bash (or really any shell with pipes) is required.

If you're interested in fixing this I'm willing to support you with any questions you might have, but I don't have access to or interest in WSL myself. I'll look into detecting WSL and avoiding using an external diff viewer in any case though.

debugloop commented 1 year ago

For now, I've added some code to detect WSL and use no external diff formatter in that case.