From fa02688bce862288a7211c3d08061666c9bbfb08 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 29 Apr 2020 15:10:06 -0400 Subject: When running the command entry, initially show the mode's prior text. This was the previous behavior, but did not distinguish between modes. --- modules/textadept/command_entry.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/textadept/command_entry.lua b/modules/textadept/command_entry.lua index 8310a8b8..c2b6d7f6 100644 --- a/modules/textadept/command_entry.lua +++ b/modules/textadept/command_entry.lua @@ -214,7 +214,9 @@ function M.run(f, keys, lexer, height) if not getmetatable(keys) then setmetatable(keys, M.editing_keys) end if f and not history[f] then history[f] = {pos = 0} end history.mode = f - M:set_text('') + local mode_history = history[history.mode] + M:set_text(mode_history and mode_history[#mode_history] or '') + M:select_all() M.focus() M:set_lexer(lexer or 'text') M.height = M:text_height(1) * (height or 1) -- cgit v1.2.3