emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/code-cells 2dc51b44a3 12/36: Correct outline level befo


From: ELPA Syncer
Subject: [elpa] externals/code-cells 2dc51b44a3 12/36: Correct outline level before first cell header
Date: Mon, 28 Feb 2022 15:57:42 -0500 (EST)

branch: externals/code-cells
commit 2dc51b44a324e11f18dc566300a1493175055c79
Author: Augusto Stoffel <astoff@users.noreply.github.com>
Commit: Augusto Stoffel <astoff@users.noreply.github.com>

    Correct outline level before first cell header
---
 cells.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cells.el b/cells.el
index 69b47696cc..f7f1442b32 100644
--- a/cells.el
+++ b/cells.el
@@ -161,11 +161,13 @@ outline level as determined by the major mode and the 
current
 cell level."
   (let* ((at-boundary (looking-at-p (cells-boundary-regexp)))
          (mm-level (if at-boundary 0 (funcall (car cells--saved-vars))))
-         (cell-level (save-excursion
-                       (unless at-boundary (cells-backward-cell))
-                       (if (match-string 1)
-                           (- (match-end 1) (match-beginning 1))
-                         1))))
+         (cell-level (if (or at-boundary
+                             (save-excursion
+                               (re-search-backward (cells-boundary-regexp) nil 
t)))
+                         (if (match-string 1)
+                             (- (match-end 1) (match-beginning 1))
+                           1)
+                       0)))
     (+ cell-level mm-level)))
 
 (defface cells-header-line '((t :extend t :inherit header-line))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]