| 1 |
QTerm.loadScript("utils.js"); |
| 2 |
QTerm.highlightKeywords = function(pattern) |
| 3 |
{ |
| 4 |
for (var i = 0; i < QTerm.rows(); i++) { |
| 5 |
var line = QTerm.getLine(i); |
| 6 |
var text = line.getText(); |
| 7 |
pattern.lastIndex = 0; |
| 8 |
while ((result = pattern.exec(text)) != null) { |
| 9 |
var index = line.beginIndex(result.index); |
| 10 |
|
| 11 |
var color = QTerm.setAttr(QTerm.Attr.Default|QTerm.Attr.Bold)|QTerm.setColor(QTerm.setFG(QTerm.Color.Red)|QTerm.setBG(QTerm.Color.Black)); |
| 12 |
line.replaceText(result[0],color,index, -1); |
| 13 |
} |
| 14 |
} |
| 15 |
} |
| 16 |
|