From c94eb63139d7ca800a05596157a65f560f610a91 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 16 Jun 2010 18:10:13 -0400 Subject: Code and documentation cleanup. --- modules/textadept/editing.lua | 2 +- modules/textadept/keys.lua | 3 +-- modules/textadept/session.lua | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 6c8cd680..8de26f08 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -321,7 +321,7 @@ end --- -- Reduces multiple characters occurances to just one. --- If char is not given, the character to be squeezed is the one under the +-- If char is not given, the character to be squeezed is the one behind the -- caret. -- @param char The character (integer) to be used for squeezing. function squeeze(char) diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index 0d65f76a..f5cd0914 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -489,7 +489,6 @@ local string = _G.string local string_char = string.char local string_format = string.format local pcall = _G.pcall -local ipairs = _G.ipairs local next = _G.next local type = _G.type local unpack = _G.unpack @@ -537,7 +536,7 @@ end -- of -1. This way, pcall will return false and -1, where the -1 can easily and -- efficiently be checked rather than using a string error message. local function try_get_cmd(active_table) - for _, key_seq in ipairs(keychain) do active_table = active_table[key_seq] end + for i = 1, #keychain do active_table = active_table[keychain[i]] end if #active_table == 0 and next(active_table) then gui.statusbar_text = locale.KEYCHAIN..table.concat(keychain, ' ') error(-1, 0) 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 -- cgit v1.2.3