aboutsummaryrefslogtreecommitdiff
path: root/helpful.el
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2018-04-29 11:27:18 +0100
committerWilfred Hughes <me@wilfred.me.uk>2018-04-29 11:27:18 +0100
commitc87f865c7a3c15ed0c049099694ee6cc4643b684 (patch)
tree8e64f8e8e38a470c74d12ed50f4f10cf8483246e /helpful.el
parent46b662933b0b980c6b2b963e5827af807bada14d (diff)
When navigating to a reference, scroll to put it at the top
For big functions, the part of the code that actually has the reference might be later. By putting the function at the top, we maximise the chance that it's visible.
Diffstat (limited to 'helpful.el')
-rw-r--r--helpful.el1
1 files changed, 1 insertions, 0 deletions
diff --git a/helpful.el b/helpful.el
index 92a93e3..c82c3b1 100644
--- a/helpful.el
+++ b/helpful.el
@@ -1900,6 +1900,7 @@ imenu."
(> pos (point-max)))
(widen))
(goto-char pos)
+ (recenter 0)
(save-excursion
(let ((defun-end (scan-sexps (point) 1)))
(while (re-search-forward