This has a side effect. It applies the markdown type to not only popup windows but also the search bar in :GpChatFinder, which is created by the create_popup() function in the same way as popup windows.
I think a more proper solution would be to move the vim.api.nvim_buf_set_option(buf, "filetype", "markdown") to just below the 0read file_name line in the open_buf() function.
The popup for :GpChatNew works differently than other targets. :GpChatNew <target> first creates a .md file containing the template, and then uses the open_buf() function to read it in. When reading the template.md, all targets (split, vsplit, tabnew) except for popup simply open it, and the filetype is detected by checking the file name. The popup target, however, creates a new window and copy-pastes the content from the template.md, and the filetype is not detected and left empty.
This has a side effect. It applies the markdown type to not only popup windows but also the search bar in
:GpChatFinder
, which is created by thecreate_popup()
function in the same way as popup windows.I think a more proper solution would be to move the
vim.api.nvim_buf_set_option(buf, "filetype", "markdown")
to just below the0read file_name
line in theopen_buf()
function.The
popup
for:GpChatNew
works differently than other targets.:GpChatNew <target>
first creates a .md file containing the template, and then uses theopen_buf()
function to read it in. When reading the template.md, all targets (split
,vsplit
,tabnew
) except forpopup
simply open it, and the filetype is detected by checking the file name. Thepopup
target, however, creates a new window and copy-pastes the content from the template.md, and the filetype is not detected and left empty.