add 'cmd-lowercase-word' to downcase word to end
This commit is contained in:
parent
18f6d954a7
commit
6e6cca33b8
1
doc.go
1
doc.go
@ -76,6 +76,7 @@ keybindings:
|
||||
cmd-capitalize-word (default '<a-c>')
|
||||
cmd-delete-word (default '<a-d>')
|
||||
cmd-uppercase-word (default '<a-u>')
|
||||
cmd-lowercase-word (default '<a-l>')
|
||||
|
||||
The following options can be used to customize the behavior of lf:
|
||||
|
||||
|
@ -80,6 +80,7 @@ keybindings:
|
||||
cmd-capitalize-word (default '<a-c>')
|
||||
cmd-delete-word (default '<a-d>')
|
||||
cmd-uppercase-word (default '<a-u>')
|
||||
cmd-lowercase-word (default '<a-l>')
|
||||
|
||||
The following options can be used to customize the behavior of lf:
|
||||
|
||||
|
10
eval.go
10
eval.go
@ -661,6 +661,16 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
app.ui.cmdAccLeft = append(app.ui.cmdAccLeft, []rune(strings.ToUpper(string(app.ui.cmdAccRight[:ind])))...)
|
||||
app.ui.cmdAccRight = app.ui.cmdAccRight[ind:]
|
||||
}
|
||||
case "cmd-lowercase-word":
|
||||
if len(app.ui.cmdAccRight) > 0 {
|
||||
loc := reWordEnd.FindStringIndex(string(app.ui.cmdAccRight))
|
||||
if loc == nil {
|
||||
return
|
||||
}
|
||||
ind := loc[0] + 1
|
||||
app.ui.cmdAccLeft = append(app.ui.cmdAccLeft, []rune(strings.ToLower(string(app.ui.cmdAccRight[:ind])))...)
|
||||
app.ui.cmdAccRight = app.ui.cmdAccRight[ind:]
|
||||
}
|
||||
default:
|
||||
cmd, ok := gOpts.cmds[e.name]
|
||||
if !ok {
|
||||
|
1
opts.go
1
opts.go
@ -147,6 +147,7 @@ func init() {
|
||||
gOpts.cmdkeys["<a-c>"] = &callExpr{"cmd-capitalize-word", nil, 1}
|
||||
gOpts.cmdkeys["<a-d>"] = &callExpr{"cmd-delete-word", nil, 1}
|
||||
gOpts.cmdkeys["<a-u>"] = &callExpr{"cmd-uppercase-word", nil, 1}
|
||||
gOpts.cmdkeys["<a-l>"] = &callExpr{"cmd-lowercase-word", nil, 1}
|
||||
|
||||
// TODO: implement the rest of readline keys
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user