abudden avatar abudden committed f660461

Added CtagsExtraArguments option.

Also clarified use of CtagsArguments to avoid confusion.

Comments (0)

Files changed (3)

doc/TagHighlight.txt

 		CtagsArguments                   Link:|TagHL-CtagsArguments|
 			Specify an explicit list of arguments to pass to ctags.
 
+		CtagsExtraArguments              Link:|TagHL-CtagsExtraArguments|
+			Specify a list of extra arguments to pass to ctags.
+
 	Locations of Files (normal):
 
 		DefaultDirModeSearchWildcards    Link:|TagHL-DirModeSearchWildcards|
 		in touch and let me know why: I might be able to create a new
 		CtagsVariant to do whatever you need.
 
+		Note: this should not be used to add additional arguments to ctags.
+		This explcitly sets ALL of the parameters that are passed to ctags,
+		replacing all the ones that TagHighlight would usually use.  If you
+		just want to add an option to ctags, see |TagHL-CtagsExtraArguments|.
+
 		Option Type: List
 		Default: [] (empty list)
 
 		Option Type: String
 		Default: "ctags"
 
+	CtagsExtraArguments                  *TagHL-CtagsExtraArguments*
+		This can be used to add a list of extra arguments for ctags to the
+		ones normally used by TagHighlight.  This should be used if you want
+		to customise the operation of ctags in some way not supported by
+		TagHighlight.  If you use this option, please let me know: I might be
+		able to add a TagHighlight option specific for your use case.
+
+		Option Type: List
+		Default: [] (empty list)
+
 	CtagsFileLocation                    *TagHL-CtagsFileLocation*
 		Used internally to handle the location of the tag file.  Do not use
 		this option as it will be automatically overwritten.  Instead, see

plugin/TagHighlight/data/options.txt

 	CommandLineSwitches:--add-ctags-argument
 	VimOptionMap:CtagsArguments
 	Type:list
-	Default:[
-	Help:Explicit list of arguments to parse to ctags (for use with non-recognised ctags implementations).
+	Default:[]
+	Help:Explicit list of arguments to pass to ctags (for use with non-recognised ctags implementations).
+
+ctags_extra_arguments:
+	CommandLineSwitches:--add-extra-ctags-argument
+	VimOptionMap:CtagsExtraArguments
+	Type:list
+	Default:[]
+	Help:List of extra arguments to pass to ctags.
 
 ctags_variant:
 	CommandLineSwitches:--ctags-variant

plugin/TagHighlight/module/ctags_interface.py

             else:
                 Debug("Skipping language: " + language, "Information")
 
+    if options['recurse']:
+        args += ['--recurse']
+
+    # If user specified extra arguments are required, add them
+    # immediately before the file list
+    if 'ctags_extra_arguments' in options:
+        args += options['ctags_extra_arguments']
+
     # Must be last as it includes the file list:
     if options['recurse']:
-        args += ['--recurse']
         args += ['.']
     else:
         args += glob.glob(os.path.join(options['source_root'],'*'))
     args = []
     if options['ctags_file']:
         args += ['-f', os.path.join(options['ctags_file_dir'], options['ctags_file'])]
+
+    # If user specified extra arguments are required, add them
+    # immediately before the file list
+    if 'ctags_extra_arguments' in options:
+        args += options['ctags_extra_arguments']
+
     # jsctags isn't very ctags-compatible: if you give it a directory
     # and expect it to recurse, it fails on the first non-javascript
     # file.  Therefore, we have to assume all javascript files have .js
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.