leoliu / ggtags

Emacs frontend to GNU Global source code tagging system.
http://elpa.gnu.org
577 stars 56 forks source link

Fix #218: make `xref-find-definitions' work correctly in symlinks #219

Closed tttuuu888 closed 2 years ago

tttuuu888 commented 2 years ago

This pull request is to fix #218 . I tested it on example project on #218 and this worked fine. I hope this is helpful. Thanks.

leoliu commented 2 years ago

@tttuuu888 Thanks a lot for the bug report and fix ;)

file-truename is costlier than expand-file-name. Can the following change fix the bug?

-   for file = (expand-file-name (match-string 1))
+   for file = (expand-file-name (match-string 1) root)
tttuuu888 commented 2 years ago

@leoliu Thanks for quick review. I didn't think of it but it makes more sense. I just tested and yes, it fixes the bug. Should I just close this pull request?

tttuuu888 commented 2 years ago

It's not a big change, so I think you can apply this pull request or close the pull request and commit yourself. I would appreciate it if you apply bug fix either way. Thank you!

leoliu commented 2 years ago

@tttuuu888 merged with thanks!