aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/session.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 1986e9d3..dcdee22d 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -91,6 +91,12 @@ function M.load(filename)
if file == recent[i] then exists = true break end
end
if not exists then recent[#recent + 1] = file end
+ elseif line:find('^bookmarks:') then
+ local i, lines = line:match('^bookmarks: (%d+) (.*)$')
+ local buffer = _BUFFERS[tonumber(i)]
+ for line in lines:gmatch('%d+') do
+ buffer:marker_add(tonumber(line), textadept.bookmarks.MARK_BOOKMARK)
+ end
end
end
f:close()
@@ -175,6 +181,16 @@ function M.save(filename)
if i > M.MAX_RECENT_FILES then break end
session[#session + 1] = ("recent: %s"):format(io.recent_files[i])
end
+ for i, buffer in ipairs(_BUFFERS) do
+ local lines = {}
+ local line = buffer:marker_next(0, 2^textadept.bookmarks.MARK_BOOKMARK)
+ while line >= 0 do
+ lines[#lines + 1] = line
+ line = buffer:marker_next(line + 1, 2^textadept.bookmarks.MARK_BOOKMARK)
+ end
+ lines = table.concat(lines, ' ')
+ session[#session + 1] = ("bookmarks: %d %s"):format(i, lines)
+ end
-- Write the session.
local f = io.open(filename, 'wb')
if f then