mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 19:05:11 +00:00
Add intra-line diff highlighting for edit tool
- Extract diff rendering to dedicated diff.ts component - Show word-level changes with inverse highlighting when a single line is modified - Use diffWords for cleaner token grouping (includes adjacent whitespace) - Only apply intra-line diff when exactly 1 removed and 1 added line (true modification) - Multi-line changes show all removed then all added without incorrect pairing - Add theme.inverse() method for inverse text styling
This commit is contained in:
parent
1a944f50f9
commit
5117187362
3 changed files with 155 additions and 12 deletions
|
|
@ -351,6 +351,10 @@ export class Theme {
|
|||
return chalk.underline(text);
|
||||
}
|
||||
|
||||
inverse(text: string): string {
|
||||
return chalk.inverse(text);
|
||||
}
|
||||
|
||||
getFgAnsi(color: ThemeColor): string {
|
||||
const ansi = this.fgColors.get(color);
|
||||
if (!ansi) throw new Error(`Unknown theme color: ${color}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue