I have this problem too… When I remove Lua ( move it to ignored ) even when all .lua files are opened using GMod Lua - when adding Lua to ignored - all open .lua files get reverted to Plain Text despite another highlighter being present ( and which was used on the open files )…
Even trying to use set all open windows with this file extension to use GMod Lua - I have to manually change EVERY file ( I use AutoHotkey to do it )
;;
;; AutoHotkey Script Example to show off XCodeMapper - Josh 'Acecool' Moser
;;
;; Note: ! == ALT, ^ == Control, + == SHIFT, # == WIN
;;
;;
;; ------------------------------------------------------------------------------------------------------------------------------------------------------------------
;;
;;
;; F13
;;
*~F13::
if ( sublime_text.IsActive( ) )
{
;; notify.Chime( "", false )
Send ^!{F1}
nircmd.TextToSpeech( "J-S-O-N-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F14
;;
*~F14::
if ( sublime_text.IsActive( ) )
{
;; notify.Chime( "", false )
Send ^!{F2}
nircmd.TextToSpeech( "XML-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F15
;;
*~F15::
if ( sublime_text.IsActive( ) )
{
;; notify.Chime( "", false )
Send ^!{F3}
nircmd.TextToSpeech( "HTML-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F16
;;
*~F16::
if ( sublime_text.IsActive( ) )
{
;; notify.Chime( "", false )
Send ^!{F4}
nircmd.TextToSpeech( "PHP-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; ------------------------------------------------------------------------------------------------------------------------------------------------------------------
;;
;;
;; F17
;;
*~F17::
if ( sublime_text.IsActive( ) )
{
;; notify.ChimeOff( "", false )
Send ^!+{F1}
nircmd.TextToSpeech( "Garrys-Mod-Lua-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F18
;;
*~F18::
if ( sublime_text.IsActive( ) )
{
;; notify.ChimeOff( "", false )
Send ^!+{F2}
nircmd.TextToSpeech( "Python-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F19
;;
*~F19::
if ( sublime_text.IsActive( ) )
{
;; notify.ChimeOff( "", false )
Send ^!+{F3}
nircmd.TextToSpeech( "Java-Script-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; F20
;;
*~F20::
if ( sublime_text.IsActive( ) )
{
;; notify.ChimeOff( "", false )
Send ^!+{F4}
nircmd.TextToSpeech( "AutoHot-key-Syntax-HighLighting" )
notify.Chime( "", false )
}
return
;;
;; ------------------------------------------------------------------------------------------------------------------------------------------------------------------
;;
;;
;; F21 to Ctrl + C - ie COPY
;;
*~F21::
;; sublime_text:IsActive( )
if ( sublime_text.IsActive( ) )
{
notify.Chime( "", false )
Send, ^c
}
return
;;
;; F22 to Ctrl + V - ie PASTE
;;
*~F22::
if ( sublime_text.IsActive( ) )
{
notify.Chime( "", false )
Send, ^v
}
return
;;
;; F23 to Alt + C - ie OPEN CONSOLE
;;
*~F23::
if ( sublime_text.IsActive( ) )
{
notify.Chime( "", false )
Send, !c
}
return
;;
;; F24 to Restart / Start Sublime Test 3
;;
*~F24::
;; Close and Launch, or Relaunch the App...
sublime_text.RestartApp( )
return
Obviously not all will work - but I’d highly suggest adding a hotkey ( and if your keyboard supports it some shortcut keys rebound using AutoHotkey or software for your keyboard ) which is easily usable…
It seems to be an issue with Sublime Text because I don’t have any addons which alter which syntax is used ( only more languages installed plus some other addons which are unrelated )…
There are scripts / plugins you can install which will process every single view and ensure the proper syntax file is set based on the file extension - that is also a viable and useful option…Luckily the issue doesn’t appear frequently for me but it appears enough for me to add functionality to my XCodeMapper mod to force the active view to run the same syntax highlighter as is being used in the mapping panel if configuration is enabled…
I’d suggest submitting an issue report on the Sublime Text Issues Github because this happens even without addons installed.