aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2008-09-24 21:05:49 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2008-09-24 21:05:49 -0400
commit32503fed4cf3066b07384562f10b640026d634a8 (patch)
treef69a9df8364932e9db57327bbf29ed2ade5efbd4 /core
parent4554c2ca782ea2667570d81899142af8a642aa3b (diff)
downloadtextadept-32503fed4cf3066b07384562f10b640026d634a8.tar.gz
textadept-32503fed4cf3066b07384562f10b640026d634a8.zip
Added textadept.size property.
Diffstat (limited to 'core')
-rw-r--r--core/file_io.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua
index cc12fd28..6664d400 100644
--- a/core/file_io.lua
+++ b/core/file_io.lua
@@ -212,7 +212,10 @@ function load_session(filename, only_pm)
current_view = tonumber(view_idx) or 1
end
end
- if line:match('^pm:') then
+ if line:match('^size:') then
+ local width, height = line:match('^size: (%d+) (%d+)$')
+ if width and height then textadept.size = { width, height } end
+ elseif line:match('^pm:') then
local width, text = line:match('^pm: (%d+) (.+)$')
textadept.pm.width = width or 0
textadept.pm.entry_text = text or ''
@@ -286,6 +289,8 @@ function save_session(filename)
end
session = session..("current_view: %d\n"):format(current_view)
-- Write out other things.
+ local size = textadept.size
+ session = session..("size: %d %d\n"):format( size[1], size[2] )
local pm = textadept.pm
session = session..("pm: %d %s\n"):format(pm.width, pm.entry_text)
-- Write the session.