Add cmd-delete-word-back command (#1409)
* add `cmd-delete-word-back` Implementation of zsh-like backwards word deletion. * add unixwords option and evaluate, short description in doc * remove unixwords configuration option * remove yank, bind delete word back to alt-backspace, update docs * minor changes to docs * small fixes
This commit is contained in:
1 parent
439fb038e5
commit
791dfff8dc
6 files changed
+31
No files matched your search
@@ -2665,6 +2665,17 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
ind := loc[3]
|
||||
app.ui.cmdAccRight = []rune(string(app.ui.cmdAccRight)[ind:])
|
||||
update(app)
|
||||
case "cmd-delete-word-back":
|
||||
if len(app.ui.cmdAccLeft) == 0 {
|
||||
return
|
||||
}
|
||||
locs := reWordBeg.FindAllStringSubmatchIndex(string(app.ui.cmdAccLeft), -1)
|
||||
if locs == nil {
|
||||
return
|
||||
}
|
||||
ind := locs[len(locs)-1][3]
|
||||
app.ui.cmdAccLeft = app.ui.cmdAccLeft[:ind]
|
||||
update(app)
|
||||
case "cmd-uppercase-word":
|
||||
if len(app.ui.cmdAccRight) == 0 {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user