]> git.lizzy.rs Git - micro.git/commitdiff
Fix minor issue with autoclose
authorZachary Yedidia <zyedidia@gmail.com>
Fri, 19 Aug 2016 22:24:42 +0000 (15:24 -0700)
committerZachary Yedidia <zyedidia@gmail.com>
Fri, 19 Aug 2016 22:24:42 +0000 (15:24 -0700)
cmd/micro/autocomplete.go
cmd/micro/runtime.go
runtime/plugins/autoclose/autoclose.lua

index b34a562d3d53c85214f17d2b1de1ecba2774aea6..fcfd726a46952c16495d998ec5cdbeb350f3b685 100644 (file)
@@ -4,7 +4,8 @@ import (
        "io/ioutil"
        "os"
        "strings"
-       // "github.com/mitchellh/go-homedir"
+
+       "github.com/mitchellh/go-homedir"
 )
 
 // This file is meant (for now) for autocompletion in command mode, not
@@ -17,13 +18,13 @@ func FileComplete(input string) (string, []string) {
        var files []os.FileInfo
        var err error
        if len(dirs) > 1 {
-               // home, _ := homedir.Dir()
+               home, _ := homedir.Dir()
 
-               // directories := strings.Join(dirs[:len(dirs)-1], "/")
-               // if strings.HasPrefix(directories, "~") {
-               //      directories = strings.Replace(directories, "~", home)
-               // }
-               files, err = ioutil.ReadDir(strings.Join(dirs[:len(dirs)-1], "/"))
+               directories := strings.Join(dirs[:len(dirs)-1], "/")
+               if strings.HasPrefix(directories, "~") {
+                       directories = strings.Replace(directories, "~", home, 1)
+               }
+               files, err = ioutil.ReadDir(directories)
        } else {
                files, err = ioutil.ReadDir(".")
        }
index 79f0de5ad8eed94b67bf96783f0bcd934e5bb063..1af08f8fc6bfcc877ea161fc406b5000ba88aec7 100644 (file)
@@ -411,7 +411,7 @@ func runtimeHelpPluginsMd() (*asset, error) {
        return a, nil
 }
 
-var _runtimePluginsAutocloseAutocloseLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x56\x5d\x6b\xa3\x4c\x14\xbe\xcf\xaf\x38\xd8\x8b\x28\xd5\x40\xde\xcb\x80\x2f\xb4\x5d\x28\x85\xee\x07\x65\xd9\xee\xd2\xf6\x62\x32\x1e\x75\xa8\x3d\x13\xce\x8c\x49\x97\xd2\xff\xbe\x8c\x5a\xa3\x49\x4c\x13\x68\x73\x61\xd4\x79\x9e\xf3\xfd\x61\x5a\x92\xb4\x4a\x13\xc8\x5c\xf0\x99\xf5\x8d\xe5\x10\x54\x30\x02\x00\x60\xb4\x25\x13\x18\xcb\x8a\xb2\x89\x29\xe7\xcd\x69\x05\x40\x4a\x46\x23\x95\xc2\x25\xda\xef\x0b\x27\xc1\xf7\x44\x69\xb5\x2c\xb4\x41\x2f\x80\x38\x06\x52\x05\xd8\x1c\xa9\x92\x75\x96\x24\xdb\xb0\x10\x2c\x97\xd8\xc8\x2a\xb4\x14\x05\xb4\x87\x3f\x84\x62\x03\x31\xbc\x78\xf7\xde\xbd\xe7\x85\xe0\x8d\xc7\xee\xea\x07\xee\xfa\xf2\xea\xae\x77\x0f\xde\x6b\x87\xf7\x0d\x57\x85\xa2\x0e\x73\x0b\x3b\x6a\xdd\xd5\x74\x53\x12\xfa\x5c\x7b\xaa\x52\x20\x6d\x87\x7c\x69\x9d\x58\x07\xa5\x7a\xac\xcc\x76\x37\xb5\x09\x4b\x88\xe1\xa2\xe4\x5f\x0a\x57\x7e\x2d\x36\xd5\x0c\x0a\x62\x98\x86\x70\xb2\xe1\x58\xa2\x5b\x89\x2a\x05\x76\xf1\x6a\x32\xd0\x07\xde\xa9\x87\x10\xfe\xdb\xb0\x61\xad\x53\x96\x7c\xad\x08\x21\x86\xe5\xe4\xbc\x4c\x67\xee\xc1\x5f\x4e\x2e\x4a\x36\x9a\x27\x7f\x82\x51\x8f\xa3\xd2\x37\x25\x0d\x2f\x84\x16\xfb\xfb\x74\x1a\x1c\x6f\x85\xfb\x2d\x67\xe7\x42\x3e\x9a\x85\x90\xe8\xa7\xa2\x30\x18\xec\x80\xd4\x5a\x6e\x54\x96\xdb\x21\xd0\x9c\x51\x3c\xf6\xde\xb6\x01\xee\x38\xb0\x36\x18\xfe\x87\x29\x08\x4a\xc0\xbf\x32\xb7\x9a\x93\x8b\x5c\xb0\x3f\xec\x5f\x34\x0d\x02\xd0\xbc\x27\x02\xd1\x7b\x11\x70\x12\x76\x86\x60\xb7\xe9\xbb\xee\xdf\x4f\xf6\xf4\xe3\x92\xdd\x89\x55\x1c\xc3\xc9\x1b\x5f\x73\x55\xed\x07\x45\xed\x74\xd0\xe7\x28\x72\xef\x61\x1c\x8d\x21\x47\x46\x50\x06\xac\x86\x04\x19\x53\x24\x89\xd5\xe1\x42\x2b\xb2\xc8\xee\xa0\x15\x79\xad\x25\xac\x72\x25\x73\xc7\x70\xfe\x3f\x09\xab\xa4\x28\x8a\xbf\xf0\x24\x12\xdc\xa5\x67\x95\x23\x81\xd4\xb4\x44\xb6\x8a\x32\xc8\xb4\x1b\x4a\xa5\xb4\x95\xca\xa2\x14\xbb\x48\x57\x16\x08\x31\xa9\x20\x73\x6c\x0c\x63\x67\x5a\x02\x73\x94\xa2\x34\xb5\x8d\xed\x48\xc0\xe7\x05\x3a\x91\x02\x48\x53\x6b\x7a\xad\x68\xbb\xa2\xab\x0c\x5c\x91\x41\xb6\x7e\xd4\x75\x2e\xdc\xdb\x42\x87\x96\xfd\xe6\xbd\xfb\xaf\xda\xa1\x35\x77\xc1\x58\xab\x6f\xc6\x9e\xff\xa9\xa3\xec\xc0\x0a\xec\x41\xdd\x84\x85\x78\x4f\xc3\x75\xf1\x84\xcf\xf6\x5d\xc2\xe9\xb4\x4b\x59\xb9\x29\x7f\x89\xf6\x1a\x45\xa2\x28\xbb\xcd\x95\xc5\x7a\x0c\x35\xd4\x1a\xfc\x84\xc6\x20\x65\xc8\xb3\xaf\x68\x8c\xc8\xaa\x63\xa7\x2a\x04\x0f\xbc\xb0\xd5\xdc\xf4\xcf\xe6\xd0\xee\x6d\x95\xfe\xd8\x6e\x7d\xec\xf5\x73\x97\x30\xd8\xd1\x2e\x4d\xad\xc7\xfb\xe9\xc3\x73\xb7\x9f\xff\xc1\xd9\x5b\xc3\x7e\x8a\xf9\x20\x64\x4f\x31\x7b\xf7\xe4\xc1\x64\x02\x2b\xb3\xcd\x8b\xa2\x43\x8d\x38\xbc\xc8\xbb\x5f\x1e\x95\xb0\xed\xb2\x5f\xaf\x9b\x4f\x2b\xf9\x23\xd6\xf7\x11\x9d\x01\x1f\xb1\x83\xdd\xc6\xdb\xd3\x52\xc7\x2f\x97\xe5\xec\x0b\x16\x68\xb7\x72\x37\x94\x15\xf7\xcd\x56\x25\xe5\x5f\x00\x00\x00\xff\xff\x08\x07\xbd\xf9\x3c\x0a\x00\x00")
+var _runtimePluginsAutocloseAutocloseLua = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x56\x5b\x6b\xa3\x4e\x14\x7f\xcf\xa7\x38\xd8\x87\x28\x35\x81\xfc\x1f\x03\xfe\xa1\xed\x42\x29\x74\x2f\x94\x65\xbb\x4b\xdb\x87\xc9\x78\xd4\xa1\xe6\x4c\x38\x33\x26\x5d\x4a\xbf\xfb\x32\x6a\x8d\x26\x31\x17\x68\xf3\x60\xd4\xf9\xfd\xce\xfd\x62\x52\x90\xb4\x4a\x13\xc8\x4c\xf0\x85\xf5\x8d\xe5\x10\x54\x30\x00\x00\x60\xb4\x05\x13\x18\xcb\x8a\xd2\xb1\x29\x66\xf5\x69\x09\x40\x8a\x07\x03\x95\xc0\x35\xda\xef\x0b\x27\xc1\xf7\x44\x61\xb5\xcc\xb5\x41\x2f\x80\x28\x02\x52\x39\xd8\x0c\xa9\x94\x75\x11\xc7\xdb\xb0\x10\x2c\x17\x58\xcb\xca\xb5\x14\x39\x34\x87\x3f\x84\x62\x03\x11\xbc\x7a\x8f\xde\xa3\xe7\x85\xe0\x0d\x87\xee\xea\x07\xee\xfa\xfa\xe6\xae\x0f\x4f\xde\x5b\x8b\xf7\x0d\x57\xb9\xa2\x16\x73\x0b\x3b\x68\xdc\xd5\x74\x57\x10\xfa\x5c\x79\xaa\x12\x20\x6d\xfb\x7c\x69\x9c\x58\x07\xa5\x7c\x2c\xcd\x76\x37\x95\x09\x4b\x88\xe0\xaa\xe0\x5f\x0a\x57\x7e\x25\x36\xd1\x0c\x0a\x22\x98\x84\x70\xb6\xe1\x58\xac\x1b\x89\x2a\x01\x76\xf1\xaa\x33\xd0\x05\x3e\xa8\xa7\x10\xfe\xdb\xb0\x61\xad\x53\x16\x7c\xab\x08\x21\x82\xe5\xf8\xb2\x48\xa6\xee\xc1\x5f\x8e\xaf\x0a\x36\x9a\xc7\x7f\x82\x41\x87\xa3\x92\x77\x25\x35\x2f\x84\x06\xfb\xfb\x7c\x12\x9c\x6e\x85\xfb\x2d\xa7\x97\x42\x3e\x9b\x85\x90\xe8\x27\x22\x37\x18\xec\x80\x54\x5a\xee\x54\x9a\xd9\x3e\xd0\x8c\x51\x3c\x77\xde\x36\x01\x6e\x39\xb0\x36\x18\xfe\x87\x09\x08\x8a\xc1\xbf\x31\xf7\x9a\xe3\xab\x4c\xb0\xdf\xef\xdf\x68\x12\x04\xa0\x79\x4f\x04\x46\x87\x22\xe0\x24\xec\x0c\xc1\x6e\xd3\x77\xdd\x1f\x4e\xf6\xe4\xe3\x92\xdd\x8a\x55\x14\xc1\xd9\x3b\x5f\x73\x59\xed\x47\x45\xed\xbc\xd7\xe7\xd1\xc8\xbd\x87\xe1\x68\x08\x19\x32\x82\x32\x60\x35\xc4\xc8\x98\x20\x49\x2c\x0f\x17\x5a\x91\x45\x76\x07\x8d\xc8\x5b\x2d\x61\x95\x29\x99\x39\x86\xf3\x7f\x2e\xac\x92\x22\xcf\xff\xc2\x5c\xc4\xb8\x4b\xcf\x2a\x43\x02\xa9\x69\x89\x6c\x15\xa5\x90\x6a\x37\x94\x0a\x69\x4b\x95\x79\x21\x76\x91\x6e\x2c\x10\x62\x5c\x42\x66\x58\x1b\xc6\xce\xb4\x18\x66\x28\x45\x61\x2a\x1b\x9b\x91\x80\x2f\x0b\x74\x22\x05\x90\xa6\xc6\xf4\x4a\xd1\x76\x45\x97\x19\xb8\x21\x83\x6c\xfd\x51\xdb\xb9\x70\x6f\x0b\x1d\x5b\xf6\x9b\xf7\xee\xbf\x6c\x87\xc6\xdc\x05\x63\xa5\xbe\x1e\x7b\xfe\xa7\x8e\xb2\x23\x2b\xb0\x03\x75\x13\x16\xa2\x3d\x0d\xd7\xc6\x13\xbe\xd8\x83\x84\xf3\x49\x9b\xb2\x72\x53\xfe\x1a\xed\x2d\x8a\x58\x51\x7a\x9f\x29\x8b\xd5\x18\xaa\xa9\x15\x78\x8e\xc6\x20\xa5\xc8\xd3\xaf\x68\x8c\x48\xcb\x63\xa7\x2a\x04\x0f\xbc\xb0\xd1\x5c\xf7\xcf\xe6\xd0\xee\x6c\x95\xee\xd8\x6e\x7c\xec\xf4\x73\x9b\xd0\xdb\xd1\x2e\x4d\x8d\xc7\xfb\xe9\xfd\x73\xb7\x9b\xff\xde\xd9\x5b\xc1\x7e\x8a\x59\x2f\x64\x4f\x31\x7b\x8f\xe4\xc1\x78\x0c\x2b\xb3\xcd\xab\x3f\x10\x4a\xa9\x47\x55\x70\xfb\xb3\xc2\xad\xfe\xed\x92\x5e\xaf\x92\x4f\x2b\xe7\x13\x56\xf3\x09\x55\x0f\x1f\xb1\x5f\xdd\x36\xdb\xd3\x2e\xa7\x2f\x8e\xe5\xf4\x0b\xe6\x68\xb7\x8a\xe3\x60\x52\xfe\x05\x00\x00\xff\xff\x5f\x4f\xb5\xed\x18\x0a\x00\x00")
 
 func runtimePluginsAutocloseAutocloseLuaBytes() ([]byte, error) {
        return bindataRead(
@@ -426,7 +426,7 @@ func runtimePluginsAutocloseAutocloseLua() (*asset, error) {
                return nil, err
        }
 
-       info := bindataFileInfo{name: "runtime/plugins/autoclose/autoclose.lua", size: 2620, mode: os.FileMode(420), modTime: time.Unix(1471644821, 0)}
+       info := bindataFileInfo{name: "runtime/plugins/autoclose/autoclose.lua", size: 2584, mode: os.FileMode(420), modTime: time.Unix(1471645316, 0)}
        a := &asset{bytes: bytes, info: info}
        return a, nil
 }
index 674d8d11b88372704e2b2653daa64afea40561e2..2480ffe01ce510321f39360210c92c7e67da96b3 100644 (file)
@@ -61,13 +61,12 @@ function preInsertNewline()
                 v:InsertNewline(false)
                 v:InsertTab(false)
                 v.Buf:Insert(-v.Cursor.Loc, "\n" .. ws)
-                -- v:InsertNewline(false)
-                break
+                return false
             end
         end
     end
 
-    return false
+    return true
 end
 
 function preBackspace()