branch: externals/code-cells
commit 2dc51b44a324e11f18dc566300a1493175055c79
Author: Augusto Stoffel <[email protected]>
Commit: Augusto Stoffel <[email protected]>
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))