Skip to content

fix: set the popup window to markdown filetype#128

Merged
Robitx merged 1 commit intoRobitx:mainfrom
XXiaoA:main
May 28, 2024
Merged

fix: set the popup window to markdown filetype#128
Robitx merged 1 commit intoRobitx:mainfrom
XXiaoA:main

Conversation

@XXiaoA
Copy link
Contributor

@XXiaoA XXiaoA commented Apr 6, 2024

No description provided.

@tanloong
Copy link
Contributor

tanloong commented Apr 6, 2024

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.

@XXiaoA
Copy link
Contributor Author

XXiaoA commented Apr 12, 2024

@tanloong Yeah, it was my mistake. I browsed the code base again and find it you are right. Thanks!

@XXiaoA
Copy link
Contributor Author

XXiaoA commented Apr 12, 2024

I ran the git rebase, so that we only have one commit

@Robitx Robitx merged commit 486a061 into Robitx:main May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants