Skip to content

Commit 5b0feb2

Browse files
committed
Add option to disable markdown conceal
1 parent 7565325 commit 5b0feb2

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
![image](https://github.com/user-attachments/assets/9ee30811-0fb8-4500-91f6-34ea6b26adea)
1414

15-
https://github.com/user-attachments/assets/8cad5643-63b2-4641-a5c4-68bc313f20e6
15+
<https://github.com/user-attachments/assets/8cad5643-63b2-4641-a5c4-68bc313f20e6>
1616

1717
</div>
1818

@@ -255,9 +255,9 @@ Define your own system prompts in the configuration (similar to `prompts`):
255255

256256
Sticky prompts persist across chat sessions. They're useful for maintaining context or agent selection. They work as follows:
257257

258-
1. Prefix text with `> ` using markdown blockquote syntax
258+
1. Prefix text with `>` using markdown blockquote syntax
259259
2. The prompt will be copied at the start of every new chat prompt
260-
3. Edit sticky prompts freely while maintaining the `> ` prefix
260+
3. Edit sticky prompts freely while maintaining the `>` prefix
261261

262262
Examples:
263263

@@ -486,6 +486,8 @@ Below are all available configuration options with their default values:
486486
show_help = true, -- Shows help message as virtual lines when waiting for user input
487487
highlight_selection = true, -- Highlight selection
488488
highlight_headers = true, -- Highlight headers in chat, disable if using markdown renderers (like render-markdown.nvim)
489+
-- Hide markdown syntax (like backticks) by using conceallevel=2 in Neovim. When false, show markdown syntax.
490+
conceal_markdown_syntax = true,
489491
references_display = 'virtual', -- 'virtual', 'write', Display references in chat as virtual text or write to buffer
490492
auto_follow_cursor = true, -- Auto-follow cursor in chat
491493
auto_insert_mode = false, -- Automatically enter insert mode when opening window and on new prompt

lua/CopilotChat/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ return {
9696
show_folds = true, -- Shows folds for sections in chat
9797
highlight_selection = true, -- Highlight selection
9898
highlight_headers = true, -- Highlight headers in chat, disable if using markdown renderers (like render-markdown.nvim)
99+
conceal_markdown_syntax = true, -- Whether to hide markdown syntax (like backticks) by using concea
99100
references_display = 'virtual', -- 'virtual', 'write', Display references in chat as virtual text or write to buffer
100101
auto_follow_cursor = true, -- Auto-follow cursor in chat
101102
auto_insert_mode = false, -- Automatically enter insert mode when opening window and on new prompt

lua/CopilotChat/ui/chat.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,9 @@ function Chat:open(config)
340340
vim.wo[self.winnr].wrap = true
341341
vim.wo[self.winnr].linebreak = true
342342
vim.wo[self.winnr].cursorline = true
343-
vim.wo[self.winnr].conceallevel = 2
343+
-- Set conceallevel based on config: hide markdown syntax when enabled
344+
local conceal_level = config.conceal_markdown_syntax and 2 or 0
345+
vim.wo[self.winnr].conceallevel = conceal_level
344346
vim.wo[self.winnr].foldlevel = 99
345347
if config.show_folds then
346348
vim.wo[self.winnr].foldcolumn = '1'

0 commit comments

Comments
 (0)