aboutsummaryrefslogtreecommitdiff
path: root/test/test.lua
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2020-05-24 15:39:17 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2020-05-24 15:39:17 -0400
commiteffc636745e8d9c680c3acf42e8e25eed10cd903 (patch)
treecc6ba82e3f7fb23ff73281af03d462ffd4c24e77 /test/test.lua
parent426e323063217b4395dd1871392d3df13c30ed4f (diff)
downloadtextadept-effc636745e8d9c680c3acf42e8e25eed10cd903.tar.gz
textadept-effc636745e8d9c680c3acf42e8e25eed10cd903.zip
Restore prior key mode after running the command entry.
Diffstat (limited to 'test/test.lua')
-rw-r--r--test/test.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index e67f02ae..b27329fa 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1242,6 +1242,16 @@ function test_command_entry_history()
events.emit(events.KEYPRESS, not CURSES and 0xFF1B or 7) -- esc
end
+function test_command_entry_mode_restore()
+ local mode = 'test_mode'
+ keys.mode = mode
+ ui.command_entry.run(nil)
+ assert(keys.mode ~= mode)
+ events.emit(events.KEYPRESS, not CURSES and 0xFF0D or 343) -- \n
+ assert_equal(keys.mode, mode)
+ keys.mode = nil
+end
+
function test_editing_auto_pair()
buffer.new()
-- Single selection.