fix(root): ctrl R open reverse search instead of switching to history
This commit is contained in:
+10
-8
@@ -300,7 +300,15 @@ func runWrapper() {
|
|||||||
b := inputSlice[i]
|
b := inputSlice[i]
|
||||||
|
|
||||||
intercepted := false
|
intercepted := false
|
||||||
if overlay.Visible && (b == '\r' || b == 0x09) {
|
if b == 0x12 { // ctrl+r
|
||||||
|
intercepted = true
|
||||||
|
if mode == "spec" {
|
||||||
|
mode = "history"
|
||||||
|
} else {
|
||||||
|
mode = "spec"
|
||||||
|
}
|
||||||
|
shouldOverlayDraw = true
|
||||||
|
} else if overlay.Visible && (b == '\r' || b == 0x09) {
|
||||||
intercepted = true
|
intercepted = true
|
||||||
selected := overlay.Items[overlay.Cursor].Cmd
|
selected := overlay.Items[overlay.Cursor].Cmd
|
||||||
os.Stdout.Write([]byte(overlay.ClearAndDisable()))
|
os.Stdout.Write([]byte(overlay.ClearAndDisable()))
|
||||||
@@ -343,13 +351,7 @@ func runWrapper() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch b {
|
switch b {
|
||||||
case 0x12: // ctrl+r
|
|
||||||
if mode == "spec" {
|
|
||||||
mode = "history"
|
|
||||||
} else {
|
|
||||||
mode = "spec"
|
|
||||||
}
|
|
||||||
shouldOverlayDraw = true
|
|
||||||
case 0x09: // tab
|
case 0x09: // tab
|
||||||
if !overlay.Visible {
|
if !overlay.Visible {
|
||||||
shouldOverlayDraw = true
|
shouldOverlayDraw = true
|
||||||
|
|||||||
Reference in New Issue
Block a user