Skip to content

Commit

Permalink
修复 repl 无法清除历史
Browse files Browse the repository at this point in the history
  • Loading branch information
lollipopkit committed May 19, 2023
1 parent b3996e1 commit 4630434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ builds:
- linux
- windows
- darwin
goarch:
- amd64
- arm
- arm64
ignore:
- goos: windows
goarch: arm
Expand Down
6 changes: 3 additions & 3 deletions repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
var (
linesHistory = []string{}
helpMsgs = []string{
"`esc`: Exit REPL",
"`Esc`: Exit REPL",
"`Tab`: Add 2 spaces",
"",
"`Ctrl + b`: Wrap current line with `print()`",
"`Ctrl + n`: Wrap current line with `printf()`",
"`Ctrl + m`: Clear REPL history",
"`Ctrl + a`: Clear REPL history",
"",
"`reset()`: Reset REPL state",
}
Expand Down Expand Up @@ -108,7 +108,7 @@ func handleKeyboard(key keys.Key, rs *[]rune, rIdx *int, lIdx *int) (bool, bool,
return false, true, nil
case keys.Esc:
os.Exit(0)
case keys.CtrlM:
case keys.CtrlA:
linesHistory = []string{}
writeHistory()
}
Expand Down

0 comments on commit 4630434

Please sign in to comment.