diff options
author | 2020-08-09 10:09:47 -0400 | |
---|---|---|
committer | 2020-08-09 10:09:47 -0400 | |
commit | dd40438201488113a5f2b5899caf31ffe1258a92 (patch) | |
tree | 2cb14832736cb172cc126f84fd4d3a37690e0b69 /modules | |
parent | 1ba7e5fc6ed6c971630a4faf52ea39649a8f0818 (diff) |
Save the current working directory to session files.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/textadept/session.lua | 6 |
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 |