#REFACTORING by cg
class: AbstractSyntaxHighlighter
added: #markErrorFrom:to:
changed:
#parseError:position:to:
#showErrorMessage:position:
#syntaxError:position:to:
--- a/AbstractSyntaxHighlighter.st Wed May 16 14:51:19 2018 +0200
+++ b/AbstractSyntaxHighlighter.st Wed May 16 14:51:32 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 2006 by eXept Software AG
All Rights Reserved
@@ -558,27 +560,21 @@
"/ Transcript showCR:aMessage.
super parseError:aMessage position:position to:endPos.
- self
- markFrom:position to:endPos
- withEmphasis:nil color:UserPreferences current errorColor
+ self markErrorFrom:position to:endPos
!
showErrorMessage:aMessage position:pos
"/ Transcript showCR:aMessage.
super showErrorMessage:aMessage position:pos.
- self
- markFrom:pos to:nil
- withEmphasis:nil color:UserPreferences current errorColor
+ self markErrorFrom:pos to:nil "/ to the end
!
syntaxError:aMessage position:position to:endPos
"/ Transcript showCR:aMessage.
super syntaxError:aMessage position:position to:endPos.
- self
- markFrom:position to:endPos
- withEmphasis:nil color:UserPreferences current errorColor
+ self markErrorFrom:position to:endPos
!
warning:msg position:pos1 to:pos2
@@ -674,6 +670,12 @@
"Modified: / 21-10-2017 / 14:15:48 / cg"
!
+markErrorFrom:pos1 to:pos2
+ self
+ markFrom:pos1 to:pos2
+ withEmphasis:nil color:UserPreferences current errorColor
+!
+
markFrom:pos1 length:len withEmphasis:fontEmp color:clrIn
self markFrom:pos1 to:pos1+len-1 withEmphasis:fontEmp color:clrIn