c1344ba327a9e1acaf267653730de9f532087c5e
angie
  Fri Apr 4 12:31:55 2014 -0700
When we have multiple position matches, restore lastPosition(or defaultPosition).
fixes #13009

diff --git src/hg/hgTables/hgTables.c src/hg/hgTables/hgTables.c
index e52ff39..d0f71a9 100644
--- src/hg/hgTables/hgTables.c
+++ src/hg/hgTables/hgTables.c
@@ -419,30 +419,42 @@
 else
     return FALSE;
 }
 
 boolean lookupPosition()
 /* Look up position (aka range) if need be.  Return FALSE if it puts
  * up multiple positions. */
 {
 char *range = cartUsualString(cart, hgtaRange, "");
 boolean isSingle = TRUE;
 range = trimSpaces(range);
 if (range[0] != 0)
     {
     struct region r;
     isSingle = searchPosition(range, &r);
+    if (!isSingle)
+	{
+	// We will call doMainPage after this, so push web start handlers;
+	// hgFind code pops the handlers that it pushes, but after doMainPage
+	// we'll close the page and pop again, so we need to push here.
+	webPushErrHandlersCartDb(cart, database);
+	// In case user manually edits the browser location as described in #13009,
+	// revert the position.  If they instead choose from the list as we expect,
+	// that will set the position to their choice.
+	char *lastPosition = cartUsualString(cart, "lastPosition", hDefaultPos(database));
+	cartSetString(cart, "position", lastPosition);
+	}
     }
 else
     {
     cartSetString(cart, hgtaRange, hDefaultPos(database));
     }
 return isSingle;
 }
 
 struct region *getRegions()
 /* Consult cart to get list of regions to work on. */
 {
 char *regionType = cartUsualString(cart, hgtaRegionType, "genome");
 struct region *regionList = NULL, *region;
 if (sameString(regionType, hgtaRegionTypeGenome))
     {