Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Open and Close Telescope produces error in CursorMoved autocmd only once #44

Open
2 tasks done
Dimfred opened this issue Jul 26, 2023 · 2 comments
Open
2 tasks done

Comments

@Dimfred
Copy link

Dimfred commented Jul 26, 2023

Describe the bug
When I start neovim, statup.nvim shows up.
I open telescope (whatever window), then close it, I get this error:

Error detected while processing CursorMoved Autocommands for "*":
E5108: Error executing lua ...ite/pack/packer/start/startup.nvim/lua/startup/utils.lua:26: Cursor position outside buffer
stack traceback:
        [C]: in function 'nvim_win_set_cursor'
        ...ite/pack/packer/start/startup.nvim/lua/startup/utils.lua:26: in function 'set_cursor'
        ...ite/pack/packer/start/startup.nvim/lua/startup/utils.lua:443: in function 'move_down'
        ...ite/pack/packer/start/startup.nvim/lua/startup/utils.lua:482: in function 'reposition_cursor'
        [string ":lua"]:1: in main chunk

When changing the line in e.g. setting the cursor pos to {1,1} I go into an infinite loop and everything explodes.

Checklist

  • Checked if issue already exists
  • I'm using the latest startup.nvim version

To Reproduce
Steps to reproduce the behavior:

  1. Open neovim with startup.nvim dashboard
  2. :Telescope find_files
  3. 2x <Esc>
  4. See error

Expected behavior
No error

Screenshots
If applicable, add screenshots to help explain your problem.

Add your config here
Not sure if it is relevant tbh. Pls let me know :)

@Dimfred
Copy link
Author

Dimfred commented Jul 30, 2023

I was able to remove the error by commenting out the code inside utils.lua reposition_cursor(), everything still seems to work fine.

@kdssoftware
Copy link

I was able to remove the error by commenting out the code inside utils.lua reposition_cursor(), everything still seems to work fine.

Commenting out

    vim.cmd(
        [[autocmd CursorMoved * lua require"startup.utils".reposition_cursor()]])

worked for me, thanks 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants