Skip to content

evil interfering with PDF text selection/highlighting in pdf-view #6286

@workcomplete

Description

@workcomplete

What did you expect to happen?

When I click and drag the mouse over text in a PDF, text should become highlighted. I should be able to do this consecutively (i.e. I can select text in one region, perform some action like annotation [or perform no action], and then select text in another region).

What actually happened?

After selecting some text on a PDF page, when I click and drag the mouse over some other text on the same page nothing happens unless I click somewhere in the PDF a second time in between each highlight (i.e. I cannot perform consecutive text selection with the mouse, unless I click somewhere in the pdf between each text selection).

I am not referring to having multiple regions highlighted or extending the original selection (simultaneous text selection) but rather being able to select different regions of text consecutively, without needing to take some action in-between each text selection.

Describe your attempts to resolve the issue

After selecting some text, I checked the keybinding for <mouse-1> within the PDF, and it is bound to (evil-mouse-drag-region START-EVENT). So, the above issue can be fixed by interactively disabling evil-mode by any of the following methods: toggling evil-local-mode, C-z or calling turn-off-evil-mode. Using any one of these I am able to make consecutive text selection without needing to click the PDF in between dragging my cursor over some region.

I also cannot disable evil-mode for pdf-view in my config. I have tried:

(set-evil-initial-state! 'pdf-view-mode 'emacs)
(add-to-list '+evil-collection-disabled-list 'pdf-view-mode)
(add-to-list '+evil-collection-disabled-list 'pdf-view)

I have also tried using pdf-view-mode-hook with the above interactive commands evil-local-mode and turn-off-evil-mode but it is my understanding that this is not the correct way to deactivate evil mode anyways.

Steps to reproduce

  1. Open Emacs
  2. Open PDF using pdf-view
  3. Click and drag mouse over some text on the PDF to select some text
  4. Move mouse to another text region on the same PDF page and drag mouse over some text
  5. Disable evil mode using turn-off-evil-mode or evil-local-mode or C-z
  6. Repeat steps 3 and 4.

System Information

https://pastebin.com/8EyruYQy

Metadata

Metadata

Assignees

No one assigned

    Labels

    is:upstreamOriginates from outside the project and cannot be fully addressed heremodule:editor/evilPertains to Doom's :editor evil module

    Type

    No type

    Projects

    Status

    Resolved

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions