From 26b2280fc2946dde0867b624460706029b9090f3 Mon Sep 17 00:00:00 2001 From: daboe01 Date: Sat, 20 Jun 2026 10:40:46 +0200 Subject: [PATCH] fixed: color spill issue --- AppKit/CPTextView/_CPRTFParser.j | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/AppKit/CPTextView/_CPRTFParser.j b/AppKit/CPTextView/_CPRTFParser.j index 9028e49f5..b2e80b295 100644 --- a/AppKit/CPTextView/_CPRTFParser.j +++ b/AppKit/CPTextView/_CPRTFParser.j @@ -797,10 +797,15 @@ var kRgsymRtf = { [self _flushCurrentRun]; var fontIndex = parseInt(param) - 1; - if (_currentRun && fontIndex >= 0) - _currentRun.fgColour = _colorArray[fontIndex]; + if (_currentRun) + { + if (fontIndex >= 0 && fontIndex < _colorArray.length) + _currentRun.fgColour = _colorArray[fontIndex]; + else + _currentRun.fgColour = nil; + } - break; + break; case "cb": // change background color case "highlight":