aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/session.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2013-04-25 09:34:01 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2013-04-25 09:34:01 -0400
commit02a014c3d865ce5a426d2fd0f69c801b7f5a0fc0 (patch)
tree5f51c20606a3cd81312237f305f3fe8845598e26 /modules/textadept/session.lua
parentcb57c684e1fb68ac8b4fc9c26a33bce603265eba (diff)
downloadtextadept-02a014c3d865ce5a426d2fd0f69c801b7f5a0fc0.tar.gz
textadept-02a014c3d865ce5a426d2fd0f69c801b7f5a0fc0.zip
Code and documentation cleanup.
Diffstat (limited to 'modules/textadept/session.lua')
-rw-r--r--modules/textadept/session.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 98a5c56c..5ac2f50f 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -12,6 +12,8 @@ local M = {}
-- [`_G.CURSES`]: _G.html#CURSES
-- @field SAVE_ON_QUIT (bool)
-- Save the session when quitting.
+-- The session file saved is always `DEFAULT_SESSION`, even if a different
+-- session was loaded with [`load()`](#load).
-- The default value is `true`, but is disabled when passing the command line
-- switch `-n` or `--nosession` to Textadept.
-- @field MAX_RECENT_FILES (number)
@@ -100,7 +102,7 @@ function M.load(filename)
break
end
end
- if not exists then recent[#recent + 1] = filename end
+ if not exists then recent[#recent + 1] = filename end
end
end
f:close()
@@ -203,10 +205,9 @@ end, 1)
local function no_session() M.SAVE_ON_QUIT = false end
args.register('-n', '--nosession', 0, no_session, 'No session functionality')
-- Loads the given session on startup.
-local function load_session(name)
+args.register('-s', '--session', 1, function(name)
if lfs.attributes(name) then M.load(name) return end
M.load(_USERHOME..'/'..name)
-end
-args.register('-s', '--session', 1, load_session, 'Load session')
+end, 'Load session')
return M