aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/command_entry.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-04-29 15:10:06 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-04-29 15:10:06 -0400
commitfa02688bce862288a7211c3d08061666c9bbfb08 (patch)
tree9f85fe6dd0c89c075cb9e81110f39d616cd83b35 /modules/textadept/command_entry.lua
parent1848772a842bcb304e6dbb110fbe9014704ac145 (diff)
downloadtextadept-fa02688bce862288a7211c3d08061666c9bbfb08.tar.gz
textadept-fa02688bce862288a7211c3d08061666c9bbfb08.zip
When running the command entry, initially show the mode's prior text.
This was the previous behavior, but did not distinguish between modes.
Diffstat (limited to 'modules/textadept/command_entry.lua')
-rw-r--r--modules/textadept/command_entry.lua4
1 files changed, 3 insertions, 1 deletions
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)