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
608 stars 33 forks source link

[Bug] MoltenEnterOutput error pynvim.api.common.NvimError: Invalid key: 'footer' #192

Closed modestosrc closed 6 months ago

modestosrc commented 6 months 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 - OK Python module pnglatex found - 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
`:checkhealth provider` (the python parts) Python 3 provider (optional) ~ - Using: g:python3_host_prog = "/home/mateus/anaconda3/bin/python" - Executable: /home/mateus/anaconda3/bin/python - Python version: 3.12.3 - pynvim version: 0.5.0 - OK Latest pynvim is installed. Python virtualenv ~ - OK no $VIRTUAL_ENV

Description

When trying to enter the output i get this error, but after i dismiss it the cursor enter the output as normal. 2024-04-27_16-14

If i comment out self.display_win.api.set_config({"footer": ""}) in outputbuffer.py the error goes away.

    def remove_window_footer(self) -> None:
        if self.display_win is not None:
            ...
            #self.display_win.api.set_config({"footer": ""})

Reproduction Steps

  1. Evaluate Visual
  2. Choose python3 kernel
  3. Enter Output
vim.keymap.set("v", "<leader>mv", ":<C-u>MoltenEvaluateVisual<CR>gv",
  { silent = true, desc = "evaluate visual selection" })

vim.keymap.set("n", "<leader>mo", ":noautocmd MoltenEnterOutput<CR>",
  { silent = true, desc = "show/enter output" })

My config:

  use { 'benlubas/molten-nvim',
    config = function()
      vim.g.molten_image_provider = "image.nvim"
      vim.g.molten_enter_output_behavior = "open_and_enter"
      vim.g.molten_output_win_max_height = 40
      vim.g.molten_output_win_max_width = 80
      vim.g.molten_output_show_more = true
      vim.g.molten_output_virt_lines = true
      vim.g.molten_virt_text_output = true
      vim.g.molten_auto_open_output = false
    end,
  }

Expected Behavior

To not receive an error

modestosrc commented 6 months ago

changing vim.g.molten_output_show_more to false fixes it too

modestosrc commented 6 months ago

I was not running neovim 10.0+ as written in the README for g:molten_output_show_more