gp.nvim
gp.nvim copied to clipboard
fix: set the popup window to markdown filetype
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.
@tanloong Yeah, it was my mistake. I browsed the code base again and find it you are right. Thanks!
I ran the git rebase, so that we only have one commit