aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/session.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/session.lua')
-rw-r--r--modules/textadept/session.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/textadept/session.lua b/modules/textadept/session.lua
index ce347d24..0ddfa2f9 100644
--- a/modules/textadept/session.lua
+++ b/modules/textadept/session.lua
@@ -50,7 +50,7 @@ function load(filename)
else
new_buffer()
buffer._type = filename
- events.handle('file_opened', filename)
+ events.emit('file_opened', filename)
end
-- Restore saved buffer selection and view.
local anchor = tonumber(anchor) or 0
@@ -148,9 +148,9 @@ function save(filename)
end
-- Write out the current focused view.
local current_view = view
- for index, view in ipairs(_VIEWS) do
- if view == current_view then
- current_view = index
+ for i = 1, #_VIEWS do
+ if _VIEWS[i] == current_view then
+ current_view = i
break
end
end