benlubas / molten-nvim

A neovim plugin for interactively running code with the jupyter kernel. Fork of magma-nvim with improvements in image rendering, performance, and more
GNU General Public License v3.0
531 stars 30 forks source link

[Bug] MoltenEnterOutput failed to switch window #227

Closed CCLDArjun closed 1 month ago

CCLDArjun commented 1 month ago
`:checkhealth molten` ``` molten: require("molten.health").check() molten-nvim ~ - OK NeoVim >=0.9 - OK Python >=3.10 - OK Python module pynvim found - OK Python module jupyter-client found - OK Python module cairosvg found - WARNING Optional python module pnglatex not found - ADVICE: - pip install pnglatex - OK Python module plotly found - OK Python module kaleido found - OK Python module pyperclip found - OK Python module nbformat found - OK Python module pillow found ```

Description

:MoltenEnterOutput will error with:

Error detected while processing function remote#define#request:      
line    2:                                                                    
Error invoking '/home/arjun/.local/share/nvim/lazy/molten-nvim/rplugin/python3
/molten:command:MoltenEnterOutput' on channel 7 (python3-rplugin-host):       
error caught in request handler '/home/arjun/.local/share/nvim/lazy/molten-nvi
m/rplugin/python3/molten:command:MoltenEnterOutput []':                       
Traceback (most recent call last):                                            
  File "/home/arjun/.local/share/nvim/lazy/molten-nvim/rplugin/python3/molten/
utils.py", line 11, in inner                                                  
    func(self, *args, **kwargs)                                               
  File "/home/arjun/.local/share/nvim/lazy/molten-nvim/rplugin/python3/molten/
__init__.py", line 463, in command_enter_output_window                        
    kernel.enter_output()                                                     
  File "/home/arjun/.local/share/nvim/lazy/molten-nvim/rplugin/python3/molten/
moltenbuffer.py", line 263, in enter_output                                   
    self.should_show_floating_win = self.outputs[self.selected_cell].enter(   
  File "/home/arjun/.local/share/nvim/lazy/molten-nvim/rplugin/python3/molten/
outputbuffer.py", line 118, in enter                                          
    self.nvim.funcs.nvim_set_current_win(self.display_win)                    
  File "/home/arjun/.local/lib/python3.10/site-packages/pynvim/api/nvim.py", l
ine 323, in call                                                              
    return self.request('nvim_call_function', name, args, **kwargs)           
  File "/home/arjun/.local/lib/python3.10/site-packages/pynvim/api/nvim.py", l
ine 199, in request                                                           
    res = self._session.request(name, *args, **kwargs)                        
  File "/home/arjun/.local/lib/python3.10/site-packages/pynvim/msgpack_rpc/ses
sion.py", line 139, in request                                                
    raise self.error_wrapper(err)                                             
pynvim.api.common.NvimError: Vim:E5555: API call: Failed to switch to window 1
012 

after I do :MoltenEvaluateLine on a very simple piece of python code (which does execute properly)

print("hello")
jotaefe0 commented 1 month ago

have you tried :noautocmd MoltenEnterOutput?