Skip to content

feat: enhanced header rendering in the chat window#336

Merged
deathbeam merged 1 commit intoCopilotC-Nvim:canaryfrom
folke:canary
May 27, 2024
Merged

feat: enhanced header rendering in the chat window#336
deathbeam merged 1 commit intoCopilotC-Nvim:canaryfrom
folke:canary

Conversation

@folke
Copy link
Copy Markdown
Contributor

@folke folke commented May 27, 2024

As discussed, the separator is now repeated in a virtual line and has hl group CopilotChatSeparator.

The headers have hl_group CopilotChatHeader.

I didn't change the default header strings, so they still have ##, but that's no longer needed to get the same styling.
 
image

With custom header strings:

image

Closes #334


local Chat = class(function(self, mark_ns, help, on_buf_create)
self.mark_ns = mark_ns
self.header_ns = vim.api.nvim_create_namespace('copilot-chat-headers')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating a namespace returns the existing one when it already exists, so no need to create it during setup and then pass it down.

@deathbeam deathbeam added the enhancement New feature or request label May 27, 2024
@deathbeam deathbeam merged commit 04c90a5 into CopilotC-Nvim:canary May 27, 2024
@GitMurf
Copy link
Copy Markdown
Contributor

GitMurf commented May 28, 2024

@deathbeam will this effect saving a chat conversation? Historically you could save the buffer as markdown file and have a nicely formatted conversation in markdown. Is that no longer the case if we are removing the ## Heading Syntax?

@deathbeam
Copy link
Copy Markdown
Collaborator

@deathbeam will this effect saving a chat conversation? Historically you could save the buffer as markdown file and have a nicely formatted conversation in markdown. Is that no longer the case if we are removing the ## Heading Syntax?

The syntax is still there this just added some extmarks on top for better visuals and thats it, do not affects how the data are stored at all

@GitMurf
Copy link
Copy Markdown
Contributor

GitMurf commented May 28, 2024

The syntax is still there this just added some extmarks on top for better visuals and thats it, do not affects how the data are stored at all

Oh ok. I guess I got a little confused with folke's custom header strings screenshot above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: enhanced rendering of the chat widow

3 participants