@@ -41,6 +41,54 @@ CIDER releases).
41
41
(setq cider-prompt-for-symbol nil)
42
42
----
43
43
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
+
44
92
== Log nREPL Communications
45
93
46
94
If you want to see all communications between CIDER and the nREPL
0 commit comments