searchWordE :: Bool -> Direction -> EditorM ()
searchWordE wholeWord dir = do
  word <- withCurrentBuffer readCurrentWordB

  let search re = do
        setRegexE re
        searchDirectionA .= dir
        withCount $ continueSearching (const dir)

  if wholeWord
  then case makeSearchOptsM [] $ "\\<" <> R.toString word <> "\\>" of
          Right re -> search re
          Left _ -> return ()
  else search $ makeSimpleSearch word
searchWordE :: Bool -> Direction -> EditorM ()
searchWordE wholeWord dir = do
  word <- withCurrentBuffer readCurrentWordB

  let search re = do
        setRegexE re
        searchDirectionA .= dir
        withCount $ continueSearching (const dir)

  if wholeWord
  then case makeSearchOptsM [] $ "\\<" <> R.toString word <> "\\>" of
          Right re -> search re
          Left _ -> return ()
  else search $ makeSimpleSearch word
searchWordE wholeWord dir = do
  word <- withCurrentBuffer readCurrentWordB

  let search re = do
        setRegexE re
        searchDirectionA .= dir
        withCount $ continueSearching (const dir)

  if wholeWord
  then case makeSearchOptsM [] $ "\\<" <> R.toString word <> "\\>" of
          Right re -> search re
          Left _ -> return ()
  else search $ makeSimpleSearch word