chrisgrieser / nvim-scissors

Automagical editing and creation of snippets.
MIT License
384 stars 4 forks source link

[Bug]: deleting does not work #14

Closed ilan-schemoul closed 5 months ago

ilan-schemoul commented 5 months ago

Bug Description

:EditSnippet then delete snippet error is

   Error  20:41:35 msg_show.emsg E5108: Error executing lua: .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_get_option'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: in function 'delete_cb'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:842: in function 'delete_selection'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1179: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:290: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:289>
   Error  20:41:46 msg_show.emsg E5108: Error executing lua: .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_get_option'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: in function 'delete_cb'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:842: in function 'delete_selection'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1179: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:290: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:289>
   Error  20:41:54 msg_show.emsg E5108: Error executing lua: .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_get_option'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: in function 'delete_cb'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:842: in function 'delete_selection'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1179: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:290: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:289>
   Warn  20:42:12 notify.warn nvim-scissors No snippets found for filetype: lua
   Warn  20:42:21 notify.warn nvim-scissors Body is empty. No changes made.
20:42:35 msg_show     deletesnipp /deletesnipp             
   Warn  20:42:46 notify.warn nvim-scissors No snippets found for filetype: lua
   Error  20:42:52 msg_show.emsg E5108: Error executing lua: .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_get_option'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: in function 'delete_cb'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:842: in function 'delete_selection'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1179: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:290: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:289>
   Error  20:46:09 msg_show.emsg E5108: Error executing lua: .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: Invalid 'buffer': Expected Lua number
stack traceback:
    [C]: in function 'nvim_buf_get_option'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1180: in function 'delete_cb'
    ...share/nvim/lazy/telescope.nvim/lua/telescope/pickers.lua:842: in function 'delete_selection'
    .../nvim/lazy/telescope.nvim/lua/telescope/actions/init.lua:1179: in function 'run_replace_or_original'
    ...re/nvim/lazy/telescope.nvim/lua/telescope/actions/mt.lua:65: in function 'key_func'
    ...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:290: in function <...hare/nvim/lazy/telescope.nvim/lua/telescope/mappings.lua:289>
20:41:33 msg_ruler 27,3          All
20:41:33 msg_showcmd :

Relevant Screenshot

No response

To Reproduce

:ScissorsEditSnippet use keymap you defined for deletion

neovim version

0.10

Make sure you have done the following

chrisgrieser commented 5 months ago

To Reproduce

:ScissorsEditSnippet use keymap you defined for deletion

Did you use the keymap in the telescope window, maybe? Because the error looks like a telescope error and not like an error from scissors.

The deletion keymap is for the popup window where you edit a snippet, not for the telescope window. (Basically: :ScissorsEditSnippet → select a snippet → <CR> → use delete keymap here)

chrisgrieser commented 5 months ago

Closing this, since it's apparently not an issue with this plugin