@@ -629,6 +629,7 @@ M.open_buf = function(file_name, target, kind, toggle)
629
629
return ww , wh , top , (w - ww ) / 2
630
630
end , { on_leave = false , escape = false , persist = true }, {
631
631
border = M .config .style_popup_border or " single" ,
632
+ zindex = M .config .zindex ,
632
633
})
633
634
634
635
if not toggle then
@@ -1157,6 +1158,7 @@ M.cmd.ChatFinder = function()
1157
1158
local gid = M .helpers .create_augroup (" GpChatFinder" , { clear = true })
1158
1159
1159
1160
-- prepare three popup buffers and windows
1161
+ local style = { border = M .config .style_chat_finder_border or " single" , zindex = M .config .zindex }
1160
1162
local ratio = M .config .style_chat_finder_preview_ratio or 0.5
1161
1163
local top = M .config .style_chat_finder_margin_top or 2
1162
1164
local bottom = M .config .style_chat_finder_margin_bottom or 8
@@ -1171,7 +1173,7 @@ M.cmd.ChatFinder = function()
1171
1173
return math.floor (ww * (1 - ratio )), wh , top , left
1172
1174
end ,
1173
1175
{ gid = gid },
1174
- { border = M . config . style_chat_finder_border or " single " }
1176
+ style
1175
1177
)
1176
1178
1177
1179
local preview_buf , preview_win , preview_close , preview_resize = M .render .popup (
@@ -1183,7 +1185,7 @@ M.cmd.ChatFinder = function()
1183
1185
return ww * ratio , wh , top , left + math.ceil (ww * (1 - ratio )) + 2
1184
1186
end ,
1185
1187
{ gid = gid },
1186
- { border = M . config . style_chat_finder_border or " single " }
1188
+ style
1187
1189
)
1188
1190
1189
1191
vim .api .nvim_set_option_value (" filetype" , " markdown" , { buf = preview_buf })
@@ -1196,7 +1198,7 @@ M.cmd.ChatFinder = function()
1196
1198
return w - left - right , 1 , h - bottom , left
1197
1199
end ,
1198
1200
{ gid = gid },
1199
- { border = M . config . style_chat_finder_border or " single " }
1201
+ style
1200
1202
)
1201
1203
-- set initial content of command buffer
1202
1204
vim .api .nvim_buf_set_lines (command_buf , 0 , - 1 , false , { M .config .chat_finder_pattern })
@@ -1841,16 +1843,22 @@ M.Prompt = function(params, target, agent, template, prompt, whisper, callback)
1841
1843
M ._toggle_close (M ._toggle_kind .popup )
1842
1844
-- create a new buffer
1843
1845
local popup_close = nil
1844
- buf , win , popup_close , _ = M .render .popup (nil , M ._Name .. " popup (close with <esc>/<C-c>)" , function (w , h )
1845
- local top = M .config .style_popup_margin_top or 2
1846
- local bottom = M .config .style_popup_margin_bottom or 8
1847
- local left = M .config .style_popup_margin_left or 1
1848
- local right = M .config .style_popup_margin_right or 1
1849
- local max_width = M .config .style_popup_max_width or 160
1850
- local ww = math.min (w - (left + right ), max_width )
1851
- local wh = h - (top + bottom )
1852
- return ww , wh , top , (w - ww ) / 2
1853
- end , { on_leave = true , escape = true }, { border = M .config .style_popup_border or " single" })
1846
+ buf , win , popup_close , _ = M .render .popup (
1847
+ nil ,
1848
+ M ._Name .. " popup (close with <esc>/<C-c>)" ,
1849
+ function (w , h )
1850
+ local top = M .config .style_popup_margin_top or 2
1851
+ local bottom = M .config .style_popup_margin_bottom or 8
1852
+ local left = M .config .style_popup_margin_left or 1
1853
+ local right = M .config .style_popup_margin_right or 1
1854
+ local max_width = M .config .style_popup_max_width or 160
1855
+ local ww = math.min (w - (left + right ), max_width )
1856
+ local wh = h - (top + bottom )
1857
+ return ww , wh , top , (w - ww ) / 2
1858
+ end ,
1859
+ { on_leave = true , escape = true },
1860
+ { border = M .config .style_popup_border or " single" , zindex = M .config .zindex }
1861
+ )
1854
1862
-- set the created buffer as the current buffer
1855
1863
vim .api .nvim_set_current_buf (buf )
1856
1864
-- set the filetype to markdown
0 commit comments