diff options
author | 2020-08-17 17:58:14 -0400 | |
---|---|---|
committer | 2020-08-17 17:58:14 -0400 | |
commit | 71f98b40ca8c929e5bb56908719de0b871b1b569 (patch) | |
tree | 897156e705f157a019daa97cd1c680692f539561 | |
parent | b9a22328026264661c5713b783dd30ec07b16b9c (diff) | |
download | textadept-71f98b40ca8c929e5bb56908719de0b871b1b569.tar.gz textadept-71f98b40ca8c929e5bb56908719de0b871b1b569.zip |
Small code cleanup.
-rw-r--r-- | modules/textadept/command_entry.lua | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 34ebc7e8..db26b8f2 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -248,17 +248,16 @@ events.connect(events.INITIALIZED, function() for i = 1, M.margins do M.margin_width_n[i] = 0 end M.call_tip_position = true for key, f in pairs(keys) do - if f == textadept.editing.show_documentation then - lua_keys[key] = function() - -- Temporarily change _G.buffer and _G.view since ui.command_entry is - -- the "active" buffer and view. - local orig_buffer, orig_view = _G.buffer, _G.view - _G.buffer, _G.view = ui.command_entry, ui.command_entry - textadept.editing.show_documentation() - _G.buffer, _G.view = orig_buffer, orig_view - end - break + if f ~= textadept.editing.show_documentation then goto continue end + lua_keys[key] = function() + -- Temporarily change _G.buffer and _G.view since ui.command_entry is + -- the "active" buffer and view. + local orig_buffer, orig_view = _G.buffer, _G.view + _G.buffer, _G.view = ui.command_entry, ui.command_entry + textadept.editing.show_documentation() + _G.buffer, _G.view = orig_buffer, orig_view end + ::continue:: end end) |