1. abudden
  2. TagHighlight

Commits

abudden  committed 7b0fe2b

Wrap syntax matches with word boundaries.

  • Participants
  • Parent commits 0d29560
  • Branches default

Comments (0)

Files changed (6)

File plugin/TagHighlight/module/generation.py

View file
                                     for ch in charactersToEscape:
                                         escapedKeyword = escapedKeyword.replace(ch, '\\' + ch)
                                     if options['IncludeSynMatches']:
-                                        matchEntries.add('syn match ' + thisType + ' ' + patChar + escapedKeyword + patChar)
+                                        matchEntries.add('syn match ' + thisType + ' ' + patChar + r'\<' + escapedKeyword + r'\>' + patChar)
                                     matchDone = True
                                     break
 
 
                 if keyword.lower() in vim_synkeyword_arguments:
                     if not options['SkipVimKeywords']:
-                        matchEntries.add('syn match ' + thisType + ' /' + keyword + '/')
+                        matchEntries.add('syn match ' + thisType + r' /\<' + keyword + r'\>/')
                     continue
 
                 temp = keycommand + " " + keyword

File plugin/TagHighlight/standard_libraries/android/android_sdk.taghl

View file
 syn keyword CTagsInterface TransformationMethod PartSource PerformanceCollectorTestCase IConstructor Suppress
 syn keyword CTagsPackage dxconvext signature dot java_cup otherpackage otherpkg dxc data proguard dasm SQLite jdiff other util vogar tests
 
-syn match CTagsClass /Contains/
-syn match CTagsClass /Display/
-syn match CTagsField /CONTAINED/
-syn match CTagsField /DISPLAY/
-syn match CTagsField /TRANSPARENT/
-syn match CTagsField /display/
-syn match CTagsInterface /Display/
-syn match CTagsMethod /Contains/
-syn match CTagsMethod /Display/
-syn match CTagsMethod /contains/
-syn match CTagsMethod /display/
-syn match CTagsMethod /fold/
+syn match CTagsClass /\<Contains\>/
+syn match CTagsClass /\<Display\>/
+syn match CTagsField /\<CONTAINED\>/
+syn match CTagsField /\<DISPLAY\>/
+syn match CTagsField /\<TRANSPARENT\>/
+syn match CTagsField /\<display\>/
+syn match CTagsInterface /\<Display\>/
+syn match CTagsMethod /\<Contains\>/
+syn match CTagsMethod /\<Display\>/
+syn match CTagsMethod /\<contains\>/
+syn match CTagsMethod /\<display\>/
+syn match CTagsMethod /\<fold\>/
 
 syn cluster javaTop add=CTagsEnumeratorName,CTagsEnumerationValue,CTagsMethod,CTagsClass,CTagsField,CTagsInterface,CTagsPackage

File plugin/TagHighlight/standard_libraries/jdk/jdk.taghl

View file
 syn keyword CTagsInterface Autoscroll HandshakeCompletedListener Array ScatteringByteChannel DescriptorKey UnDescribedMBean GSSNameSpi ToolkitThreadBlockedHandler LayoutEngineFactory BeanContextChild LoginModule EventListener AclEntry Future LogFactory XDragSourceProtocolListener SnmpMibRequest
 syn keyword CTagsPackage edu editors util p annot packagedir testapp j2dbench Serialize install ilib transparentruler a bootreporter apackage pkg xmlkit b indify common package1 package2 com reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongpackagename NonSerializable comSB comSA serialver bench test jar1 provider extension beans infos
 
-syn match CTagsClass /Contains/
-syn match CTagsEnumerationValue /DISPLAY/
-syn match CTagsEnumerationValue /fold/
-syn match CTagsField /DISPLAY/
-syn match CTagsField /contains/
-syn match CTagsField /display/
-syn match CTagsField /extend/
-syn match CTagsMethod /containedIn/
-syn match CTagsMethod /contains/
-syn match CTagsMethod /display/
-syn match CTagsMethod /extend/
+syn match CTagsClass /\<Contains\>/
+syn match CTagsEnumerationValue /\<DISPLAY\>/
+syn match CTagsEnumerationValue /\<fold\>/
+syn match CTagsField /\<DISPLAY\>/
+syn match CTagsField /\<contains\>/
+syn match CTagsField /\<display\>/
+syn match CTagsField /\<extend\>/
+syn match CTagsMethod /\<containedIn\>/
+syn match CTagsMethod /\<contains\>/
+syn match CTagsMethod /\<display\>/
+syn match CTagsMethod /\<extend\>/
 
 syn cluster javaTop add=CTagsEnumeratorName,CTagsEnumerationValue,CTagsMethod,CTagsClass,CTagsField,CTagsInterface,CTagsPackage

File plugin/TagHighlight/standard_libraries/qt4/qt4.taghl

View file
 syn keyword CTagsNamespace QtHelpInternal NativeEvents Ecma std fulltextsearch Int QDeclarativePrivate QSharedMemoryPrivate X86Registers QDBus MMF QDeclarativeJS NameSchpace Paths AAA StringWrapperCFAllocator Space QUnicodeTables TestConfiguration Factory Middle2 QtMultimediaInternal Middle1 WebCore MediaFeatureNames Fooish MyNS QDBusUtil A1 internal ns A QKde QDeclarativeStringConverters WTFNoncopyable NamespaceWithConstructibleClass Y XMLNames CommonNamespaces QCss XMLNSNames Rpp ObjectTree SymbianAudio
 syn keyword CTagsNamespace Yarr Private Maemo jstreams Examples QDBusPendingReplyTypes ARMRegisters Native
 
