summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/document/katehighlight.cpp
Unidiff
Diffstat (limited to 'noncore/apps/tinykate/libkate/document/katehighlight.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/document/katehighlight.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katehighlight.cpp b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
index 539d356..89024f7 100644
--- a/noncore/apps/tinykate/libkate/document/katehighlight.cpp
+++ b/noncore/apps/tinykate/libkate/document/katehighlight.cpp
@@ -386,19 +386,24 @@ const QChar *HlAnyChar::checkHgl(const QChar *s, int len, bool)
386{ 386{
387 if (ustrchr(_charList, _charListLen, *s)) return s +1; 387 if (ustrchr(_charList, _charListLen, *s)) return s +1;
388 return 0L; 388 return 0L;
389} 389}
390 390
391HlRegExpr::HlRegExpr(int attribute, int context,QString regexp) 391HlRegExpr::HlRegExpr(int attribute, int context,QString regexp)
392 : HlItem(attribute, context) { 392 : HlItem(attribute, context), Expr(0) {
393 393
394 handlesLinestart=regexp.startsWith("^"); 394 handlesLinestart=regexp.startsWith("^");
395 if(!handlesLinestart) regexp.prepend("^"); 395 if(!handlesLinestart) regexp.prepend("^");
396 Expr=new QRegExp3(regexp); 396 Expr=new QRegExp3(regexp);
397} 397}
398 398
399HlRegExpr::~HlRegExpr()
400{
401 delete Expr;
402}
403
399const QChar *HlRegExpr::checkHgl(const QChar *s, int len, bool lineStart) 404const QChar *HlRegExpr::checkHgl(const QChar *s, int len, bool lineStart)
400{ 405{
401 if ((!lineStart) && handlesLinestart) return 0; 406 if ((!lineStart) && handlesLinestart) return 0;
402 407
403 QString line(s,len); 408 QString line(s,len);
404 int pos = Expr->search( line, 0 ); 409 int pos = Expr->search( line, 0 );