Skip to content

Commit 1a26d7a

Browse files
committed
[Docs] Move a bit of configuration instructions around
1 parent 076497e commit 1a26d7a

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

doc/modules/ROOT/pages/config/basic_config.adoc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,54 @@ CIDER releases).
4141
(setq cider-prompt-for-symbol nil)
4242
----
4343

44+
== Control what window to use when jumping to a definition
45+
46+
By default kbd:[M-.] and other commands that jump to a definition have the following behaviour:
47+
48+
* If the definition buffer is visible simply switch to it.
49+
* Otherwise, use the current window to show the definition.
50+
51+
Other behaviour is possible, and is controlled with
52+
`cider-jump-to-pop-to-buffer-actions`; the value of this is passed as the
53+
`action` argument to `pop-to-buffer`.
54+
55+
The default value is `\((display-buffer-reuse-window display-buffer-same-window))`.
56+
57+
Some people might prefer to always display the definition in the current
58+
window. Here's how you can achieve this:
59+
60+
[source,lisp]
61+
----
62+
(setq cider-jump-to-pop-to-buffer-actions
63+
'((display-buffer-same-window)))
64+
----
65+
66+
WARNING: Keep in mind this might cause problems with some special buffers (e.g. test report buffers),
67+
as when you try to navigate to a definition this will clobber the special buffer.
68+
69+
For other possibilities, see the documentation for `display-buffer`.
70+
71+
=== Example 1
72+
73+
You jump to `map` in `core.clj` when `core.clj` *_is not_* being displayed in another
74+
window in the current frame.
75+
76+
With both the default behaviour and the alternative behaviour defined above, the
77+
definition of `map` will be shown in the current window.
78+
79+
=== Example 2
80+
81+
You jump to `map` in `core.clj` when `core.clj` *_is_* being displayed in another window
82+
in the current frame.
83+
84+
With the default behaviour, the definition of `map` will be shown in the current
85+
window; you will now have two windows showing `core.clj`, and the existing
86+
`core.clj` window will be unchanged.
87+
88+
With the alternative behaviour defined above, the definition of `map` will be
89+
shown in the existing `core.clj` window; all windows will show the same buffer as
90+
before the jump, and the current window will now be the one showing `core.clj`.
91+
4492
== Log nREPL Communications
4593

4694
If you want to see all communications between CIDER and the nREPL

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

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -277,51 +277,3 @@ can set:
277277
----
278278
(setq cider-repl-require-ns-on-set t)
279279
----
280-
281-
== Control what window to use when jumping to a definition
282-
283-
By default kbd:[M-.] and other commands that jump to a definition have the following behaviour:
284-
285-
* If the definition buffer is visible simply switch to it.
286-
* Otherwise, use the current window to show the definition.
287-
288-
Other behaviour is possible, and is controlled with
289-
`cider-jump-to-pop-to-buffer-actions`; the value of this is passed as the
290-
`action` argument to `pop-to-buffer`.
291-
292-
The default value is `\((display-buffer-reuse-window display-buffer-same-window))`.
293-
294-
Some people might prefer to always display the definition in the current
295-
window. Here's how you can achieve this:
296-
297-
[source,lisp]
298-
----
299-
(setq cider-jump-to-pop-to-buffer-actions
300-
'((display-buffer-same-window)))
301-
----
302-
303-
WARNING: Keep in mind this might cause problems with some special buffers (e.g. test report buffers),
304-
as when you try to navigate to a definition this will clobber the special buffer.
305-
306-
For other possibilities, see the documentation for `display-buffer`.
307-
308-
=== Example 1
309-
310-
You jump to `map` in core.clj when core.clj *_is not_* being displayed in another
311-
window in the current frame.
312-
313-
With both the default behaviour and the alternative behaviour defined above, the
314-
definition of `map` will be shown in the current window.
315-
316-
=== Example 2
317-
318-
You jump to `map` in core.clj when core.clj *_is_* being displayed in another window
319-
in the current frame.
320-
321-
With the default behaviour, the definition of `map` will be shown in the current
322-
window; you will now have two windows showing core.clj, and the existing
323-
core.clj window will be unchanged.
324-
325-
With the alternative behaviour defined above, the definition of `map` will be
326-
shown in the existing core.clj window; all windows will show the same buffer as
327-
before the jump, and the current window will now be the one showing core.clj.

0 commit comments

Comments
 (0)