aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-01-04 16:45:46 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2010-01-04 16:45:46 -0500
commit5248783475981cd9eb9d0ba0109e353ca7c5b1f6 (patch)
tree3fe53459910c38f9f7110e857c942773426e3cbe /modules/textadept
parent0896150b65e97f101b109e92feb7197d1c99848d (diff)
downloadtextadept-5248783475981cd9eb9d0ba0109e353ca7c5b1f6.tar.gz
textadept-5248783475981cd9eb9d0ba0109e353ca7c5b1f6.zip
Added command line switch for not loading/saving sessions.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/session.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 3e7b48aa..61a5a301 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -11,9 +11,13 @@ module('_m.textadept.session', package.seeall)
-- ## Settings
--
-- * `DEFAULT_SESSION`: The path to the default session file.
+-- * `SAVE_ON_QUIT`: Save the session when quitting. Defaults to true and can be
+-- disabled by passing the command line switch '-ns' or '--no-session' to
+-- Textadept.
-- settings
DEFAULT_SESSION = _USERHOME..'/session'
+SAVE_ON_QUIT = true
-- end settings
---
@@ -161,4 +165,5 @@ function save(filename)
end
end
-textadept.events.add_handler('quit', save, 1)
+textadept.events.add_handler('quit',
+ function() if SAVE_ON_QUIT then save() end end, 1)