protected boolean complete(@Nonnull String partialText, @Nonnull String fullText) {
		// Skip if the partial text (the current line) does not represent a substring of the text to complete (the full text)
		if (!fullText.startsWith(partialText)) {
			// If the current partial text has separators, check if the full text completion
			// begins at a point AFTER the separator.
			int space = partialText.indexOf(' ');
			if (space >= 0)
				return complete(partialText.substring(space + 1), fullText);
			int dot = partialText.indexOf('.');
			if (dot >= 0)
				return complete(partialText.substring(dot + 1), fullText);

			// If the partial text has no separators, check if the full text completion  has separators.
			// If it does, then we'll try to complete a substring of the original completion starting at the separator.
			space = fullText.indexOf(' ');
			if (space >= 0)
				return complete(partialText, fullText.substring(space + 1));
			dot = fullText.indexOf('.');
			if (dot >= 0)
				return complete(partialText, fullText.substring(dot + 1));

			// No sub-sequence of the existing partial text and the text to complete matches.
			return false;
		}

		// Insert the rest of the text.
		String remainingWordText = fullText.substring(partialText.length());
		area.insertText(area.getCaretPosition(), remainingWordText);

		// Show completion centered on the screen if it is off-screen.
		if (area.getCaretBounds().isEmpty())
			area.showParagraphAtCenter(area.getCurrentParagraph());

		return true;
	}
Completes the current text with the value of {@link #getSelected()}.

@param partialText
		Current text to complete.

@return {@code true} on successful completion.
recaf-ui/src/main/java/software/coley/recaf/ui/control/richtext/suggest/CompletionPopup.java