aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-07-16 12:37:04 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-07-16 12:37:04 -0400
commitc1c18855c92edbc80a438f90cc5686f9ff5e8b1c (patch)
tree8754d6a29b4393517eeaa75b5c38f0c19904ceac /modules/textadept
parentb92eeb9d10b6f9cacb9a5e0a78e808d687b00a6f (diff)
downloadtextadept-c1c18855c92edbc80a438f90cc5686f9ff5e8b1c.tar.gz
textadept-c1c18855c92edbc80a438f90cc5686f9ff5e8b1c.zip
Ensure buffer selection session data is saved.
It is possible to have in a non-current view a buffer without saved selection data.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/session.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index 43bb9e08..b209b4eb 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -163,9 +163,9 @@ function M.save(filename)
local current = buffer == view.buffer
session.buffers[#session.buffers + 1] = {
filename = buffer.filename or buffer._type,
- anchor = current and buffer.anchor or buffer._anchor,
- current_pos = current and buffer.current_pos or buffer._current_pos,
- top_line = current and view.first_visible_line or buffer._top_line,
+ anchor = current and buffer.anchor or buffer._anchor or 1,
+ current_pos = current and buffer.current_pos or buffer._current_pos or 1,
+ top_line = current and view.first_visible_line or buffer._top_line or 1,
}
local bookmarks = {}
local BOOKMARK_BIT = 1 << textadept.bookmarks.MARK_BOOKMARK - 1