                             ;;'invisible t
 			                    'link-key link-key
 			                    'target-key target-key)))
-                    (write-view children (+ indent 4))))))
+                    (write-view children key-indent (+ tree-indent 4))))))
 
 
 ;; VIEWS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

                    ;;(tinkernotes-mode)
                    (erase-buffer)
                    (let ((view-json (json-read-from-string view)))
                        (write-view (cdr (assoc 'children view-json)) (longest-key view-json)))
                    (beginning-of-buffer)
                    (setq visible-cursor t)
                    ;; Try to move to the corresponding line in the previous view.

                        (if (> length max) (setq max length))))
                max)))

(defun write-view (children key-indent tree-indent)
    (loop for json across children do
    (let (
        (meta (eq t (cdr (assoc 'meta json))))
