File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ local create_win = function ()
8888 return win
8989end
9090
91+ print_panel .insert = function ()
92+ print (vim .inspect (print_panel .entries ))
93+ end
9194print_panel .select = function (id )
9295 if not id then id = print_panel .current or 1 end
9396 local selection = print_panel .entries [id ]
@@ -136,11 +139,14 @@ print_panel.create = function (bufnr)
136139 local keymaps = {
137140 [" j" ] = print_panel .next ,
138141 [" k" ] = print_panel .prev ,
139- [" <CR>" ] = print_panel .select ,
142+ [" <CR>" ] = print_panel .insert ,
140143 }
141144
142145 for key , fn in pairs (keymaps ) do
143- vim .keymap .set (" n" , key , fn , {
146+ vim .keymap .set (" n" , key , function ()
147+ -- necessary because of possible bug
148+ return vim .api .nvim_get_current_buf () == print_panel .bufnr and fn ()
149+ end , {
144150 silent = true ,
145151 buffer = print_panel .bufnr ,
146152 })
Original file line number Diff line number Diff line change @@ -8,8 +8,13 @@ local lsp_handlers = {
88local handlers = {
99 [" PanelSolution" ] = function (_ , result , _ , config )
1010 if not result then return " err" end
11- if result .panelId then config .callbacks [result .panelId ](result )
12- else for _ , callback in pairs (config .callbacks ) do callback () end end
11+ if result .panelId and config .callbacks [result .panelId ] then
12+ config .callbacks [result .panelId ](result )
13+ elseif not config .callbacks [result .panelId ] and result .panelId then
14+ return
15+ else
16+ for _ , callback in pairs (config .callbacks ) do callback () end
17+ end
1318 end ,
1419
1520 [" PanelSolutionsDone" ] = function (_ , _ , _ , config )
You can’t perform that action at this time.
0 commit comments