-syn match CTagsEnumerationValue /CONTAINS/
-syn match CTagsEnumerationValue /Contains/
-syn match CTagsEnumerationValue /EXTEND/
-syn match CTagsEnumerationValue /Transparent/
-syn match CTagsEnumerationValue /contains/
-syn match CTagsEnumerationValue /transparent/
-syn match CTagsEnumeratorName /Contains/
-syn match CTagsEnumeratorName /Display/
-syn match CTagsFunction /contains/
-syn match CTagsFunction /display/
-syn match CTagsFunction /extend/
-syn match CTagsFunction /transparent/
-syn match CTagsMember /contains/
-syn match CTagsMember /display/
-syn match CTagsMember /transparent/
-syn match CTagsType /Display/
+syn match CTagsEnumerationValue /\<CONTAINS\>/
+syn match CTagsEnumerationValue /\<Contains\>/
+syn match CTagsEnumerationValue /\<EXTEND\>/
+syn match CTagsEnumerationValue /\<Transparent\>/
+syn match CTagsEnumerationValue /\<contains\>/
+syn match CTagsEnumerationValue /\<transparent\>/
+syn match CTagsEnumeratorName /\<Contains\>/
+syn match CTagsEnumeratorName /\<Display\>/
+syn match CTagsFunction /\<contains\>/
+syn match CTagsFunction /\<display\>/
+syn match CTagsFunction /\<extend\>/
+syn match CTagsFunction /\<transparent\>/
+syn match CTagsMember /\<contains\>/
+syn match CTagsMember /\<display\>/
+syn match CTagsMember /\<transparent\>/
+syn match CTagsType /\<Display\>/

File plugin/TagHighlight/standard_libraries/wxpython/wxpython.taghl

View file
 syn keyword CTagsClass RichTextObjectList CalendarCtrlBase ShadowPopupWindow MouseEvent CustomPanel GeneratorI NativeStyle UltimateListItemData ProjectFileDropTarget NumberUpdatedEvent FileDirPickerHandler GridCellCoords EdBaseBook TwoButtonEvent MyCustomRenderer StaticBox HtmlSelection FlatMenuBar _EMPTYSTRING PHPService GridCellNumberRenderer GridCellEnumEditor ActionScript3Lexer ParamButtons PGPaintData JavascriptPhpLexer MySTC EditorCanvasUpdateShapeBoundariesCommand XmlDjangoLexer ListCtrl ControlBar
 syn keyword CTagsClass EdLogViewer ExtensionRegister LanguageInfo PenDialog ReadError
 
-syn match CTagsClass /Display/
-syn match CTagsGlobalVariable /FOLD/
-syn match CTagsGlobalVariable /NextGroup/
-syn match CTagsGlobalVariable /TRANSPARENT/
-syn match CTagsMember /Contains/
-syn match CTagsMember /Display/
-syn match CTagsMember /Transparent/
-syn match CTagsMember /display/
+syn match CTagsClass /\<Display\>/
+syn match CTagsGlobalVariable /\<FOLD\>/
+syn match CTagsGlobalVariable /\<NextGroup\>/
+syn match CTagsGlobalVariable /\<TRANSPARENT\>/
+syn match CTagsMember /\<Contains\>/
+syn match CTagsMember /\<Display\>/
+syn match CTagsMember /\<Transparent\>/
+syn match CTagsMember /\<display\>/

File plugin/TagHighlight/standard_libraries/wxwidgets/wxwidgets.taghl

View file
 syn keyword CTagsClass wxHtmlHelpHtmlWindow wxAcceleratorRefData wxSortedArray_SortFunction wxOSXCarbonPrintData
 syn keyword CTagsNamespace CmdLineOption std wxMSWMessageDialog wxdebug wxMSWButton wxPrivate Scintilla Bench wxMSWKeyboard wxMSWImpl wxGTKImpl UserNameSpace wxGTKPrivate wxMSWDateControls
 
-syn match CTagsFunction /Contains/
-syn match CTagsFunction /Display/
-syn match CTagsFunction /Extend/
-syn match CTagsFunction /Fold/
-syn match CTagsFunction /contains/
-syn match CTagsFunction /extend/
-syn match CTagsMember /display/
-syn match CTagsMember /transparent/
+syn match CTagsFunction /\<Contains\>/
+syn match CTagsFunction /\<Display\>/
+syn match CTagsFunction /\<Extend\>/
+syn match CTagsFunction /\<Fold\>/
+syn match CTagsFunction /\<contains\>/
+syn match CTagsFunction /\<extend\>/
+syn match CTagsMember /\<display\>/
+syn match CTagsMember /\<transparent\>/
 
 if exists('b:hlrainbow') && !exists('g:nohlrainbow')
 	syn cluster cBracketGroup add=CTagsStructure,CTagsMember,CTagsUnion,CTagsGlobalVariable,CTagsConstant,CTagsEnumeratorName,CTagsEnumerationValue,CTagsFunction,CTagsType,CTagsDefinedName,CTagsClass,CTagsNamespace