function displayMatches() {
  hide(textDiv);
  show(matchesList);
  matchesList.textContent = '';
  const filteredMatches = getFilteredMatches();
  if (filteredMatches.length > 0) {
    //
    // const exactPhrase = new RegExp(`\b${query}\b`, 'i');
    // keep exact matches only
    // matches = matches.filter(function(match) {
    //   return exactPhrase.test(match.doc.t);
    // });
    // // prefer exact matches — already done if SEARCH_OPTIONS expand is false
    // matches = matches.sort((a, b) => {
    // return exactPhrase.test(a.doc.t) ? -1 :
    //   exactPhrase.test(b.doc.t) ? 1 : 0;
    // });
    //
    for (const match of filteredMatches) {
      addMatch(match.doc);
    }
  } else {
    displayInfo('No matches :^\\');
    queryInfoElement.textContent = '';
  }
}
// Display a list of matched lines, stage directions and scene descriptions
Display a list of matched lines, stage directions and scene descriptions
Display a list of matched lines stage directions and scene descriptions
function displayMatches() {
  hide(textDiv);
  show(matchesList);
  matchesList.textContent = '';
  const filteredMatches = getFilteredMatches();
  if (filteredMatches.length > 0) {
     const exactPhrase = new RegExp(`\b${query}\b`, 'i');
     keep exact matches only
     matches = matches.filter(function(match) {
       return exactPhrase.test(match.doc.t);
     });
      prefer exact matches — already done if SEARCH_OPTIONS expand is false
     matches = matches.sort((a, b) => {
     return exactPhrase.test(a.doc.t) ? -1 :
       exactPhrase.test(b.doc.t) ? 1 : 0;
     });
    for (const match of filteredMatches) {
      addMatch(match.doc);
    }
  } else {
    displayInfo('No matches :^\\');
    queryInfoElement.textContent = '';
  }
}
function displayMatches ( ) { hide ( textDiv ) ; show ( matchesList ) ; matchesList . textContent = '' ; const filteredMatches = getFilteredMatches ( ) ; if ( filteredMatches . length > 0 ) { for ( const match of filteredMatches ) { addMatch ( match . doc ) ; } } else { displayInfo ( 'No matches :^\\' ) ; queryInfoElement . textContent = '' ; } }
Display a list of matched lines, stage directions and scene descriptions
Display a list of matched lines stage directions and scene descriptions
// // const exactPhrase = new RegExp(`\b${query}\b`, 'i'); // keep exact matches only // matches = matches.filter(function(match) { //   return exactPhrase.test(match.doc.t); // }); // // prefer exact matches — already done if SEARCH_OPTIONS expand is false // matches = matches.sort((a, b) => { // return exactPhrase.test(a.doc.t) ? -1 : //   exactPhrase.test(b.doc.t) ? 1 : 0; // }); //