mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Add more infobar autocomplete
This commit is contained in:
@@ -20,8 +20,7 @@ func (b *Buffer) Autocomplete(c Completer) {
|
||||
|
||||
}
|
||||
|
||||
// FileComplete autocompletes filenames
|
||||
func FileComplete(b *Buffer) (string, []string) {
|
||||
func GetArg(b *Buffer) (string, int) {
|
||||
c := b.GetActiveCursor()
|
||||
l := b.LineBytes(c.Y)
|
||||
l = util.SliceStart(l, c.X)
|
||||
@@ -36,6 +35,14 @@ func FileComplete(b *Buffer) (string, []string) {
|
||||
argstart += utf8.RuneCount(a) + 1
|
||||
}
|
||||
|
||||
return input, argstart
|
||||
}
|
||||
|
||||
// FileComplete autocompletes filenames
|
||||
func FileComplete(b *Buffer) (string, []string) {
|
||||
c := b.GetActiveCursor()
|
||||
input, argstart := GetArg(b)
|
||||
|
||||
sep := string(os.PathSeparator)
|
||||
dirs := strings.Split(input, sep)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user