@Override
	public Highlight[] createHighlights(String text, ListingField field, int cursorTextOffset) {
		if (!options.isShowHighlights()) {
			return NO_HIGHLIGHTS;
		}

		if (program != navigatable.getProgram()) {
			return NO_HIGHLIGHTS;
		}

		Class<? extends FieldFactory> fieldFactoryClass = field.getFieldFactory().getClass();
		if (fieldFactoryClass != BytesFieldFactory.class) {
			return NO_HIGHLIGHTS;
		}

		ProxyObj<?> proxy = field.getProxy();
		Object obj = proxy.getObject();
		if (!(obj instanceof CodeUnit cu)) {
			return NO_HIGHLIGHTS;
		}

		Address minAddr = cu.getMinAddress();
		Address maxAddr = cu.getMaxAddress();
		List<MemoryMatch> results = getMatchesInRange(minAddr, maxAddr);
		if (results.isEmpty()) {
			return NO_HIGHLIGHTS;
		}

		return getHighlights(text, minAddr, results);
	}
Listing highlight provider to highlight memory search results.
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/gui/MemoryMatchHighlighter.java