ESC[0m and ESC[m apply SCE_ERR_ES_BLACK when it should reset to default. View text-formatting which states:
| Value |
Description |
Behavior |
| 0 |
Default |
Returns all attributes to the default state prior to modification |
0 is not a colour. It is a reset to default state. StyleFromSequence() treats everything as a colour so it treats 0 as SCE_ERR_ES_BLACK .
The issue is that SCE_ERR_ES_BLACK is not visible if the background colour is black. So example:
ESC[31m Red colour ESC[m Cannot see this black coloured text if the background is black
This image posted shows the issue as CRLF are visible except for those after ESC[0m which are black on a black background.
Patch code:
diff --git a/lexers/LexErrorList.cxx b/lexers/LexErrorList.cxx
index 22f831ec..f8fbd447 100644
--- a/lexers/LexErrorList.cxx
+++ b/lexers/LexErrorList.cxx
@@ -371,7 +371,9 @@ void ColouriseErrorListLine(
return;
case 'm': // Colour command
styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ);
- portionStyle = StyleFromSequence(startSeq+2);
+ // ESC[m or ESC[0m reset to default style else get the colour style.
+ portionStyle = (startSeq[2] == 'm' || (startSeq[2] == '0' && startSeq[3] == 'm')) ?
+ SCE_ERR_DEFAULT : StyleFromSequence(startSeq+2);
break;
case 'K': // Erase to end of line -> ignore
styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ);
Updated LexErrorList.cxx and test files:
fix.zip
ESC[0mandESC[mapplySCE_ERR_ES_BLACKwhen it should reset to default. View text-formatting which states:0 is not a colour. It is a reset to default state.
StyleFromSequence()treats everything as a colour so it treats 0 asSCE_ERR_ES_BLACK.The issue is that
SCE_ERR_ES_BLACKis not visible if the background colour is black. So example:This image posted shows the issue as CRLF are visible except for those after
ESC[0mwhich are black on a black background.Patch code:
Updated
LexErrorList.cxxand test files:fix.zip