feat(fold): add +fold-ellipsis var

Bring *some* consistency to the text display when text is
ellided/folded.

Close: #7743
Co-authored-by: seanfarley <seanfarley@users.noreply.github.com>
This commit is contained in:
Henrik Lissner 2024-08-26 19:35:53 -04:00
parent 6077b6f0d8
commit 9a6bcc31f9
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 22 additions and 3 deletions

View file

@ -30,7 +30,8 @@
'empty-line
'vimish-fold-fringe))))
(overlay-put
ov 'display (propertize " [...] " 'face '+fold-hideshow-folded-face))))
ov 'display (propertize +fold-ellipsis
'face '+fold-hideshow-folded-face))))
;;

View file

@ -1,5 +1,17 @@
;;; editor/fold/config.el -*- lexical-binding: t; -*-
(defcustom +fold-ellipsis " [...] "
"The ellipsis to show for ellided regions (folds).
`org-ellipsis', `truncate-string-ellipsis', and `ts-fold-replacement' are set to
this."
:type 'string
:group '+fold)
;;
;;; Global config
(when (modulep! :editor evil)
;; Add vimish-fold, outline-mode & hideshow support to folding commands
(define-key! 'global
@ -18,9 +30,15 @@
"zd" #'vimish-fold-delete
"zE" #'vimish-fold-delete-all)))
(after! org
(setq org-ellipsis +fold-ellipsis))
(after! mule-util
(setq truncate-string-ellipsis +fold-ellipsis))
;;
;; Packages
;;; Packages
(use-package! hideshow ; built-in
:commands (hs-toggle-hiding
@ -97,5 +115,5 @@
:box nil
:inherit font-lock-comment-face
:weight light))
(setq ts-fold-replacement " [...] ")
(setq ts-fold-replacement +fold-ellipsis)
(global-ts-fold-mode +1))