From a9f6d85ead8c83ce210e5ffb05f84361e029f419 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 12 Jun 2014 21:18:13 -0400 Subject: Lua code cleanup. --- modules/textadept/session.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/textadept/session.lua') diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua index d2e1a921..fd5a595d 100644 --- a/modules/textadept/session.lua +++ b/modules/textadept/session.lua @@ -52,8 +52,8 @@ function M.load(filename) local lfs_attributes = lfs.attributes for line in f:lines() do if line:find('^buffer:') then - local anchor, current_pos, first_visible_line, filename = - line:match('^buffer: (%d+) (%d+) (%d+) (.+)$') + local patt = '^buffer: (%d+) (%d+) (%d+) (.+)$' + local anchor, current_pos, first_visible_line, filename = line:match(patt) if not filename:find('^%[.+%]$') then if lfs_attributes(filename) then io.open_file(filename) @@ -65,9 +65,8 @@ function M.load(filename) events.emit(events.FILE_OPENED, filename) end -- Restore saved buffer selection and view. - local anchor = tonumber(anchor) or 0 - local current_pos = tonumber(current_pos) or 0 - local first_visible_line = tonumber(first_visible_line) or 0 + anchor, current_pos = tonumber(anchor) or 0, tonumber(current_pos) or 0 + first_visible_line = tonumber(first_visible_line) or 0 buffer._anchor, buffer._current_pos = anchor, current_pos buffer._first_visible_line = first_visible_line buffer:line_scroll(0, buffer:visible_from_doc_line(first_visible_line)) -- cgit v1.2.3