DNLHC/glance.nvim

Add an action to open folds

Closed this issue · 1 comments

I'm trying to setup a list mappings to be able to open a folded list with 'l' instead of enter. However, I did not see any action that would allow me to open folds. I saw a open action but this does not seem to do what I'd like to do and it errors out anyway with:

E5108: Error executing lua: ...k/myNeovimPackages/start/glance-nvim/lua/glance/init.lua:229: method: expected 'definitions'|'type_definitions'|'references'|'implementations', got nil                                                                                               
stack traceback:                                                                                                                                                                                                                                                                     
        [C]: in function 'error'                                                                                                                                                                                                                                                     
        vim/shared.lua: in function 'validate'                                                                                                                                                                                                                                       
        ...k/myNeovimPackages/start/glance-nvim/lua/glance/init.lua:229: in function <...k/myNeovimPackages/start/glance-nvim/lua/glance/init.lua:228>   

Is there currently a way to achieve what I'd like to do?

DNLHC commented

Hi,
For that you should use actions.jump action, it toggles folds when the current selected item in the list is a fold.
I probably should specify that in the docs. Thanks.

local glance = require('glance')
local actions = glance.actions
glance.setup({
  mappings = {
    list = {
      ['l'] = actions.jump,
      -- ['<CR>'] = false -- if you wanna disable the default mapping
    }
  }
})