diff options
author | 2020-05-25 21:16:01 -0400 | |
---|---|---|
committer | 2020-05-25 21:16:01 -0400 | |
commit | f2374c4aba53fa462dc88d4104e10d8cb97e61ba (patch) | |
tree | 5e5a9d26a5ad8915c0e12187dd059b1109fcf22d /modules/textadept/session.lua | |
parent | effc636745e8d9c680c3acf42e8e25eed10cd903 (diff) | |
download | textadept-f2374c4aba53fa462dc88d4104e10d8cb97e61ba.tar.gz textadept-f2374c4aba53fa462dc88d4104e10d8cb97e61ba.zip |
Allow views to be used as buffers and update API.
This allows for a superficial separation of buffer- and view-specific Scintilla
functionality. buffers and views can now be used interchangeably for the most
part, and the APIs are guidance, not hard requirements. User scripts do not
require any modification and will continue to function normally.
Diffstat (limited to 'modules/textadept/session.lua')
-rw-r--r-- | modules/textadept/session.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index b446ca54..43bb9e08 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -62,7 +62,7 @@ function M.load(filename) if lfs.attributes(buf.filename) then io.open_file(buf.filename) buffer:set_sel(buf.anchor, buf.current_pos) - buffer:line_scroll(0, buf.top_line - buffer.first_visible_line) + view:line_scroll(0, buf.top_line - view.first_visible_line) for _, line in ipairs(buf.bookmarks) do buffer:marker_add(line, textadept.bookmarks.MARK_BOOKMARK) end @@ -165,7 +165,7 @@ function M.save(filename) 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 buffer.first_visible_line or buffer._top_line, + top_line = current and view.first_visible_line or buffer._top_line, } local bookmarks = {} local BOOKMARK_BIT = 1 << textadept.bookmarks.MARK_BOOKMARK - 1 |