aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/session.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 61bd2376..ac8850be 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -57,6 +57,9 @@ function M.load(filename)
local session = f()
local not_found = {}
+ -- Unserialize cwd.
+ if session.cwd then lfs.chdir(session.cwd) end
+
-- Unserialize buffers.
for _, buf in ipairs(session.buffers) do
if lfs.attributes(buf.filename) then
@@ -158,6 +161,9 @@ function M.save(filename)
-- Serialize user data.
events.emit(events.SESSION_SAVE, session)
+ -- Serialize cwd.
+ session.cwd = lfs.currentdir()
+
-- Serialize buffers.
session.buffers = {}
for _, buffer in ipairs(_BUFFERS) do