Commits

abudden committed 72554c4

Improvements to directory searching (mainly for cygwin). Addition of option to include timestamp in debug log (vim only at present).

  • Participants
  • Parent commits 9e1a267

Comments (0)

Files changed (4)

File autoload/TagHighlight/Find.vim

 	while new_dir != dir
 		let dir = new_dir
 		let new_dir = fnamemodify(dir, ':h')
+		
+		call TagHLDebug("Trying " . dir, "Information")
 		for wildcard in a:wildcards
-			if len(glob(dir . '/' . wildcard)) > 0
-				call TagHLDebug("Found match: " . dir, "Information")
+			let glob_pattern = dir
+			if glob_pattern[len(glob_pattern)-1] != '/'
+				let glob_pattern .= '/'
+			endif
+			let glob_pattern .= wildcard
+			if len(glob(glob_pattern)) > 0
+				call TagHLDebug("Found match: " . dir . " (" . glob_pattern . ")", "Information")
 				let result['Directory'] = dir
 				let found = 1
 				break

File doc/TagHighlight.txt

 		DebugLevel                       Link:|TagHL-DebugLevel|
 			How much debugging information should be printed.
 
+		DebugFile                        Link:|TagHL-DebugFile|
+			Write debug log to a file.
+
+		DebugPrintTime                   Link:|TagHL-DebugPrintTime|
+			When writing to file, include timestamps.
+
 	Internal Use Only:
 
 		CtagsExeFull                     Link:|TagHL-CtagsExeFull|
 
 		See also |TagHL-TagFileName|.
 
+	DebugFile                            *TagHL-DebugFile*
+		If set to something other than "None" (the default), write debugging
+		messages to a file.
+
+		Option Type: String
+		Default: "None"
+
 	DebugLevel                           *TagHL-DebugLevel*
 		This is a string describing how much debugging information to print.
 		By default, this is set to 'Error': only errors or critical problems
 		Option Type: String
 		Default: "Error"
 
+	DebugPrintTime                       *TagHL-DebugPrintTime*
+		If True or 1, when writing debug information to a file (see the option
+		|TagHL-DebugFile|, prefix each entry with a timestamp.  Only supported
+		for messages generated in Vim, not by the python script.
+
+		Option Type: Boolean
+		Default: False
+
 	DefaultDirModePriority               *TagHL-DefaultDirModePriority*
 		There are several 'DirModePriority' options in addition to this one.
 		These are used to determine where to find or place the project
 ==============================================================================
 7. TagHighlight History                *TagHighlight-history*               {{{1
 
+2.0.13: 4th August 2011    : Improvements to directory searching (mainly for
+                             Cygwin).  Addition of option to include timestamp
+                             in debug log (Vim debug output only at present).
+
 2.0.12: 3rd August 2011    : Added option to limit number of directories to
 							 search up through when looking for configuration
 							 or existing tags file.

File plugin/TagHighlight.vim

 	if level_index <= TagHighlight#Debug#GetDebugLevel()
 		try
 			let debug_file = TagHighlight#Option#GetOption('DebugFile')
+			let print_time = TagHighlight#Option#GetOption('DebugPrintTime')
 		catch /Unrecognised option/
 			" Probably haven't loaded the option definitions
 			" yet, so assume no debug log file
 			echomsg a:str
 		else
 			exe 'redir >>' debug_file
-			silent echo a:str
+			if print_time && exists("*strftime")
+				silent echo strftime("%H.%M.%S") . ": " . a:str
+			else
+				silent echo a:str
+			endif
 			redir END
 		endif
 	endif

File plugin/TagHighlight/data/options.txt

 	Default:None
 	Help:Debug log file into which messages should be stored
 
+debug_print_time:
+	CommandLineSwitches:--print-time-with-debug
+	VimOptionMap:DebugPrintTime
+	Type:bool
+	Default:False
+	Help:Print the time with each debug message in the log
+
 source_root:
 	CommandLineSwitches:-d,--source-root
 	VimOptionMap:SourceDir