-- | Select next @n@ paragraphs
selectNParagraphs :: Int -> BufferM ()
selectNParagraphs n = do
  getVisibleSelection >>= \case
    True -> exchangePointAndMarkB
            >> nextNParagraphs n >> (setVisibleSelection True)
            >> exchangePointAndMarkB
    False -> nextNParagraphs n >> (setVisibleSelection True)
             >> pointB >>= setSelectionMarkPointB >> prevNParagraphs n

-- ! Examples:
-- @goUnmatchedB Backward '(' ')'@
-- Move to the previous unmatched '('
-- @goUnmatchedB Forward '{' '}'@
-- Move to the next unmatched '}'
selectNParagraphs :: Int -> BufferM ()
selectNParagraphs n = do
  getVisibleSelection >>= \case
    True -> exchangePointAndMarkB
            >> nextNParagraphs n >> (setVisibleSelection True)
            >> exchangePointAndMarkB
    False -> nextNParagraphs n >> (setVisibleSelection True)
             >> pointB >>= setSelectionMarkPointB >> prevNParagraphs n

-- ! Examples:
-- @goUnmatchedB Backward '(' ')'@
-- Move to the previous unmatched '('
-- @goUnmatchedB Forward '{' '}'@
-- Move to the next unmatched '}'
selectNParagraphs n = do
  getVisibleSelection >>= \case
    True -> exchangePointAndMarkB
            >> nextNParagraphs n >> (setVisibleSelection True)
            >> exchangePointAndMarkB
    False -> nextNParagraphs n >> (setVisibleSelection True)
             >> pointB >>= setSelectionMarkPointB >> prevNParagraphs n

-- ! Examples:
-- @goUnmatchedB Backward '(' ')'@
-- Move to the previous unmatched '('
-- @goUnmatchedB Forward '{' '}'@
-- Move to the next unmatched '}'