diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-12-28 14:41:44 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-12-28 14:48:25 +0530 |
| commit | b8c389eac5f875fc7ae9a5ab9ac446d24a079448 (patch) | |
| tree | a9875663f932f3a6952cd3e75dde57db264c70d1 /src | |
| parent | 397c0a613e66487fead7afb4b89b783d887389f3 (diff) | |
| download | chelleport-b8c389eac5f875fc7ae9a5ab9ac446d24a079448.tar.gz chelleport-b8c389eac5f875fc7ae9a5ab9ac446d24a079448.zip | |
Fix issue with highlight index clamping
Diffstat (limited to 'src')
| -rw-r--r-- | src/Chelleport/AppState.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Chelleport/AppState.hs b/src/Chelleport/AppState.hs index 6c2de9c..4c8e0a8 100644 --- a/src/Chelleport/AppState.hs +++ b/src/Chelleport/AppState.hs @@ -77,7 +77,7 @@ update _ state (IncrementHighlightIndex n) = do action <- traverse (fmap MoveMousePosition . wordPosition) highlightedWord pure (state {stateRepetition = 1, stateMode = mode {searchHighlightedIndex = highlightedIndexClamped}}, action) where - highlightedWord = searchFilteredWords mode `itemAt` highlightedIndex + highlightedWord = searchFilteredWords mode `itemAt` highlightedIndexClamped highlightedIndex = searchHighlightedIndex mode + n highlightedIndexClamped = if highlightedIndex < 0 |
