Elisp function to hide unittest in dlang


Here is a small snippet for emacs hide-show mode that quickly folds all unittest blocks.

(defun my-d-mode-hide-unittest()
    "Hides unittest blocks"
    (interactive)
    (save-excursion
      (beginning-of-buffer)
      (while (search-forward "unittest" nil t)
        (progn
          (search-forward "{")
          (hs-hide-block)))))

Leave a Reply

Your email address will not be published.