mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "59963add14c7d0134795d4f928efb75b0af1251e" and "5175367b35c6581cf2594589be06f849157823d1" have entirely different histories.
59963add14
...
5175367b35
|
@ -20,13 +20,8 @@ func newFileHistory() (*fileHistory, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
itms := []string{""}
|
var itms []string
|
||||||
lines := strings.Split(string(data), "\n")
|
for _, l := range strings.Split(string(data), "\n") {
|
||||||
for i, l := range lines {
|
|
||||||
if i == len(lines) - 1 {
|
|
||||||
println(i, l)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
itms = append(itms, l)
|
itms = append(itms, l)
|
||||||
}
|
}
|
||||||
f, err := os.OpenFile(defaultHistPath, os.O_RDWR | os.O_CREATE, 0755)
|
f, err := os.OpenFile(defaultHistPath, os.O_RDWR | os.O_CREATE, 0755)
|
||||||
|
|
5
rl.go
5
rl.go
|
@ -60,9 +60,6 @@ func newLineReader(prompt string) *lineReader {
|
||||||
ctx = aliases.Resolve(ctx)
|
ctx = aliases.Resolve(ctx)
|
||||||
|
|
||||||
if len(fields) == 1 {
|
if len(fields) == 1 {
|
||||||
prefixes := []string{"./", "../", "/", "~/"}
|
|
||||||
for _, prefix := range prefixes {
|
|
||||||
if strings.HasPrefix(query, prefix) {
|
|
||||||
fileCompletions := fileComplete(query, ctx, fields)
|
fileCompletions := fileComplete(query, ctx, fields)
|
||||||
if len(fileCompletions) != 0 {
|
if len(fileCompletions) != 0 {
|
||||||
for _, f := range fileCompletions {
|
for _, f := range fileCompletions {
|
||||||
|
@ -73,10 +70,8 @@ func newLineReader(prompt string) *lineReader {
|
||||||
completions = append(completions, f)
|
completions = append(completions, f)
|
||||||
}
|
}
|
||||||
compGroup[0].Suggestions = completions
|
compGroup[0].Suggestions = completions
|
||||||
}
|
|
||||||
return "", compGroup
|
return "", compGroup
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// filter out executables, but in path
|
// filter out executables, but in path
|
||||||
for _, dir := range filepath.SplitList(os.Getenv("PATH")) {
|
for _, dir := range filepath.SplitList(os.Getenv("PATH")) {
|
||||||
|
|
Loading…
Reference in New Issue