aznhe21 / actions-preview.nvim

Fully customizable previewer for LSP code actions.
GNU General Public License v3.0
365 stars 9 forks source link

Is it still possible to disable the diff previewer? #28

Open Futarimiti opened 5 months ago

Futarimiti commented 5 months ago

Hi, thanks for the plugin.

I'm currently using the get_cursor theme from telescope. Sometimes the diff window becomes too bulky and overlaps with options from the actions menu:

image

Hence I would like to disable the diff preview sometimes. A month ago this could be achieved by the following configuration, by passing false to previewer option:

require('actions-preview').setup { telescope = require('telescope.themes').get_cursor { previewer = false } }
Screenshot 2024-02-23 at 9 30 30 pm

Which unfortunately does not work anymore since e4aa224. With the same configuration, the code actions menu pops up still, but selecting an option gives the following error:

Error executing lua callback: ...s-preview.nvim/lua/actions-preview/backend/telescope.lua:100: attempt to index field 'state' (a nil value)
stack traceback:
    ...s-preview.nvim/lua/actions-preview/backend/telescope.lua:100: in function '_teardown_func'
    ...zy/telescope.nvim/lua/telescope/previewers/previewer.lua:78: in function 'teardown'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:1486: in function 'on_close_prompt'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:531: in function <...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:530>

A similar error would also arise when trying to quit/close the popup.

Here's an animation showing the chaos:

https://github.com/aznhe21/actions-preview.nvim/assets/96031125/f9afb225-a19e-406f-bf9c-3ed7e179d9aa

Having these said I guess that's definitely not how things work now. Is it still possible to disable the diff previewer? If yes, then what would be the correct way to setup so?

Thanks again for your efforts and devotion in the plugin. If you need more information please let me know.

Futarimiti commented 5 months ago

Hmm, just came across #24 according to which disabling the previewer would not be endorsed. I guess I'll be staying with 29724d2 then.

aznhe21 commented 5 months ago

What is the purpose of disabling the preview while using this plugin? If you don't need a preview, you can use other plugins like dressing.nvim. If there is a useful way to use this plugin while disabling the preview, I will consider officially supporting it.

That being said, regressions should always be avoided, so I will fix this issue..

aznhe21 commented 4 months ago

OK, please re-open this issue when you can explain the purpose of disabling previews.

LionyxML commented 4 months ago

One could disable it when langauge does not support previews while keeping enabled for languages that support it :)

aznhe21 commented 2 months ago

Ah, I see. I will investigate if that is possible.