diff options
author | 2009-01-25 10:41:46 -0500 | |
---|---|---|
committer | 2009-01-25 10:41:46 -0500 | |
commit | 6f885b3036d4db50104877945af7c9c89c4d922d (patch) | |
tree | 7fe1707bfdf9dca48b49b87ecdefe2df7fea16cf /core/file_io.lua | |
parent | 9158eefecdb6750f97bdc153061234c36df49268 (diff) | |
download | textadept-6f885b3036d4db50104877945af7c9c89c4d922d.tar.gz textadept-6f885b3036d4db50104877945af7c9c89c4d922d.zip |
textadept.io.reload() scrolls the view back to how it was; core/file_io.lua
Diffstat (limited to 'core/file_io.lua')
-rw-r--r-- | core/file_io.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/file_io.lua b/core/file_io.lua index 5e76e886..d9f1c25e 100644 --- a/core/file_io.lua +++ b/core/file_io.lua @@ -68,8 +68,10 @@ function reload(buffer) local f, err = io.open(buffer.filename) if f then local pos = buffer.current_pos + local first_visible_line = buffer.first_visible_line buffer:set_text(f:read('*all')) - buffer.current_pos = pos + buffer:line_scroll(0, first_visible_line) + buffer:goto_pos(pos) buffer:set_save_point() f:close() end |