krivahtoo / silicon.nvim

Neovim plugin for silicon in Rust
MIT License
295 stars 10 forks source link

Nvim crashes on taking code snippet #52

Open mhanberg opened 2 months ago

mhanberg commented 2 months ago

Problem

Executing the :Silicon command crashses nvim. The image was still created and placed into my clipboard however.

Here is the macOS crash report: https://pastebin.com/m30B0rJX

OS: macOS Sonoma 14.6.1 arm64 Nvim:

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

config:

  {
    "krivahtoo/silicon.nvim",
    build = "./install.sh",
    opts = {
      font = "Hack",
      line_number = false,
      pad_horiz = 60, -- Horizontal padding
      pad_vert = 40, -- vertical padding
      gobble = true,
      shadow = {
        blur_radius = 0.0, -- (number) The blur radius for the shadow, set to 0.0 for no shadow.
      },
      window_controls = false,
      tab_width = 2,
    },
    config = function(_, opts)
      require("silicon").setup(opts)
    end,
    cmd = { "Silicon" },
    keys = {
      {
        "<space>sc",
        function()
          vim.cmd.Silicon()
        end,
        mode = "v",
        desc = "Take a silicon code snippet into the clipboard",
      },
    },
  },
mhanberg commented 2 months ago

Relevant lines from the crash report

0   nvim                                   0x104abb0cc nlua_pop_Object + 128
1   nvim                                   0x104abee08 nlua_call_pop_retval + 256
2   nvim                                   0x10498bc40 nvim_notify + 136
3   silicon.so                             0x1075c3258 nvim_oxi_api::global::notify::h52e0ee60aff6bdb8 + 116
4   silicon.so                             0x1074d50e8 silicon::save_image::hc16149331a8d0507 + 4836
5   silicon.so                             0x1074eab60 nvim_oxi_luajit::function::store::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h8fae34e6a6199c3f + 2100
6   silicon.so                             0x1075ca6bc nvim_oxi_luajit::function::store::c_fun::ha98acf5f107e4976 + 52
krivahtoo commented 2 months ago

What version of silicon.nvim are you using? Using :lua require('silicon').version

mhanberg commented 2 months ago

v0.5.1