Add files via upload
Kevgeon - Brandon [07-18-17 - 07:08]
Add files via upload
upon auto completion of a tab, cursor remembers its position at the end of the opening tab and jumps back to it after placing closing tag
diff --git a/autotag2.lua b/autotag2.lua
index 6998f2d..c4fbe37 100644
--- a/autotag2.lua
+++ b/autotag2.lua
@@ -6,8 +6,8 @@ return {
onEditorCharAdded = function(self, editor, event)
local tag = editor:GetCurLine()
local curkey = event:GetKey()
- local curpos = editor:GetCurrentPos()
if curkey == 62 and tag:find("%b<>") then
+ local curpos = editor:GetCurrentPos()
if tag:find([[</]]) then
goto breakout
end
@@ -16,6 +16,7 @@ return {
end
local tagtoclose = tag:match("<([%a%d]+)")
editor:AddText("</"..tagtoclose..">")
+ editor:SetEmptySelection(curpos)
::breakout::
end
end