aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2014-11-15 10:47:57 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2014-11-15 10:47:57 -0500
commit2bf038025274f5dd6ddaa09c5fbe0960b272d9f7 (patch)
tree5a1d7802665ef1543cb5268ed9a082f0f14a1036 /modules/textadept
parentece1052fc2e36baea8338d699166d692e681d0c0 (diff)
downloadtextadept-2bf038025274f5dd6ddaa09c5fbe0960b272d9f7.tar.gz
textadept-2bf038025274f5dd6ddaa09c5fbe0960b272d9f7.zip
Fixed command entry reset bug now that the entry is a Scintilla buffer.
Diffstat (limited to 'modules/textadept')
-rw-r--r--modules/textadept/command_entry.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua
index b4f63458..64f92c1f 100644
--- a/modules/textadept/command_entry.lua
+++ b/modules/textadept/command_entry.lua
@@ -178,7 +178,16 @@ keys.lua_command = {['\t'] = complete_lua, ['\n'] = {M.finish_mode, run_lua}}
-- Configure the command entry's default properties.
events.connect(events.INITIALIZED, function()
- if not arg then return end -- no need to reconfigure on reset
+ if not arg then
+ -- The buffers in `_BUFFERS` do not get wiped out during a reset. However,
+ -- `ui.command_entry` is not a normal buffer and does get wiped out. When
+ -- resetting, re-emit `events.BUFFER_NEW` in order to re-add buffer
+ -- functions like `set_lexer()`.
+ local buffer = _G.buffer
+ _G.buffer = M -- make event handlers believe M is the global buffer for now
+ events.emit(events.BUFFER_NEW)
+ _G.buffer = buffer
+ end
M.h_scroll_bar, M.v_scroll_bar = false, false
M.margin_width_n[0], M.margin_width_n[1], M.margin_width_n[2] = 0, 0, 0
end)