aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/AppState.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-28 14:41:44 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-28 14:48:25 +0530
commitb8c389eac5f875fc7ae9a5ab9ac446d24a079448 (patch)
treea9875663f932f3a6952cd3e75dde57db264c70d1 /src/Chelleport/AppState.hs
parent397c0a613e66487fead7afb4b89b783d887389f3 (diff)
downloadchelleport-b8c389eac5f875fc7ae9a5ab9ac446d24a079448.tar.gz
chelleport-b8c389eac5f875fc7ae9a5ab9ac446d24a079448.zip
Fix issue with highlight index clamping
Diffstat (limited to '')
-rw-r--r--src/Chelleport/AppState.hs2
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