Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: infinite loop when navigating history without any history #268

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ completed.
navigation of neighboring doc files.

### Fixed
- Return the prefix when calling `hilbish.completions.call`

[#219]: https://github.com/Rosettea/Hilbish/issues/219
### Fixed
- Fix infinite loop when navigating history without any history. [#252](https://github.com/Rosettea/Hilbish/issues/252)
- Return the prefix when calling `hilbish.completions.call`. [#219](https://github.com/Rosettea/Hilbish/issues/219)
- Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils

## [2.1.2] - 2022-04-10
Expand Down
4 changes: 2 additions & 2 deletions readline/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ func (rl *Instance) walkHistory(i int) {
rl.updateHelpers()

// In order to avoid having to type j/k twice each time for history navigation,
// we walk once again. This only ever happens when we aren't out of bounds.
if dedup && old == new {
// we walk once again. This only ever happens when we aren't out of bounds and the last history item was not a empty string.
if new != "" && dedup && old == new {
rl.walkHistory(i)
}
}
Expand Down