Skip to content

Commit f52f25e

Browse files
authored
Fix src block cache (#598)
* Fixup for `Refactor source block caching` f2092cc renamed these methods but missed their use in this test. * Fix source block caching. The extra `list` is inconsistent with the expected cache structure. The rest of this function assumes a single-depth list.
1 parent 3615c2d commit f52f25e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

jupyter-org-client.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,11 @@ source block, return non-nil. Otherwise, when `point' is not
618618
inside a Jupyter src-block, return nil."
619619
(unless jupyter-org--src-block-cache
620620
(setq jupyter-org--src-block-cache
621-
(list (list 'invalid nil (make-marker)
622-
(let ((end (make-marker)))
623-
;; Move the end marker when text is inserted
624-
(set-marker-insertion-type end t)
625-
end)))))
621+
(list 'invalid nil (make-marker)
622+
(let ((end (make-marker)))
623+
;; Move the end marker when text is inserted
624+
(set-marker-insertion-type end t)
625+
end))))
626626
(if (org-in-src-block-p 'inside)
627627
(or (jupyter-org--at-cached-src-block-p)
628628
(when-let* ((el (org-element-at-point))

test/jupyter-test.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,10 +2170,10 @@ Image(filename='%s', width=300)" file)
21702170
(forward-line)
21712171
(end-of-line)
21722172
(should-not jupyter-org--src-block-cache)
2173-
(should-not (jupyter-org--same-src-block-p))
2174-
(jupyter-org--set-current-src-block)
2173+
(should-not (jupyter-org--at-cached-src-block-p))
2174+
(jupyter-org--set-src-block-cache)
21752175
(should jupyter-org--src-block-cache)
2176-
(should (jupyter-org--same-src-block-p))
2176+
(should (jupyter-org--at-cached-src-block-p))
21772177
(cl-destructuring-bind (params beg end)
21782178
jupyter-org--src-block-cache
21792179
(should (equal (alist-get :session params) jupyter-org-test-session))

0 commit comments

Comments
 (0)