Skip to content

display-line-numbers-mode reactivated in pdf-view-mode when previewing (consult-buffer) #853

Closed Answered by maxecharel
maxecharel asked this question in Q&A
Discussion options

You must be logged in to vote

@minad good idea, I've looked further into it. At the minor price of redefining a function of display-line-numbers.el used in the definition of the globalized minor mode , the following completely solves the 'issue':

  (require 'display-line-numbers)
  (defun display-line-numbers--turn-on ()
    "Turn on `display-line-numbers-mode'."
    (unless (or (minibufferp) (eq major-mode 'pdf-view-mode))
      (display-line-numbers-mode)))

Now one can simply set (global-display-line-numbers-mode 1) and the original issue is solved while still having line numbers in the preview of non-PDF files.

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@maxecharel
Comment options

Comment options

You must be logged in to vote
1 reply
@minad
Comment options

Comment options

You must be logged in to vote
3 replies
@maxecharel
Comment options

@maxecharel
Comment options

@minad
Comment options

minad Oct 1, 2023
Maintainer

Answer selected by maxecharel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #852 on September 30, 2023 12:25.