@Override
	protected void decompilerActionPerformed(DecompilerActionContext context) {

		DecompilerPanel panel = context.getDecompilerPanel();
		TokenHighlights highlights = panel.getMiddleMouseHighlights();
		ClangToken cursorToken = context.getTokenAtCursor();
		TokenIterator it = new TokenIterator(cursorToken, true);
		it.next(); // ignore the current token

		if (goToNexToken(panel, it, highlights)) {
			return; // found another token in the current direction
		}

		// this means there are no more occurrences in the current direction; wrap the search
		ClangToken firstToken = getFirstToken(panel);
		it = new TokenIterator(firstToken, true);
		goToNexToken(panel, it, highlights);
	}
An action to navigate to the next token highlighted by the user via the middle-mouse.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/NextHighlightedTokenAction.java