-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a function to squash code-block's content.
- Loading branch information
1 parent
61c1c41
commit 6438d6d
Showing
2 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(uiop:define-package #:reblocks-text-editor/utils/common-doc | ||
(:use #:cl) | ||
(:export | ||
#:print-tree)) | ||
(in-package #:reblocks-text-editor/utils/common-doc) | ||
|
||
|
||
(defun print-tree (doc) | ||
"Prints CommonDoc nodes as a nested tree, to visualize document structure." | ||
(common-doc.ops:with-document-traversal (doc node depth) | ||
(loop repeat (1- depth) | ||
do (write-char #\Space) | ||
(write-char #\Space)) | ||
(format t "~A~%" node)) | ||
(values doc)) |