markWord :: BufferM ()
markWord = do
    curPos <- pointB
    curMark <- getSelectionMarkPointB
    isVisible <- getVisibleSelection

    savingPointB $ do
        if not isVisible
        then nextWordB
        else do
            moveTo curMark
            if curMark < curPos
            then prevWordB
            else nextWordB

        setVisibleSelection True
        pointB >>= setSelectionMarkPointB
markWord :: BufferM ()
markWord = do
    curPos <- pointB
    curMark <- getSelectionMarkPointB
    isVisible <- getVisibleSelection

    savingPointB $ do
        if not isVisible
        then nextWordB
        else do
            moveTo curMark
            if curMark < curPos
            then prevWordB
            else nextWordB

        setVisibleSelection True
        pointB >>= setSelectionMarkPointB
markWord = do
    curPos <- pointB
    curMark <- getSelectionMarkPointB
    isVisible <- getVisibleSelection

    savingPointB $ do
        if not isVisible
        then nextWordB
        else do
            moveTo curMark
            if curMark < curPos
            then prevWordB
            else nextWordB

        setVisibleSelection True
        pointB >>= setSelectionMarkPointB