Skip to content

Indent bars in popup window #73

@SteepturN

Description

@SteepturN

Vertical bars appear in popup window when cursor is aligned vertically with the highlighted sections, if I disable the mode, they disappear.

Screenshot from 2024-10-03 01-06-40
Screenshot from 2024-10-03 01-06-50
Screenshot from 2024-10-03 01-07-34
Screenshot from 2024-10-03 01-08-04

Adding slightly changed code from https://stackoverflow.com/a/27960576/17344383 seems to solve the issue:

(defun my:force-modes (rule-mode &rest modes)
  "switch on/off several modes depending of state of
    the controlling minor mode
  "
  (let ((rule-state (if rule-mode 1 -1)
       ))
    (mapcar (lambda (k) (funcall k rule-state)) modes)
  )
)



(defvar my:prev-indent-bars-mode nil)
(make-variable-buffer-local 'my:prev-indent-bars-mode)
(defvar my:prev-indent-bars-pushed nil)
(make-variable-buffer-local 'my:prev-indent-bars-pushed)

(defun my:push-indent-bars (&rest skip)
  (if my:prev-indent-bars-pushed () (progn
    (setq my:prev-indent-bars-mode indent-bars-mode)
    (setq my:prev-indent-bars-pushed t)
    (my:force-modes nil 'indent-bars-mode)
  ))
)

(defun my:pop-indent-bars (&rest skip)
  (if my:prev-indent-bars-pushed (progn
    (setq my:prev-indent-bars-pushed nil)
    (my:force-modes my:prev-indent-bars-mode 'indent-bars-mode)
  ))
)
(setq indent-bars-no-stipple-char-font-weight)
(advice-add 'popup-draw :before #'my:push-indent-bars)
(advice-add 'popup-delete :after #'my:pop-indent-bars)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions