branch: master commit 9d1ecf961dd964cbe8ea183eac23572bb4f8f4ee Author: Robbert van der Helm <m...@robbertvanderhelm.nl> Commit: Leo Liu <sdl....@gmail.com>
Consider `ggtags-sort-by-nearness` in `ggtags-show-definition` `ggtags-show-definition` and `ggtags-find-definition` were showing different results as `ggtags-show-definition` was always sorted alphabetically. This also causes the eldoc prompt to show the wrong definition. --- ggtags.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ggtags.el b/ggtags.el index b3ab1f6..73d8f46 100644 --- a/ggtags.el +++ b/ggtags.el @@ -2077,6 +2077,7 @@ When finished invoke CALLBACK in BUFFER with process exit status." (let* ((re (cadr (assq 'grep ggtags-global-error-regexp-alist-alist))) (current (current-buffer)) (buffer (get-buffer-create " *ggtags-definition*")) + (args (list "--result=grep" "--path-style=absolute" name)) ;; Need these bindings so that let-binding ;; `ggtags-print-definition-function' can work see ;; `ggtags-eldoc-function'. @@ -2096,8 +2097,8 @@ When finished invoke CALLBACK in BUFFER with process exit status." (ggtags-with-current-project (ggtags-global-output buffer - (list (ggtags-program-path "global") - "--result=grep" "--path-style=absolute" name) + (cons (ggtags-program-path "global") + (if (ggtags-sort-by-nearness-p) (cons "--nearness" args) args)) show 100)))) (defvar ggtags-mode-prefix-map