@Override
		public Highlight[] createHighlights(String text, ListingField field, int cursorTextOffset) {

			List<Highlight> list = new ArrayList<>();
			ListingHighlightProvider currentExternalHighligter = programHighlighterMap.get(program);
			if (currentExternalHighligter != null) {
				Highlight[] highlights =
					currentExternalHighligter.createHighlights(text, field, cursorTextOffset);
				for (Highlight highlight : highlights) {
					list.add(highlight);
				}
			}

			// always call the listing highlighter last so the middle-mouse highlight will always
			// be on top of other highlights
			Highlight[] highlights =
				listingHighlighter.createHighlights(text, field, cursorTextOffset);
			for (Highlight highlight : highlights) {
				list.add(highlight);
			}

			return list.toArray(new Highlight[list.size()]);
		}
A class that allows clients to install transient highlighters while keeping the middle-mouse
highlighting on at the same time.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeViewerProvider.java