private ProgramLocation getProgramLocation(Navigatable navigatable) {

			//
			// The active component may still be showing the previously loaded function, instead
			// of the current location when that location is not in a function.  In that case,
			// when that provider is focused, prefer its notion of the current function so that
			// users navigating from that view will go to the function before the one that is
			// on the history stack.  This should feel more intuitive to the user, with the risk
			// that the navigation actions will sometimes feel inconsistent, depending upon
			// what view is focused.
			//
			DockingWindowManager dwm = DockingWindowManager.getActiveInstance();
			ComponentProvider activeProvider = dwm.getActiveComponentProvider();
			if (activeProvider instanceof Navigatable) {
				Navigatable activeNavigatable = (Navigatable) activeProvider;
				LocationMemento memento = activeNavigatable.getMemento();
				ProgramLocation location =
					validateProgramLocation(activeNavigatable, memento.getProgramLocation());
				if (location != null) {
					// prefer the active navigatable's location
					return location;
				}
			}

			ProgramLocation location = navigatable.getLocation();
			return validateProgramLocation(navigatable, location);
		}
Find the previous history LocationMemento that contains a different function. If no such
LocationMemento is found, null is returned.

@param navigatable the navigatable being navigated
@param moveTo true means after finding, get current location to it. false to just find
           and do nothing
@return previous LocationMemento, or null if no previous function found
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/navigation/NavigationHistoryPlugin.java