diff options
author | 2009-01-25 22:51:51 -0500 | |
---|---|---|
committer | 2009-01-25 22:51:51 -0500 | |
commit | f684f0c71d4090b5d03b9b0b27c6ddda92eda921 (patch) | |
tree | a5455084bda3532be3070d21d3101edfd347e036 /init.lua | |
parent | efc086abed9be5cde8d8540d6b8640af975ddf3d (diff) | |
download | textadept-f684f0c71d4090b5d03b9b0b27c6ddda92eda921.tar.gz textadept-f684f0c71d4090b5d03b9b0b27c6ddda92eda921.zip |
Look for ~/.ta_modules to load modules, falling back on init.lua's default ones.
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -5,6 +5,15 @@ local textadept = _G.textadept local mpath = _HOME..'/modules/?.lua;'.._HOME..'/modules/?/init.lua' package.path = mpath..';'..package.path +local loaded_user_modules = false +local user_dir = os.getenv(not WIN32 and 'HOME' or 'USERPROFILE') +if user_dir then + local ret, errmsg = pcall(dofile, user_dir..'/.ta_modules') + if not ret and not errmsg:find('No such file') then error(errmsg) end + loaded_user_modules = ret +end + +if not loaded_user_modules then -- Core extension modules to load on startup. require 'ext/keys' -- provides key command support require 'ext/find' -- provides functionality for find/replace @@ -30,6 +39,7 @@ require 'ext/menu' -- provides the menu bar --require 'ext/key_commands_std' -- key commands for Windows and Linux --require 'ext/key_commands_mac' -- key commands for Mac OSX require 'ext/key_commands' -- key commands for Mitchell (Nano-Emacs hybrid) +end if not RESETTING then -- for Windows, create arg table from single command line string (arg[0]) |