aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-03 23:43:24 -0500
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2020-03-03 23:43:24 -0500
commite0282a064c78ef95fccf2cfe645eae320cb4c2c4 (patch)
tree9ba49b87f6eff1a2c33489ef8c310c8dd2995801 /modules
parentf642776a53f1dbefffc6cf1822161e233ebcdffd (diff)
Added tests for some complex menu functions.
Diffstat (limited to 'modules')
-rw-r--r--modules/textadept/menu.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 9684516b..f986037a 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -118,10 +118,12 @@ local default_menubar = {
{_L['Lower Case Selection'], buffer.lower_case},
SEPARATOR,
{_L['Enclose as XML Tags'], function()
+ buffer:begin_undo_action()
enc('<', '>')
local pos = buffer.current_pos
while buffer.char_at[pos - 1] ~= 60 do pos = pos - 1 end -- '<'
buffer:insert_text(-1, '</'..buffer:text_range(pos, buffer.current_pos))
+ buffer:end_undo_action()
end},
{_L['Enclose as Single XML Tag'], function() enc('<', ' />') end},
{_L['Enclose in Single Quotes'], function() enc("'", "'") end},