Commits

abudden committed 9105a3e

Alternative IsKeyword implementation: this is MUCH quicker than the old one (fixes #35).

Comments (0)

Files changed (1)

plugin/TagHighlight/module/utilities.py

         else:
             raise ValueError('Unrecognised iskeyword part: ' + valid)
 
-    return validList
+    kRE = re.compile(r'^['+re.escape(''.join(validList))+r']+$')
+    return kRE
 
 
 def IsValidKeyword(keyword, iskeyword):
-    for char in keyword:
-        if not char in iskeyword:
-            return False
-    return True
+    if iskeyword.match(keyword) is not None:
+        return True
+    return False
 
 def rglob(path, pattern):
     # Tweaked version of the stackoverflow answer: