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:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user