diff options
author | 2008-09-24 21:05:49 -0400 | |
---|---|---|
committer | 2008-09-24 21:05:49 -0400 | |
commit | 32503fed4cf3066b07384562f10b640026d634a8 (patch) | |
tree | f69a9df8364932e9db57327bbf29ed2ade5efbd4 /core | |
parent | 4554c2ca782ea2667570d81899142af8a642aa3b (diff) | |
download | textadept-32503fed4cf3066b07384562f10b640026d634a8.tar.gz textadept-32503fed4cf3066b07384562f10b640026d634a8.zip |
Added textadept.size property.
Diffstat (limited to 'core')
-rw-r--r-- | core/file_io.lua | 7 |
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. |