reset 'cmd-hist-next/prev' to last in normal mode
This commit is contained in:
parent
e55c490bf5
commit
f6c99a7d46
6
eval.go
6
eval.go
@ -490,6 +490,9 @@ func (e *callExpr) eval(app *app, args []string) {
|
|||||||
app.cmdHist = append(app.cmdHist, cmdItem{app.ui.cmdPrefix, s})
|
app.cmdHist = append(app.cmdHist, cmdItem{app.ui.cmdPrefix, s})
|
||||||
app.ui.cmdPrefix = ""
|
app.ui.cmdPrefix = ""
|
||||||
case "cmd-hist-next":
|
case "cmd-hist-next":
|
||||||
|
if app.ui.cmdPrefix == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
if app.cmdHistInd > 0 {
|
if app.cmdHistInd > 0 {
|
||||||
app.cmdHistInd--
|
app.cmdHistInd--
|
||||||
}
|
}
|
||||||
@ -506,6 +509,9 @@ func (e *callExpr) eval(app *app, args []string) {
|
|||||||
app.ui.cmdAccRight = nil
|
app.ui.cmdAccRight = nil
|
||||||
app.ui.menuBuf = nil
|
app.ui.menuBuf = nil
|
||||||
case "cmd-hist-prev":
|
case "cmd-hist-prev":
|
||||||
|
if app.ui.cmdPrefix == "" {
|
||||||
|
app.cmdHistInd = 0
|
||||||
|
}
|
||||||
if app.cmdHistInd == len(app.cmdHist) {
|
if app.cmdHistInd == len(app.cmdHist) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user