Commits

abudden committed 506ef8f

TagRelative internal option added to make tags work better with projects with the tag files stored remotely.

  • Participants
  • Parent commits 3418ba6

Comments (0)

Files changed (4)

File autoload/TagHighlight/Generation.vim

 		endif
 	endif
 
+
 	let RunOptions = TagHighlight#Option#CopyOptions()
+	let RunOptions['TagRelative'] = &tagrelative
 	if TagHighlight#Option#GetOption('EnableCscope')
 		if TagHighlight#Option#GetOption('CscopeOnlyIfPresent')
 			if ! b:TagHighlightPrivate['CscopeFileInfo']['Exists']

File doc/TagHighlight.txt

 		TypesFileLocation                Link:|TagHL-TypesFileLocation|
 			Internal use only.
 
+		TagRelative                      Link:|TagHL-TagRelative|
+			Internal use only.
+
 2.4.4 Option Details                     *TagHighlight-option-details*      {{{3
 
 	CscopeExecutable                     *TagHL-CscopeExecutable*
 		Option Type: String
 		Default: "tags"
 
+	TagRelative                          *TagHL-TagRelative*
+		This option is used to internally to ensure that ctags and Vim both
+		use the same setting for 'tagrelative'.  Only really works with
+		Exuberant Ctags.
+
 	TypesFileDirModePriority             *TagHL-TypesFileDirModePriority*
 		This option is used to determine which directories to look in for a
 		types highlighter file or in which directory to place a types
 	* Improved priority handling: remove duplicates rather than relying on
 	  Vim's priority handling.  This enables non-duplicated function
 	  prototypes (in C code) to be included.
+	* Vim's tagrelative option can cause problems if the tag file isn't in
+	  the current directory and ctags wasn't called with tagrelative set.
+	  The two versions need to be synchronised (thanks to Seth for reporting
+	  this).
 	
 	Other changes:
                             

File plugin/TagHighlight/data/options.txt

 # Python script options: #
 ##########################
 
+TagRelative:
+	CommandLineSwitches:--tagrelative
+	Type:bool
+	Default:False
+	Help:Used to set tagrelative for vim/ctags interaction.
+
 DebugLevel:
 	CommandLineSwitches:--debug
 	Type:string

File plugin/TagHighlight/module/ctags_interface.py

         ctags_languages.append('c++')
     args += ["--languages=" + ",".join(ctags_languages)]
 
+    # Vim assumes that tags are relative to the tag file location,
+    # so make sure they are!
+    if options['TagRelative']:
+        args += ['--tag-relative=yes']
+    else:
+        args += ['--tag-relative=no']
+
     if options['TagFileName']:
         args += ['-f', os.path.join(options['CtagsFileLocation'], options['TagFileName'])]