@@ -7,8 +7,14 @@ var indices_id = -1
77
88def IndicesCallback (id: number , idx: number )
99 if idx > 0
10- var selection = getbufline (winbufnr (id), idx)[0 ]
11- exe $ ' edit {selection}'
10+
11+ if typename (g: markdown_extras_indices ) == " list<string>"
12+ var selection = getbufline (winbufnr (id), idx)[0 ]
13+ exe $ ' edit {selection}'
14+ elseif typename (g: markdown_extras_indices ) == " dict<string>"
15+ var selection = getbufline (winbufnr (id), idx)[0 ]
16+ exe $ ' edit {g:markdown_extras_indices[selection]}'
17+ endif
1218 indices_id = -1
1319 endif
1420enddef
@@ -32,8 +38,13 @@ export def ShowIndices()
3238 wrap : 0 ,
3339 drag: 0 ,
3440 }
35- indices_id = popup_create (g: markdown_extras_indices , opts)
36- links.ShowPromptPopup (indices_id, g: markdown_extras_indices , " indices: " )
41+ if typename (g: markdown_extras_indices ) == " list<string>"
42+ indices_id = popup_create (g: markdown_extras_indices , opts)
43+ links.ShowPromptPopup (indices_id, g: markdown_extras_indices , " indices: " )
44+ elseif typename (g: markdown_extras_indices ) == " dict<string>"
45+ indices_id = popup_create (keys (g: markdown_extras_indices ), opts)
46+ links.ShowPromptPopup (indices_id, keys (g: markdown_extras_indices ), " indices: " )
47+ endif
3748 else
3849 utils.Echoerr (" 'g:markdown_extras_indices' not set" )
3950 endif
0 commit comments