Beege Posted February 16, 2014 Posted February 16, 2014 (edited) If you have every taken the time to set up a nice dark theme for your scite editor, you probably noticed shortly after a small yet really annoying flaw. For what ever reason, scite is not set up to let you change the caret fore color and caret line color per language. This really sucks if say you want to edit a properties file or any of the many other languages that Scite currently is setup to support. Pretty much all the other languages are set as light theme so unless you change the theme for those file types, you end up with something like below where the line color and caret are still using the dark theme colors. Line 3 in the pic: To get around this I came up with the following that seems to work pretty well. Add the following properties to SciteUser.properties file (Options -> Open User Options File). Update colors to your own needs. You can addionally add any other propertys that dont have a lexer language option in the same fashion. # The default values (light themes) will be used for any lexer other than au3 caret.default.fore=#000000 caret.default.line.back=#FFFED8 selection.default.fore=#006000 selection.default.back=#F0A0A8 caret.au3.fore=#FFFFFF caret.au3.line.back=#111111 selection.au3.fore=#C2FFAE selection.au3.back=#f9f9f9 Add the following function to PersonalTools.Lua file. As jos pointed out, the OnStartup covers the filetab switches as well as the startup so only need the one function: function PersonalTools:OnStartup() -- the "and" + "or" keywords are ternary operators here local sLex = self:IsLexer(SCLEX_AU3) and 'au3' or 'default' props['caret.line.back'] = props['caret.' .. sLex .. '.line.back'] props['caret.fore'] = props['caret.' .. sLex .. '.fore'] props['selection.fore'] = props['selection.' .. sLex .. '.fore'] props['selection.back'] = props['selection.' .. sLex .. '.back'] end Last restart SciTE and that should be it. Let me know if you have any issues. Thanks Edited October 1, 2019 by Beege Rewrote and added selection.fore / back Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
Developers Jos Posted February 16, 2014 Developers Posted February 16, 2014 (edited) A couple of suggestions: The current setup in the Full SciTE installer has an PersonalTools.lua file in the users directory which can be used for this type of scripts.This avoids having to update the SciteStartup.lua after each installation of the full installer. You could also retrieve the current lexername in stead of using the File Extension as some Lexers use multiple different file extensions. Using OnStartUp will run the function when changing FileTabs in SciTE in case you have multiple files open. Something like this: function PersonalTools:OnStartup() if props['caret.' .. editor.LexerLanguage .. '.line.back'] ~= '' then props['caret.line.back'] = props['caret.' .. editor.LexerLanguage .. '.line.back'] else props['caret.line.back'] = props['caret.default.line.back'] end if props['caret.' .. editor.LexerLanguage .. '.fore'] ~= '' then props['caret.fore'] = props['caret.' .. editor.LexerLanguage .. '.fore'] else props['caret.fore'] = props['caret.default.fore'] end end Cheers Jos Edited February 16, 2014 by Jos jaberwacky 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Guest Posted February 16, 2014 Posted February 16, 2014 thanks. my way is to open Magnifier and then Ctrl+Alt+I or use Magnifier in this >way
Beege Posted February 16, 2014 Author Posted February 16, 2014 (edited) A couple of suggestions:The current setup in the Full SciTE installer has an PersonalTools.lua file in the users directory which can be used for this type of scripts.This avoids having to update the SciteStartup.lua after each installation of the full installer.You could also retrieve the current lexername in stead of using the File Extension as some Lexers use multiple different file extensions.Using OnStartUp will run the function when changing FileTabs in SciTE in case you have multiple files open. Something like this:function PersonalTools:OnStartup() if props['caret.' .. editor.LexerLanguage .. '.line.back'] ~= '' then props['caret.line.back'] = props['caret.' .. editor.LexerLanguage .. '.line.back'] else props['caret.line.back'] = props['caret.default.line.back'] end if props['caret.' .. editor.LexerLanguage .. '.fore'] ~= '' then props['caret.fore'] = props['caret.' .. editor.LexerLanguage .. '.fore'] else props['caret.fore'] = props['caret.default.fore'] end endNice! Thanks for the suggestions. Ill defiantly revise to utilize the personal tools. For using the editor.lexerlanguage, I actually started out doing it that way but then changed to extention only for simplicity until I can get a table made of what extensions use what lexername, and then tie those into some properties in the user.properties with some notes. Html lexer (aka hypertext) for example includes a ton while xml has its own little catagory and I could easily see myself guessing they were in the same group if not looking at the properties file. Thanks again for the Tips Edited February 16, 2014 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
ratus69 Posted January 8, 2015 Posted January 8, 2015 hello, I can't manage to make it work but there's an easier solution found here '?do=embed' frameborder='0' data-embedContent>> thanks anyway
Beege Posted September 30, 2019 Author Posted September 30, 2019 (edited) This is working again. editor.LexerLanguage stopped working somewhere along the way and has been updated to just check if this is au3 or not. edit: actually this works fine. I dont know what I had screwed up.. function PersonalTools:OnStartup() print(editor.LexerLanguage) end Edited October 1, 2019 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now