branch: externals/xref-union
commit cb790499b0aad8bbf989a9b81340088389872782
Author: fap <[email protected]>
Commit: fap <[email protected]>
Fix comparison of duplicates matches
Comparing with `=` coerces the marker into a numerical value,
representing the POINT in the file. Since the information about the
file gets lost matches on the same line are wrongly detected as
duplicates.
Comparing with `equal` compares the full marker object, so the same
POINT in different files are detected as different locations.
---
xref-union.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xref-union.el b/xref-union.el
index 3eb42e0e47..4c32d11a75 100644
--- a/xref-union.el
+++ b/xref-union.el
@@ -74,8 +74,8 @@ The marker points to the beginning of the line in which ITEM
is located."
"Check if the items ITEM1 and ITEM2 are the same.
Same in this context means they reference the same line in the same
buffer."
- (= (xref-union--bol-marker item1)
- (xref-union--bol-marker item2)))
+ (equal (xref-union--bol-marker item1)
+ (xref-union--bol-marker item2)))
(cl-defmethod xref-backend-identifier-at-point ((backends (head union)))
"Collect the results of multiple Xref BACKENDS."