view/utils: Hide "cut here" lines.
authorRicardo Wurmus <rekado@elephly.net>
Wed, 13 May 2020 06:16:30 +0000 (08:16 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Wed, 13 May 2020 06:16:30 +0000 (08:16 +0200)
mumi/web/view/utils.scm

index 36950453a9612700d85527407d7cb418c3b78337..f863528d592a70220099d04bc2b315cb06b49fc3 100644 (file)
@@ -62,11 +62,12 @@ with the next context."
                      other-blocks)
                context))
       ((eq? context 'snippet)
-       (values (cons (add-block-line! block
-                                      `(span (@ (class "line")) ,line))
-                     other-blocks)
-               (if (string-prefix? "--8<---------------cut here" line)
-                   #f context)))
+       (if (string-prefix? "--8<---------------cut here" line)
+           (values blocks #f)
+           (values (cons (add-block-line! block
+                                          `(span (@ (class "line")) ,line))
+                         other-blocks)
+                   context)))
       ((eq? context 'diff)
        (if (string= "--" line)
            ;; Retry
@@ -122,6 +123,8 @@ with the next context."
                 `(span (@ (class "line commit changelog")) ,line))
                ((string-prefix? "diff --git" line)
                 `(span (@ (class "line diff file")) ,line))
+               ((string-prefix? "--8<---------------cut here" line)
+                "")
                (else
                 `(span (@ (class "line")) ,line)))))
          (if (eq? new-context context)