Skip to content

Commit 54d1d06

Browse files
committed
Support '/' key for the package search feature
1 parent 59334db commit 54d1d06

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Preferably, [go install](https://golang.org/cmd/go/#hdr-Compile_and_install_pack
8888
| `i` | install package |
8989
| `u/ctrl-u` | upgrade package/with input |
9090
| `r/ctrl-r` | remove package/with input |
91-
| `s` | search package |
91+
| `s,/` | search package |
9292
| `g` | go to package (index) |
9393
| `y` | confirm and execute the selected command |
9494
| `p` | copy selected package |

src/pkgtop.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var (
7676
" i : Install package\n" +
7777
" u/ctrl-u : Upgrade package/with input\n" +
7878
" r/ctrl-r : Remove package/with input\n" +
79-
" s : Search package\n" +
79+
" s,/ : Search package\n" +
8080
" g : Go to package (index)\n" +
8181
" y : Confirm and execute the selected command\n" +
8282
" p : Copy selected package name/information\n" +
@@ -560,11 +560,11 @@ OSCheckLoop:
560560
ui.Render(pkgGrid, cmdList)
561561
scrollLists(lists, pkgIndex, -1, false)
562562
/* Search, install, upgrade or go-to package. */
563-
case "s", "i", "<c-u>", "g", "<c-r>":
563+
case "s", "i", "<c-u>", "g", "<c-r>", "/":
564564
/* Allow changing mode if not showing any package information. */
565565
if !showInfo {
566566
/* Set variables for switching the mode. */
567-
pressedKey := str.NewReplacer("<c-", "", ">", "").
567+
pressedKey := str.NewReplacer("<c-", "", ">", "", "/", "s").
568568
Replace(str.ToLower(e.ID))
569569
inputQuery = ""
570570
for i, v := range pkgModes {

0 commit comments

Comments
 (0)