Commits

abudden committed 8f2ce47

Added (currently undocumented) support for 'all' suffix for reading everything.

This is mainly useful for commit messages - read every types file it can find.

  • Participants
  • Parent commits 9105a3e

Comments (0)

Files changed (3)

File autoload/TagHighlight/Find.vim

 		let explicit_location = TagHighlight#Option#GetOption('TagFileDirectory')
 		let search_wildcards = TagHighlight#Option#GetOption('TagFileSearchWildcards')
 	elseif a:which == 'TYPES'
+		if tolower(a:suffix) == 'all'
+			let search_suffix = '*'
+		else
+			let search_suffix = a:suffix
+		endif
 		let filename = TagHighlight#Option#GetOption('TypesFilePrefix') . '_' .
-					\ a:suffix . "." .
+					\ search_suffix . "." .
 					\ TagHighlight#Option#GetOption('TypesFileExtension')
 		let search_priority = TagHighlight#Option#GetOption('TypesFileDirModePriority')
 		let explicit_location = TagHighlight#Option#GetOption('TypesFileDirectory')
 						if filereadable(entry)
 							let result['FullPath'] = entry
 							let result['Exists'] = 1
+							let result['AllEntries'] = expansion
 							let wildcard_match = 1
 							break
 						endif

File autoload/TagHighlight/Libraries.vim

 	for library in values(g:TagHighlightPrivate['Libraries'])
 		call TagHLDebug("Checking " . library['LibraryName'], "Information")
 		let load = 0
-		if index(library['TypesSuffixes'], a:suffix) != -1
+		if index(library['TypesSuffixes'], a:suffix) != -1 || tolower(a:suffix) == 'all'
 			" Suffix is in the list of acceptable ones
 			if index(forced_standard_libraries, library['LibraryName']) != -1
 				call TagHLDebug("Library(".library['LibraryName']."): Forced", "Information")

File autoload/TagHighlight/ReadTypes.vim

 
 function! s:ReadTypesImplementation(type, lookup, reference, check_function)
 	let result = 0
+	let user_overrides = TagHighlight#Option#GetOption(a:type . 'LanguageOverrides')
 	if TagHighlight#Debug#DebugLevelIncludes('Information')
-		call TagHLDebug("Reading types with " . a:lookup . " at " . strftime("%Y%m%d-%H%M%S"), "Information")
+		call TagHLDebug("Reading types with " . a:lookup . " with ref '" . a:reference . "' at " . strftime("%Y%m%d-%H%M%S"), "Information")
+		call TagHLDebug("User overrides: " . string(user_overrides), "Information")
 	endif
-	let user_overrides = TagHighlight#Option#GetOption(a:type . 'LanguageOverrides')
 	for dictionary in [user_overrides, g:TagHighlightPrivate[a:lookup]]
 		for key in keys(dictionary)
 			if eval(a:check_function . '(a:reference, key)') == 1
 		exe "colorscheme" g:colors_name
 	endif
 
+	if has_key(b:TagHighlightPrivate, 'NormalisedPath')
+		let b:TagHighlightPrivate['ReadTypesCompleted'] = 1
+	endif
+
 	" Restore the view
 	call winrestview(savedView)
 	call TagHLDebug("ReadTypes complete", "Information")
 	let results = []
 	let search_result = TagHighlight#Find#LocateFile('TYPES', a:suffix)
 	if search_result['Found'] == 1 && search_result['Exists'] == 1
-		let results += [search_result['FullPath']]
+		if tolower(a:suffix) == "all"
+			let results += search_result['AllEntries']
+		else
+			let results += [search_result['FullPath']]
+		endif
 	endif
 	return results
 endfunction