From c1c18855c92edbc80a438f90cc5686f9ff5e8b1c Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 16 Jul 2020 12:37:04 -0400 Subject: Ensure buffer selection session data is saved. It is possible to have in a non-current view a buffer without saved selection data. --- modules/textadept/session.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') 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 -- cgit v1.2.3