feat(tui, coding-agent): add configurable code block indent setting (#855)

Add markdown.codeBlockIndent setting to customize indentation prefix for
rendered code blocks. Default remains 2 spaces for visual clarity, but
setting to empty string removes indentation for easier copy/paste of
code snippets to scripts, editors, or other tools.

Changes:
- tui: add optional codeBlockIndent to MarkdownTheme interface
- coding-agent: add MarkdownSettings with codeBlockIndent property
- coding-agent: compose theme with settings at call sites (no global state)
- coding-agent: update message components to accept optional MarkdownTheme

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
Michael Renner 2026-01-19 22:36:03 +01:00 committed by GitHub
parent 46545276e3
commit 20c7b5fed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 85 additions and 29 deletions

View file

@ -47,6 +47,10 @@ export interface ThinkingBudgetsSettings {
high?: number;
}
export interface MarkdownSettings {
codeBlockIndent?: string; // default: " "
}
export interface Settings {
lastChangelogVersion?: string;
defaultProvider?: string;
@ -72,6 +76,7 @@ export interface Settings {
thinkingBudgets?: ThinkingBudgetsSettings; // Custom token budgets for thinking levels
editorPaddingX?: number; // Horizontal padding for input editor (default: 0)
showHardwareCursor?: boolean; // Show terminal cursor while still positioning it for IME
markdown?: MarkdownSettings;
}
/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */
@ -500,4 +505,8 @@ export class SettingsManager {
this.globalSettings.editorPaddingX = Math.max(0, Math.min(3, Math.floor(padding)));
this.save();
}
getCodeBlockIndent(): string {
return this.settings.markdown?.codeBlockIndent ?? " ";
}
}