Attach (recommended) or Link to PDF file here:
[NHA-20211231-A-018_before.pdf](https://github.com/mozilla/pdf.js/files/8055863/NHA-20211231-A-018_before.pdf)

Configuration:
- Web browser and its version: Firefox nightly
- Operating system and its version: Windows 11

Steps to reproduce the problem:
1. Search for "a"
2. Some highlighter results are wrong

![image](https://user-images.githubusercontent.com/5641725/153760070-61708a75-524c-4a21-bc1f-7745e9151b97.png)

After investigations some results are shifted because of a bug with "-\n".
ull;
      this._nextPageMatch();
    }
    
    const pageMatchesCount = this._pageMatches[pageIndex].length;
    if (pageMatchesCount > 0) {
      this._matchesCountTotal += pageMatchesCount;
      this._updateUIResultsCount();
    }
  }
  _extractText() {
    
    if (this._extractTextPromises.length > 0) {
      return;
    }
    let promise = Promise.resolve();
    for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
      const extractTextCapability = createPromiseCapability();
      this._extractTextPromises[i] = extractTextCapability.promise;
      promise = promise.then(() => {
        return this._pdfDocument
          .getPage(i + 1)
          .then(pdfPage => {
            return pdfPage.getTextContent();
          })
          .then(
            textContent => {
              const textItems = textContent.items;
              const strBuf = [];
              for (let j = 0, jj = textItems.length; j < jj; j++) {
                strBuf.push(textItems[j].str);
                if (textItems[j].hasEOL) {
                  strBuf.push("\n");
                }
              }
              
              [
                this._pageContents[i],
                this._pageDiffs[i],
                this._hasDiacritics[i],
              ] = normalize(strBuf.join(""));
              extractTextCapability.resolve(i);
            },
            reason => {
              console.error(
                `Unable to get text content for page ${i + 1}`,
                reason
              );
              
              this._pageContents[i] = "";
              this._pageDiffs[i] = null;
              this._hasDiacritics[i] = false;
              extractTextCapability.resolve(i);
            }
          );
      });
    }
  }
  _updatePage(index) {
    if (this._scrollMatches && this._selected.pageIdx === index) {
      
      
      
      this._linkService.page = index + 1;
    }
    this._eventBus.dispatch("updatetextlayermatches", {
      source: this,
  