aboutsummaryrefslogtreecommitdiff
path: root/core/init.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2009-01-23 22:26:22 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2009-01-23 22:26:22 -0500
commit60544f1550999df6a55dbdfc2cbd7542fecb3314 (patch)
treedc80542bcde7841dc7a14a4c52ab1fd6533b576f /core/init.lua
parent8e7cd820df1e7b8f0c392d446592590c9a1d010f (diff)
downloadtextadept-60544f1550999df6a55dbdfc2cbd7542fecb3314.tar.gz
textadept-60544f1550999df6a55dbdfc2cbd7542fecb3314.zip
Look for ~/.ta_theme for setting _THEME; core/init.lua
Diffstat (limited to 'core/init.lua')
-rw-r--r--core/init.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/init.lua b/core/init.lua
index da95f94c..3767a31f 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -8,7 +8,17 @@ if not WIN32 then
else
package.cpath = _HOME..'/core/?.dll;'..package.cpath
end
+
_THEME = ''
+local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE')
+if user_dir then
+ local f = io.open(user_dir..'/.ta_theme')
+ if f then
+ theme = f:read('*line'):match('[^\r\n]+')
+ f:close()
+ if theme and #theme > 0 then _THEME = theme end
+ end
+end
require 'iface'
require 'locale'