Skip to content

perf: skip syntax highlighting for agent - #15982

Open
slarse wants to merge 3 commits into
masterfrom
skip-syntax-highlighting-for-agent
Open

slarse wants to merge 3 commits into
masterfrom
skip-syntax-highlighting-for-agent

Conversation

@slarse

@slarse slarse commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Vibed, not yet looked through this. But we should save plenty of performance inbut diff by not syntax highlighting.

Benchmarks will include AI output mode from tomorrow's run, so this should go in at the very earliest after that.

@github-actions github-actions Bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Sep 17, 2026
@slarse
slarse force-pushed the skip-syntax-highlighting-for-agent branch from 054e027 to 0ea35a1 Compare September 18, 2026 09:46
@slarse
slarse marked this pull request as ready for review September 18, 2026 14:07
Copilot AI lite review requested due to automatic review settings September 18, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Optimizes but diff for agent output by skipping syntax highlighting while preserving diff colors and layout.

Changes:

  • Selects plain rendering for agent mode.
  • Adds tab expansion support.
  • Adds human and agent snapshot coverage.
File summaries
File Description
crates/but/tests/but/command/snapshots/diff/human-syntax.stdout.term.svg Human syntax-highlighted output snapshot.
crates/but/tests/but/command/snapshots/diff/agent-no-syntax.stdout.term.svg Uncommitted agent output snapshot.
crates/but/tests/but/command/snapshots/diff/agent-committed-no-syntax.stdout.term.svg Committed agent output snapshot.
crates/but/tests/but/command/diff.rs Agent rendering regression tests.
crates/but/src/utils/diff_rendering.rs Tab expansion support for plain rendering.
crates/but/src/command/legacy/diff.rs Selects highlighted or plain rendering based on agent mode.
Review details
  • Files reviewed: 3/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants