From 9698c4f1d858d7669484c0d3ca76a5c2b2ef2b79 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sun, 3 Nov 2024 15:04:57 -0500 Subject: [PATCH] Fixed error in calculating word boundary (off-by-one) --- misc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.go b/misc.go index bf6304e..3f3ff02 100644 --- a/misc.go +++ b/misc.go @@ -25,7 +25,7 @@ func dotChars() []rune { // Returns all possible characters represented by the d func isWordBoundary(str string, idx int) bool { str_runes := []rune(str) wbounded := idx == 0 || - idx >= len(str)-1 || + idx >= len(str) || (!slices.Contains(wordChars, str_runes[idx-1]) && slices.Contains(wordChars, str_runes[idx])) || (slices.Contains(wordChars, str_runes[idx-1]) && !slices.Contains(wordChars, str_runes[idx])) return wbounded