public boolean isSelectedParagraph(int paragraph) {
		if (range == null) return false;

		try {
			int length = editor.getTextLength();
			int start = NumberUtil.intClamp(range.start(), 0, length - 1);
			int end = NumberUtil.intClamp(range.end(), 0, length - 1);

			// Check paragraph beyond start range.
			TwoDimensional.Position startPos = codeArea.offsetToPosition(start, TwoDimensional.Bias.Backward);
			int startParagraph = startPos.getMajor();
			if (paragraph < startParagraph) return false;

			// Check paragraph before end range.
			TwoDimensional.Position endPos = codeArea.offsetToPosition(end, TwoDimensional.Bias.Forward);
			int endParagraph = endPos.getMajor();
			return paragraph <= endParagraph;
		} catch (Exception ex) {
			// Some potential edge cases in 'offsetToPosition' we'll want to look out for.
			logger.error("Failed to map selected bracket range to paragraph for line {}", paragraph + 1, ex);
			return false;
		}
	}
@param paragraph
		Paragraph index, which is {@code line - 1}.

@return {@code true} when the line belongs to the {@link #getRange() selected bracket pair range}.
recaf-ui/src/main/java/software/coley/recaf/ui/control/richtext/bracket/SelectedBracketTracking.java