1. abudden
  2. TagHighlight

Commits

abudden  committed db3929c

Added ReloadColourScheme option to auto-reload the colour scheme after reading types (work-around for unresolved bug).

  • Participants
  • Parent commits 9b17982
  • Branches default

Comments (0)

Files changed (3)

File autoload/TagHighlight/ReadTypes.vim

View file
  • Ignore whitespace
 		exe 'call' postread_hook . '(fullname, a:suffix)'
 	endfor
 
+	let reload_colours = TagHighlight#Option#GetOption('ReloadColourScheme')
+	if reload_colours
+		exe "colorscheme" g:colors_name
+	endif
+
 	" Restore the view
 	call winrestview(savedView)
 	call TagHLDebug("ReadTypes complete", "Information")

File doc/TagHighlight.txt

View file
  • Ignore whitespace
 		SyntaxLanguageOverrides          Link:|TagHL-SyntaxLanguageOverrides|
 			Force a particular Vim syntax to match a chosen language.
 
+		ReloadColourScheme               Link:|TagHL-ReloadColourScheme|
+			Automatically reload the colour scheme after reading types.
+
 	What to include in the generated types file
 
 		IncludeLocals                    Link:|TagHL-IncludeLocals|
 		Option Type: Boolean
 		Default: True (recurse)
 
+	ReloadColourScheme                   *TagHL-ReloadColourScheme*
+		If this option is set to True or 1, the colour scheme will be reloaded
+		automatically after the types file has been read.  This is done by
+		executing:
+>
+			:exe "colorscheme" g:colors_name
+<
+		so only works if your colour scheme defines g:colors_name (most do).
+		It is provided as a work-around for a bug that is seen on some
+		versions of gvim whereby the colours aren't shown properly on startup.
+		I haven't got to the bottom of this bug, so am providing this
+		work-around as a fix in the meantime.
+
 	SkipPatterns                         *TagHL-SkipPatterns*
 		Any (python) regular expressions listed in this option will be matched
 		against any keyword names found in the tags file.  If they match, the
 							 languages when generating types files.  Initially
 							 the reserved keywords have been recorded for C++,
 							 Python, Java and C#.  Thanks to Alexey Radkov and
-							 Alan Warren for the suggestions.
+							 Alan Warren for the suggestions.  Added a
+							 work-around for an issue with the colour scheme
+							 information not being shown on some gvim
+							 implementations on startup (reported by Walker
+							 Inman).
 
 2.1.5: 20th February 2012  : Added support for Scala (thanks to Lee Gauthier).
 

File plugin/TagHighlight/data/options.txt

View file
  • Ignore whitespace
 	Default:False
 	Help:Only generate tags/types if a types file already exists.
 
+reload_colour_scheme:
+	VimOptionMap:ReloadColourScheme
+	Type:bool
+	Default:False
+	Help:Reload the colour scheme after reading types file (in case colours don't work properly)
+
 ##########################
 # Python script options: #
 ##########################