Skip to content

Commit fd6d514

Browse files
committed
[Docs] Add some explanations for the font-locking of results in the REPL
1 parent c6634e1 commit fd6d514

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

doc/modules/ROOT/pages/repl/configuration.adoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ You can customize the buffer name using the variable
125125
`cider-session-name-template`. See the documentation for this variable for
126126
details.
127127

128-
129128
== Font-locking
130129

131130
Normally, code in the REPL is font-locked the same way as in
@@ -140,7 +139,22 @@ use:
140139
(setq cider-repl-use-clojure-font-lock nil)
141140
----
142141

143-
Note that enabling font-locking in the REPL can negatively impact performance.
142+
NOTE: Using Clojure font-locking in the REPL can impact performance negatively, especially
143+
when it comes to font-locking huge results. That, however, is mitigated to a big extent
144+
by result streaming.
145+
146+
=== Font-locking of Results
147+
148+
There are a few things you need to keep in mind about Clojure font-locking of results:
149+
150+
* When streaming is enabled only single-chunk results will be font-locked as Clojure, as
151+
each chunk is font-locked by itself and the results can't really be combined
152+
* The font-locking of results is an expensive operation which involves copying the value
153+
to a temporary buffer, where we check its integrity and do the actual font-locking.
154+
155+
TIP: If you'd like to learn more about the font-locking of results you can check
156+
out the definition of `clojure-font-lock-as` and `clojure-font-lock-as-clojure`
157+
in `cider-util.el`.
144158

145159
== Pretty printing in the REPL
146160

0 commit comments

Comments
 (0)