lewis6991 / satellite.nvim

Decorate scrollbar for Neovim
MIT License
542 stars 20 forks source link

"Invalid window id" in render() #57

Closed justinmk closed 11 months ago

justinmk commented 11 months ago
Error executing vim.schedule lua callback: ...e/pack/paqs/start/satellite.nvim/lua/satellite/async.lua:61: The coroutine failed with this message: ...ack/paqs
/start/satellite.nvim/lua/satellite/handlers.lua:97: Invalid window id: 1002
stack traceback:
        [C]: in function 'nvim_win_get_buf'
        ...ack/paqs/start/satellite.nvim/lua/satellite/handlers.lua:97: in function 'render'
        ...ack/paqs/start/satellite.nvim/lua/satellite/handlers.lua:146: in function 'render'
        ...te/pack/paqs/start/satellite.nvim/lua/satellite/view.lua:137: in function 'render'
        ...te/pack/paqs/start/satellite.nvim/lua/satellite/view.lua:241: in function 'update'
        ...s/start/satellite.nvim/lua/satellite/handlers/search.lua:114: in function <...s/start/satellite.nvim/lua/satellite/handlers/search.lua:112>
stack traceback:
        [C]: in function 'error'
        ...e/pack/paqs/start/satellite.nvim/lua/satellite/async.lua:61: in function <...e/pack/paqs/start/satellite.nvim/lua/satellite/async.lua:55>

Steps to reproduce

  1. open any file, e.g. :edit $NVIM_LOG_FILE
  2. load scriptnames in the quickfix list :caddexpr join(map(split(execute('scriptnames'), '\n'), {k,v->matchstr(v,':\s*\zs.*')..':1: '}),"\n") | copen
  3. find "satellite" in the list and hit Enter to open it
  4. error is displayed

Previous: https://github.com/lewis6991/satellite.nvim/issues/53

lewis6991 commented 11 months ago

I can't quite see how this one is caused since the window id is created and checked in satellite/view.lua:240 and handlers.lua:97 should happen before any schedules.

~The repro steps also don't work for me.~

EDIT: I've triggered it somehow.

lewis6991 commented 11 months ago

Hopefully that fixes it.