mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
* lisp/progmodes/hideshow.el (hs-minor-mode): Show/hide margins.
Increment 'left-margin-width' when 'hs-indicator-type' is 'margin', and decrement it on disabling 'hs-minor-mode'.
This commit is contained in:
parent
56870c5f65
commit
06e9943412
1 changed files with 14 additions and 1 deletions
|
|
@ -1497,13 +1497,26 @@ Key bindings:
|
|||
(when (and (not (display-graphic-p))
|
||||
(eq hs-indicator-type 'fringe))
|
||||
(setq-local hs-indicator-type 'margin))
|
||||
(when (eq hs-indicator-type 'margin)
|
||||
(setq-local left-margin-width (1+ left-margin-width))
|
||||
(setq-local fringes-outside-margins t)
|
||||
;; Force display of margins
|
||||
(when (eq (current-buffer) (window-buffer))
|
||||
(set-window-buffer nil (window-buffer))))
|
||||
(jit-lock-register #'hs--add-indicators)))
|
||||
|
||||
(remove-from-invisibility-spec '(hs . t))
|
||||
(remove-overlays nil nil 'hs-indicator t)
|
||||
(remove-overlays nil nil 'invisible 'hs)
|
||||
(when hs-show-indicators
|
||||
(jit-lock-unregister #'hs--add-indicators))))
|
||||
(jit-lock-unregister #'hs--add-indicators)
|
||||
(when (and (eq hs-indicator-type 'margin)
|
||||
(< 0 left-margin-width))
|
||||
(setq-local left-margin-width (1- left-margin-width))
|
||||
(kill-local-variable 'fringes-outside-margins)
|
||||
;; Force removal of margins
|
||||
(when (eq (current-buffer) (window-buffer))
|
||||
(set-window-buffer nil (window-buffer)))))))
|
||||
|
||||
|
||||
;;;; that's it
|
||||
|
|
|
|||
Loading…
Reference in a new issue