Skip to content

Add opt-in control for chat markdown markup visibility - #267

Merged
ericdallo merged 1 commit into
editor-code-assistant:masterfrom
itkonen:master
Jul 8, 2026
Merged

ericdallo merged 1 commit into
editor-code-assistant:masterfrom
itkonen:master

Conversation

@itkonen

@itkonen itkonen commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

This PR adds a new option to disable code markup hiding.

With eca-chat-hide-markdown-markup set to nil most markdown content (e.g. headings and lists) are shown without markup but code inline code and blocks blocks show inside backticks.

Personally I prefer this because it reveals the language label of code blocks. Furthermore it makes copy-pasting code easier, because, when markup is hidden, backticks randomly get copied along with code.

AI Summary

Adds eca-chat-hide-markdown-markup, a new chat display option that controls whether markdown markup is hidden in ECA chat buffers.

The default preserves the current behavior:

(setq eca-chat-hide-markdown-markup t)

Users who prefer to see markdown syntax can set:

(setq eca-chat-hide-markdown-markup nil)

This keeps markdown fences, backticks, and other markup visible while retaining the existing markdown rendering setup.

Details

This change:

  • adds eca-chat-hide-markdown-markup;
  • keeps the default chat rendering unchanged;
  • applies the same visibility setting to table helper buffers so table display-width calculations and eca-table-open stay consistent with chat rendering;
  • documents the option in the README and changelog;
  • adds tests for both the default hidden-markup behavior and the visible-markup option.

Motivation

Some users prefer seeing the original markdown syntax in chat buffers, especially around fenced code blocks and inline code. This option makes that behavior configurable without changing the default presentation for existing users.

Testing

Added focused tests covering:

  • default hidden-markup behavior;
  • opt-in visible-markup behavior;
  • table display-width calculations respecting the option;
  • eca-table-open respecting the option in the dedicated table buffer.

Local verification:

  • git diff --check origin/master...HEAD
  • Editor diagnostics for changed files reported no issues.

Introduce `eca-chat-hide-markdown-markup` so users who see fenced code
blocks jump while typing or streaming can keep markdown fences/backticks
visible without changing the default chat rendering behavior.

Apply the same visibility setting to table helper buffers so table width
measurement and `eca-table-open` stay consistent with chat display. Add
focused tests and document the option in the README and changelog.

🤖 Generated with [ECA](https://eca.dev) (openai/gpt-5.5 - xhigh)

Co-Authored-By: eca-agent <git@eca.dev>
@ericdallo

Copy link
Copy Markdown
Member

@itkonen I wonder if we need this, because we already can:

(add-hook 'eca-chat-mode-hook
          (lambda () (remove-from-invisibility-spec 'markdown-markup)))

and
eca-chat-copy-at-point to copy code blocks

@itkonen

itkonen commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Yes, that works fine and is nearly equivalent.

One minor problem is that tables get misaligned if cells contain visible markup **bold text** or `inline code`. Another is caveat is that the trick is not very easy to discover.

But true, I don't know how many people prefer keeping code blocks visible, so I'm not sure if the extra lines and complexity are worth it.

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see, I'm approving this as the code to maintain is considerably simple, so not a big deal from my POV, thanks

@ericdallo
ericdallo merged commit f04a580 into editor-code-assistant:master Jul 8, 2026
15 checks passed
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.

2 participants