Function: majutsu-sparse--wash-list

majutsu-sparse--wash-list is a natively compiled function defined in majutsu-sparse.el.

Signature

(majutsu-sparse--wash-list ARGS)

Documentation

Wash jj sparse list output into sections.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-sparse.el
(defun majutsu-sparse--wash-list (_args)
  "Wash `jj sparse list' output into sections."
  (let ((count 0))
    (magit-wash-sequence
     (lambda ()
       (let* ((line (buffer-substring (line-beginning-position)
                                      (line-end-position)))
              (trimmed (string-trim (substring-no-properties line))))
         (delete-region (line-beginning-position)
                        (min (point-max) (1+ (line-end-position))))
         (unless (string-empty-p trimmed)
           (setq count (1+ count))
           (magit-insert-section (jj-sparse-pattern trimmed t)
             (insert (propertize trimmed 'font-lock-face 'magit-filename))
             (insert "\n")))
         t)))
    (if (zerop count)
        (progn
          (magit-cancel-section)
          (insert (propertize "No patterns (should not happen)\n"
                              'font-lock-face 'magit-dimmed)))
      (insert "\n"))))