Fix issue with autoclose plugin

This commit is contained in:
Zachary Yedidia
2016-07-24 16:19:41 -04:00
parent ba33802525
commit ddcebe4946
2 changed files with 6 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ function onInsertEnter()
end
end
function onBackspace()
function preBackspace()
if not GetOption("autoclose") then
return
end
@@ -73,8 +73,10 @@ function onBackspace()
for i = 1, #autoclosePairs do
local curLine = v.Buf:Line(v.Cursor.Y)
if charAt(curLine, v.Cursor.X+1) == charAt(autoclosePairs[i], 2) then
if charAt(curLine, v.Cursor.X+1) == charAt(autoclosePairs[i], 2) and charAt(curLine, v.Cursor.X) == charAt(autoclosePairs[i], 1) then
v:Delete()
end
end
return true
end