add: } 
context: function restorePreSearchView(){  var selectedHdr = null;  //save selection  try   {    selectedHdr = gDBView.hdrForFirstSelectedMessage;  }  catch (ex)  {}  //we might have to sort the view coming out of quick search  var sortType = gDBView.sortType;  var sortOrder = gDBView.sortOrder;  var viewFlags = gDBView.viewFlags;  var folder = gDBView.msgFolder;  gDBView.close();  gDBView = null;   if (gPreQuickSearchView)  {    gDBView = gPreQuickSearchView;    if (gDBView.viewType == nsMsgViewType.eShowVirtualFolderResults)    {      // readd the view as a listener on the search results      var saveViewSearchListener = gDBView.QueryInterface(Components.interfaces.nsIMsgSearchNotify);      if (gSearchSession)        gSearchSession.registerListener(saveViewSearchListener);    }//    dump ("view type = " + gDBView.viewType + "\n");    if (sortType != gDBView.sortType || sortOrder != gDBView.sortOrder)    {      gDBView.sort(sortType, sortOrder);    }    UpdateSortIndicators(sortType, sortOrder);    gPreQuickSearchView = null;      }  else //create default view type    CreateDBView(folder, nsMsgViewType.eShowAllThreads, viewFlags, sortType, sortOrder);  RerootThreadPane();     var scrolled = false;    // now restore selection  if (selectedHdr)  {    gDBView.selectMsgByKey(selectedHdr.messageKey);    var treeView = gDBView.QueryInterface(Components.interfaces.nsITreeView);    var selectedIndex = treeView.selection.currentIndex;    if (selectedIndex >= 0)     {      // scroll      EnsureRowInThreadTreeIsVisible(selectedIndex);      scrolled = true;    }    else      ClearMessagePane();  }  if (!scrolled)    ScrollToMessageAfterFolderLoad(null);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/c8c08fb1c20003f6419d4155ccb67af07af985fe/searchBar.js/buggy/mail/base/content/searchBar.js