rename 'comp' to 'complete'

This commit is contained in:
Gokcehan 2018-05-16 00:05:06 +03:00
parent 3deea69c4d
commit 04f1d68d1e
6 changed files with 8 additions and 8 deletions

View File

@ -228,7 +228,7 @@ func matchFile(s string) (matches []string, longest string) {
return
}
func compCmd(acc []rune) (matches []string, longestAcc []rune) {
func completeCmd(acc []rune) (matches []string, longestAcc []rune) {
s := string(acc)
f := tokenize(s)
@ -267,7 +267,7 @@ func compCmd(acc []rune) (matches []string, longestAcc []rune) {
return
}
func compShell(acc []rune) (matches []string, longestAcc []rune) {
func completeShell(acc []rune) (matches []string, longestAcc []rune) {
s := string(acc)
f := tokenize(s)

2
doc.go
View File

@ -55,7 +55,7 @@ The following command line commands are provided by lf with default
keybindings:
cmd-escape (default '<esc>')
cmd-comp (default '<tab>')
cmd-complete (default '<tab>')
cmd-enter (default '<c-j>' and '<enter>')
cmd-hist-next (default '<c-n>')
cmd-hist-prev (default '<c-p>')

View File

@ -59,7 +59,7 @@ The following command line commands are provided by lf with default
keybindings:
cmd-escape (default '<esc>')
cmd-comp (default '<tab>')
cmd-complete (default '<tab>')
cmd-enter (default '<c-j>' and '<enter>')
cmd-hist-next (default '<c-n>')
cmd-hist-prev (default '<c-p>')

View File

@ -455,12 +455,12 @@ func (e *callExpr) eval(app *app, args []string) {
app.ui.cmdAccLeft = nil
app.ui.cmdAccRight = nil
app.ui.cmdPrefix = ""
case "cmd-comp":
case "cmd-complete":
var matches []string
if app.ui.cmdPrefix == ":" {
matches, app.ui.cmdAccLeft = compCmd(app.ui.cmdAccLeft)
matches, app.ui.cmdAccLeft = completeCmd(app.ui.cmdAccLeft)
} else {
matches, app.ui.cmdAccLeft = compShell(app.ui.cmdAccLeft)
matches, app.ui.cmdAccLeft = completeShell(app.ui.cmdAccLeft)
}
app.ui.draw(app.nav)
if len(matches) > 1 {

View File

@ -119,7 +119,7 @@ func init() {
gOpts.cmdkeys["<space>"] = &callExpr{"cmd-insert", []string{" "}, 1}
gOpts.cmdkeys["<esc>"] = &callExpr{"cmd-escape", nil, 1}
gOpts.cmdkeys["<tab>"] = &callExpr{"cmd-comp", nil, 1}
gOpts.cmdkeys["<tab>"] = &callExpr{"cmd-complete", nil, 1}
gOpts.cmdkeys["<enter>"] = &callExpr{"cmd-enter", nil, 1}
gOpts.cmdkeys["<c-j>"] = &callExpr{"cmd-enter", nil, 1}
gOpts.cmdkeys["<c-n>"] = &callExpr{"cmd-hist-next", nil, 1}