Skip to content

Commit

Permalink
Experiment with sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescherti committed Feb 15, 2025
1 parent 92c2554 commit ef008bb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion outline-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,28 @@ It is recommended to keep this set to t for improved behavior."

;;; Functions

(defvar outline-custom-levels '((1 . 2)))
(defvar outline-custom-headers nil)
(setq outline-custom-headers
'(("^###" . 1)))

(defun outline-indent--custom-headers-level (line)
"Get the level of the custom header in the LINE.
LINE represents a line of text."
(assoc-default line outline-custom-headers 'string-match))

(defun outline-indent-level ()
"Determine the outline level based on the current indentation."
(+ 1 (/ (current-indentation) (max outline-indent-default-offset 1))))
(let* ((line (thing-at-point 'line t))
(level (or (assoc-default line outline-custom-headers 'string-match)
(+ 1
(/ (current-indentation)
(max outline-indent-default-offset 1))))))
level))

;; (defun outline-indent-level ()
;; "Determine the outline level based on the current indentation."
;; (+ 1 (/ (current-indentation) (max outline-indent-default-offset 1))))

(defun outline-indent--update-ellipsis ()
"Update the buffer's outline ellipsis."
Expand Down

0 comments on commit ef008bb

Please sign in to comment.