Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Error opening doc when the os window is small enough for the telescope preview to hide #68

Open
benelan opened this issue Nov 30, 2023 · 2 comments
Labels
bug Something isn't working telescope nvim-telescope related issues

Comments

@benelan
Copy link
Contributor

benelan commented Nov 30, 2023

I'm running into an error that occurs when the OS window containing neovim is small enough that the Telescope preview does not display. When selecting an item through Telescope I get the following error:

E5108: Error executing lua: ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:75: Invalid 'replacement': Expected Lua table
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:75: in function 'open_doc'
        ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:180: in function 'run_replace_or_original'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:257: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:256>

Let me know if you aren't able to repro and I'll try to put together a minimal config.

@luckasRanarison luckasRanarison added the bug Something isn't working label Nov 30, 2023
luckasRanarison added a commit that referenced this issue Nov 30, 2023
Fixed the case where there is no telescope preview and catch possible undefined buffer behaviour.
luckasRanarison added a commit that referenced this issue Nov 30, 2023
Fixed the case where there is no telescope preview and catch possible undefined buffer behaviour.
@luckasRanarison
Copy link
Owner

luckasRanarison commented Nov 30, 2023

The issue happened because I reused the telescope preview buffer to avoid extra read operations but I haven't thought of the case where there is no preview... But it should be fixed now, thanks for the report!

@benelan
Copy link
Contributor Author

benelan commented Dec 1, 2023

Thanks for the quick fix! Unfortunately I'm still getting an error when doing the following:

  1. use a window large enough for the telescope preview to display
  2. Open the devdocs picker and make sure you can see the preview
  3. shrink the window to the point where the preview no longer displays (e.g. create a new neovim window, tmux pane, etc.)
  4. press enter, and see the following error:
E5108: Error executing lua: ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:424: Invalid windo
w id: 1004
stack traceback:
        [C]: in function 'nvim_win_set_buf'
        ...l/share/nvim/lazy/telescope.nvim/lua/telescope/utils.lua:424: in function 'win_set_buf_noautocm
d'
        ...scope.nvim/lua/telescope/previewers/buffer_previewer.lua:401: in function '_teardown_func'
        ...zy/telescope.nvim/lua/telescope/previewers/previewer.lua:79: in function 'teardown'
        ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:1571: in function 'on_close_prompt'
        .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:386: in function 'run_replace_or_origi
nal'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'close'
        ...hare/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/pickers.lua:174: in function 'run_replace_or_origi
nal'
        ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
        ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:257: in function <...hare/nvim/lazy/te
lescope.nvim/lua/telescope/mappings.lua:256>

@luckasRanarison luckasRanarison added the telescope nvim-telescope related issues label Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working telescope nvim-telescope related issues
Projects
None yet
Development

No branches or pull requests

2 participants