]> git.lizzy.rs Git - micro.git/commitdiff
Fix issue with autoclose plugin
authorZachary Yedidia <zyedidia@gmail.com>
Sun, 24 Jul 2016 20:19:41 +0000 (16:19 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Sun, 24 Jul 2016 20:19:41 +0000 (16:19 -0400)
cmd/micro/runtime.go
runtime/plugins/autoclose/autoclose.lua

index 3a0416ebef49e09587bceb397af9c0585343b1c1..c7cfca9a19fa8a5d9d7faeb54d232c5e1b2397b8 100644 (file)
@@ -305,7 +305,7 @@ func runtimeHelpHelpMd() (*asset, error) {
        return a, nil
 }
 
-var _runtimePluginsAutocloseAutocloseLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x55\x6f\x6b\xdb\x3e\x10\x7e\x9f\x4f\x71\xb8\x2f\x62\x53\x27\xe0\xdf\xcb\x42\x7f\xd0\x76\x63\x14\xca\x36\xca\xd8\x1f\xda\xbe\x50\xe4\x4b\x2d\xea\x4a\x41\x96\x9c\x8e\xd2\xef\xbe\x93\xed\x28\xb6\xeb\x78\xc9\x68\x1d\x70\x64\xe9\xee\x9e\xe7\x39\x9d\x4e\x4b\x2b\xb9\x11\x4a\x02\xcf\x98\x3e\x33\x61\x61\x74\x0c\x22\x9a\x00\x3d\x1a\x8d\xd5\x12\x68\x4a\xc8\xfb\x79\x61\x17\xcd\x6a\x65\x80\x32\x9d\x4c\xc4\x12\x3e\xa1\xf9\xb2\x72\x11\xc2\x80\x59\xa3\x78\xae\x0a\x0c\x22\x38\x3d\x05\x29\x72\x30\x19\xca\x2a\xd6\x59\x9a\xbe\x36\x8b\xc1\x68\x8b\x4d\xac\x5c\x71\x96\x83\x5f\xfc\xca\x84\x2e\xe0\x14\x9e\x83\x5b\xfa\x91\x69\x30\x9d\xba\x77\x18\xb9\xf7\xf3\x8b\x7b\xdf\xdc\x05\x2f\x2d\xbf\xcf\xb8\xce\x85\x6c\x79\xbe\xb2\x9d\x78\xb9\x4a\x5e\x5b\x89\xa1\xae\x95\x92\x0e\xa9\xcc\x2e\x2d\x5e\xc4\x36\x29\xd5\x67\x45\xdb\x0d\x6a\x0a\x25\x61\x5e\x58\xfd\x5d\xe0\x3a\xac\xc3\x2e\x95\x06\x41\xb3\x49\x0c\x47\x3d\x61\xa9\xf2\x11\x09\x5c\xbb\x7c\x35\x3b\xd0\x35\xbc\x11\x77\x31\xfc\xd7\xe3\xb0\xc5\xe4\x56\x5f\x91\x64\xc2\x28\xe7\xe7\x76\x79\xe2\x3e\xc2\x72\x4e\x34\x0a\xa5\xe7\xbf\xa2\x49\xc7\x87\x90\x1a\x90\xc6\x2f\x06\x6f\xfb\xf3\x38\x89\x0e\x67\xe1\x9e\xf2\xe4\x9c\xf1\x87\x62\xc5\x38\x36\xba\xbb\xab\x35\xc0\xb5\xb8\xcf\xcc\xc0\xfa\x42\x23\x7b\xe8\xcc\xfa\xb4\xb6\x68\x6f\x69\xc2\xff\x90\x00\x93\x29\x84\x97\xc5\x0f\xa5\xd3\x0b\xe2\x1b\xee\x56\x35\x4b\xa2\x08\x68\x1b\x46\x2d\xc6\x75\xbb\x08\x83\xc2\x87\xa9\x0f\x8d\xff\xbe\xc5\xc9\xdb\x6d\x71\x2b\x57\x04\x79\xb4\xf1\xa7\x24\xb8\x1a\xdf\x2b\x6b\xc7\x3b\x35\xcf\x66\x6e\x1e\xa6\xb3\x29\x64\xa8\x11\x44\x01\x46\x41\x4a\xc3\x25\x4a\x8e\xd5\xe2\x4a\x09\x69\x50\xbb\x05\x1f\xf2\x4a\x71\x58\x67\x82\x67\xce\xc3\xe9\x7f\x64\x46\x90\xbc\xfc\x37\x3c\xb2\x14\x87\x70\xd6\x84\x0f\x5c\xc9\x12\xb5\xa1\x06\x04\xf7\xca\xb5\x22\xcb\x4d\x05\x99\x5b\x36\xe4\x74\x69\x40\x22\xa6\x95\xc9\x02\x1b\x62\xda\x51\x4b\xe9\x9b\x33\x5b\xd4\x1c\x7d\x23\xc0\xa7\x15\xba\x90\x8c\xb2\x23\x3d\xf5\x1a\xe8\x75\x31\x57\x3b\x70\x29\x0b\xa2\x14\xce\xda\xe2\xe2\xd1\x83\xb3\x6f\xd9\xf7\xc7\xee\xbf\x3a\x0e\xad\xbe\x55\xa3\x7f\x74\x34\xc3\x77\xed\x5e\x7b\x96\xdf\xd6\x34\x67\x85\x19\xb3\xa5\x93\xd6\x0d\xec\x5a\x30\xf8\x53\xb1\x71\xa7\x66\xb9\x19\xb6\xed\x25\x3e\x99\xae\x83\x2f\xdc\xa4\x39\x04\xfd\x7e\xdb\xb9\x10\xba\x1d\xd7\xa3\x77\x0e\x65\xdb\x61\xe7\xb1\x74\xe9\xf6\x5c\xc6\xdd\x77\xb7\xcc\x7a\x17\xbf\xb1\xc5\x50\xcb\x1c\xa9\xb2\xe0\x56\x06\xd1\x3f\xd5\x4d\xbf\x49\xbf\x43\xd5\x1c\x70\xe9\x1d\x50\x5c\x9b\x1d\x7b\xdb\x9b\xab\x3c\xf9\x80\x39\x9a\xf6\x95\xd5\xcf\xde\x9f\x00\x00\x00\xff\xff\x6f\x33\xf1\x5f\x1c\x09\x00\x00")
+var _runtimePluginsAutocloseAutocloseLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x56\x5b\x4f\xdb\x30\x14\x7e\xef\xaf\x38\x0a\x0f\x4d\x44\x5a\x29\x7b\x44\x62\x12\xb0\x69\x42\x42\xdb\x84\xa6\x5d\x04\x3c\xb8\xce\x29\xb1\x08\x76\xe5\xd8\x29\x13\xe2\xbf\xef\x38\x49\xdd\xa4\x4d\x02\x6c\xa3\x48\xc1\xb1\xcf\xe5\xfb\xce\xcd\x59\x5a\xc9\x8d\x50\x12\x78\xc6\xf4\x89\x09\x0b\xa3\x63\x10\xd1\x04\xe8\xa7\xd1\x58\x2d\x81\xb6\x84\xbc\x9d\x17\x76\xd1\x9c\x56\x02\x28\xd3\xc9\x44\x2c\xe1\x13\x9a\x2f\x2b\x67\x21\x0c\x98\x35\x8a\xe7\xaa\xc0\x20\x82\xe3\x63\x90\x22\x07\x93\xa1\xac\x6c\x9d\xa4\xe9\xbe\x58\x0c\x46\x5b\x6c\x6c\xe5\x8a\xb3\x1c\xfc\xe1\x57\x26\x74\x01\xc7\xf0\x18\x5c\xd3\x1f\x89\x06\xd3\xa9\x7b\x86\x91\x7b\x3e\x3e\xb9\xe7\xd5\x4d\xf0\xd4\xd2\xfb\x8c\xeb\x5c\xc8\x96\xe6\x9e\xec\xc4\xd3\x55\xf2\xd2\x4a\x0c\x75\xcd\x94\x78\x48\x65\x86\xb8\x78\x12\xdb\xa0\x54\xaf\x15\x6c\xb7\xa8\x21\x94\xe4\xf3\xcc\xea\xef\x02\xd7\x61\x6d\x76\xa9\x34\x08\xda\x4d\x62\x38\xd8\x21\x96\x2a\x6f\x91\x9c\x6b\x17\xaf\x26\x03\x5d\xc1\x2b\x71\x13\xc3\xbb\x1d\x0c\x5b\x9f\xdc\xea\x0b\xa2\x4c\x3e\xca\xf9\xa9\x5d\x1e\xb9\x97\xb0\x9c\x13\x8c\x42\xe9\xf9\xaf\x68\xd2\xd1\x21\x4f\x8d\x93\x46\x2f\x06\x2f\xfb\xf3\x30\x89\x5e\x8f\xc2\xfd\xca\xa3\x53\xc6\xef\x8a\x15\xe3\xd8\xf0\xee\x9e\xd6\x0e\x2e\xc5\x6d\x66\x7a\xce\x17\x1a\xd9\x5d\x67\xd7\x87\xb5\x05\x7b\x0b\x13\xde\x43\x02\x4c\xa6\x10\x9e\x17\x3f\x94\x4e\xcf\x08\x6f\x38\xcc\x6a\x96\x44\x11\x50\x1a\x46\x25\xc6\x79\x3b\x0b\xbd\xc4\xfb\xa1\xf7\xad\x9f\x4f\x71\xf2\xff\x52\xdc\x8a\x15\xb9\x3c\xd8\xe8\x53\x10\x5c\x8d\xbf\x28\x6a\x87\x83\x9c\x67\x33\xb7\x0f\xd3\xd9\x14\x32\xd4\x08\xa2\x00\xa3\x20\xa5\xe5\x12\x25\xc7\xea\x70\xa5\x84\x34\xa8\xdd\x81\x37\x79\xa1\x38\xac\x33\xc1\x33\xa7\xe1\xf8\xdf\x33\x23\x88\x5e\xfe\x1b\xee\x59\x8a\x7d\x7e\xd6\xe4\x1f\xb8\x92\x25\x6a\x43\x03\x08\x6e\x95\x1b\x45\x96\x9b\xca\x65\x6e\x59\x9f\xd2\xb9\x01\x89\x98\x56\x22\x0b\x6c\x80\x69\x07\x2d\xa5\x77\xce\x6c\x51\x63\xf4\x83\x00\x1f\x56\xe8\x4c\x32\x8a\x8e\xf4\xd0\x6b\x47\xfb\xc5\x5c\x65\xe0\x5c\x16\x04\x29\x9c\xb5\xc9\xc5\xa3\x8d\xf3\xd2\xb2\xdf\x5d\xbb\xff\x55\x3b\xb4\xe6\x56\xed\xfd\xa3\x83\x19\xbe\xe9\xf4\x7a\x61\xf9\x6d\x45\x73\x56\x98\x31\x59\xea\xb4\xae\x61\x37\x82\xc1\x77\xc5\x46\x9d\x86\xe5\x66\xd9\x96\x97\xf8\x60\xba\x0a\xbe\x70\x93\xa6\x09\x76\xe7\x6d\xe7\x42\xe8\x4e\x5c\xef\xbd\xd3\x94\x6d\x85\xc1\xb6\x74\xe1\xf6\x58\xc6\xd5\x87\x47\x66\x9d\xc5\x6f\x6c\xd1\x37\x32\x47\xaa\x2c\xb8\x96\x41\xf4\x17\x75\xb3\xd2\xb8\x3b\xa5\xdf\xa0\x6c\x5e\x71\xeb\xbd\xa2\xba\x36\x29\xfb\xa7\xab\xcb\x5d\x19\xc3\x16\x9e\xbd\x02\xf6\xf3\x58\x1e\x7d\xc0\x1c\x4d\xfb\xce\x6b\x87\xbf\xfd\x05\xe5\xbe\x72\xaa\x7c\xfc\x09\x00\x00\xff\xff\x4c\xa9\x4d\x15\x6e\x09\x00\x00")
 
 func runtimePluginsAutocloseAutocloseLuaBytes() ([]byte, error) {
        return bindataRead(
@@ -320,7 +320,7 @@ func runtimePluginsAutocloseAutocloseLua() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "runtime/plugins/autoclose/autoclose.lua", size: 2332, mode: os.FileMode(420), modTime: time.Unix(1468518768, 0)}
+       info := bindataFileInfo{name: "runtime/plugins/autoclose/autoclose.lua", size: 2414, mode: os.FileMode(420), modTime: time.Unix(1469391558, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
index c9d0710e947e6d1772023c2798c7192abac9ff66..ff143516d39ece0eb4192b6cf3ac9482e30f5609 100644 (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