fix(docs): don't hide # lines in src blocks
This would hide shebang lines and comments in languages that use # as a line comment delimiter.
This commit is contained in:
parent
c8099a89ad
commit
451933b2ba
1 changed files with 15 additions and 14 deletions
|
@ -148,20 +148,21 @@
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(let ((case-fold-search t))
|
(let ((case-fold-search t))
|
||||||
(while (re-search-forward "^[ \t]*\\#" nil t)
|
(while (re-search-forward "^[ \t]*\\#" nil t)
|
||||||
(catch 'abort
|
(unless (org-in-src-block-p t)
|
||||||
(org-fold-core-region
|
(catch 'abort
|
||||||
(line-beginning-position)
|
(org-fold-core-region
|
||||||
(cond ((looking-at "+\\(?:title\\|subtitle\\): +")
|
(line-beginning-position)
|
||||||
(match-end 0))
|
(cond ((looking-at "+\\(?:title\\|subtitle\\): +")
|
||||||
((looking-at "+\\(?:created\\|since\\|author\\|email\\|date\\): +")
|
(match-end 0))
|
||||||
(throw 'abort nil))
|
((looking-at "+\\(?:created\\|since\\|author\\|email\\|date\\): +")
|
||||||
((or (eq (char-after) ?\s)
|
(throw 'abort nil))
|
||||||
(looking-at "+\\(begin\\|end\\)_comment"))
|
((or (eq (char-after) ?\s)
|
||||||
(line-beginning-position 2))
|
(looking-at "+\\(begin\\|end\\)_comment"))
|
||||||
((looking-at "+\\(?:begin\\|end\\)_\\([^ \n]+\\)")
|
(line-beginning-position 2))
|
||||||
(line-end-position))
|
((looking-at "+\\(?:begin\\|end\\)_\\([^ \n]+\\)")
|
||||||
((line-beginning-position 2)))
|
(line-end-position))
|
||||||
doom-docs-mode 'doom-doc-hidden)))))))
|
((line-beginning-position 2)))
|
||||||
|
doom-docs-mode 'doom-doc-hidden))))))))
|
||||||
|
|
||||||
(defun doom-docs--hide-drawers-h ()
|
(defun doom-docs--hide-drawers-h ()
|
||||||
"Hide all property drawers."
|
"Hide all property drawers."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue