abudden avatar abudden committed 3546e77

Fixed bug with highlight priority for non-specified types (fixes #299).

Comments (0)

Files changed (2)

doc/TagHighlight.txt

 ==============================================================================
 6. TagHighlight History                *TagHighlight-history*               {{{1
 
-2.1.2:  xxxx xxxxxx 2011   : Allow overriding the file-language relationship
+2.1.2:  30th August 2011   : Allow overriding the file-language relationship
                              without having to edit the language definitions.
                              Added support for Matlab (if your version of
                              ctags supports it).  Added support for .hh
-                             extension for C/C++ headers.
+                             extension for C/C++ headers.  Fixed bug with
+                             highlight priority for non-specified types.
 
 2.1.1:  23rd August 2011   : Addition of LanguageDetectionMethods option to
                              allow loading of types when FileType or Syntax

plugin/TagHighlight/module/generation.py

     # is last.
     priority.reverse()
 
-    fullTypeList = sorted(tags.keys())
+    fullTypeList = list(reversed(sorted(tags.keys())))
     # Reorder type list according to priority sort order
     allTypes = []
     for thisType in priority:
             allTypes.append(thisType)
             fullTypeList.remove(thisType)
     # Add the ones not specified in priority
-    allTypes += fullTypeList
+    allTypes = fullTypeList + allTypes
+
+    Debug("Type priority list: " + repr(allTypes), "Information")
 
     patternREs = []
     for pattern in options['skip_patterns']:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.