pdf-tools icon indicating copy to clipboard operation
pdf-tools copied to clipboard

Arco-Linux: No word highlight after first search

Open ghost opened this issue 3 years ago • 7 comments
trafficstars

How to reproduce

  • Search for a specific word using "I-search:{word}" (by pressing /)

  • Press "n" to search for next instance of {word}

  • Page appears but no word is highlighted

  • Sometimes a word might appear 2-3 times in the same page, without highighting given word there is no way to see where it's mentioned, nor if the pdf-tools is searching/loading for the next instance in another page or if it's mentioned again in the same page.

My system:

  • Arch Linux with Doom Emacs(GNU Emacs 28.2)

ghost avatar Oct 14 '22 07:10 ghost

Hi @ThanosApollo ,

I cannot reproduce this. I do not use Doom Emacs, so I don't know if it is a problem with their configuration. Can you try to reproduce the problem in vanilla Emacs with just pdf-tools installed?

vedang avatar Oct 16 '22 06:10 vedang

Using pdf-tools in a new emacs install in a vm(Arco-Linux, Emacs 28.2), first isearch-forward will be highlighted, afterwards using isearch-repeat-forward results are not highlighted

ghost avatar Oct 24 '22 14:10 ghost

I can verify this issue. Highlights only work during typing of the search term but not when calling isearch-repeat-forward afterwards. It makes isearch functionality pretty much useless.

Emacs 28.2. Arch Linux.

@vedang Typo in the title - Arco -> Arch

igordejanovic avatar Jun 26 '23 09:06 igordejanovic

As a temporary workaround pdf-occur feature properly highlights the searched term.

igordejanovic avatar Jun 26 '23 09:06 igordejanovic

Investigating it, seems like it is caused by the check

(or isearch-mode occur-hack-p)

in the binding for pdf-info-asynchronous in pdf-isearch-hl-matches.

Changing that line to

(or isearch-mode occur-hack-p
    (memq last-command '(isearch-repeat-forward isearch-repeat-backward)))

fixes the issue for me.

aikrahguzar avatar Jun 28 '23 16:06 aikrahguzar

Thanks @aikrahguzar. It works for me too.

igordejanovic avatar Jun 28 '23 18:06 igordejanovic