From 0e575f97bbb91d61f64ce9d785dcb044b7216d91 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 15 Oct 2022 10:43:01 +0300 Subject: [PATCH] FIXED: sweep_identifier_at_point/2: possible infinite failure loop --- sweep.pl | 1 + sweeprolog.el | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sweep.pl b/sweep.pl index 3a9667b..73dd668 100644 --- a/sweep.pl +++ b/sweep.pl @@ -235,6 +235,7 @@ sweep_identifier_at_point_(Path0, Point, Contents, Identifier) :- prolog_colourise_term(Contents, Path, sweep_handle_identifier_at_point(Path, M, Point), []), + !, sweep_current_identifier_at_point(Identifier0), term_string(Identifier0, Identifier). diff --git a/sweeprolog.el b/sweeprolog.el index 1904981..6e25e55 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -2505,11 +2505,11 @@ Interactively, POINT is set to the current point." (point))) (contents (buffer-substring-no-properties beg end))) (sweeprolog-open-query "user" - "sweep" - "sweep_identifier_at_point" - (list contents - (buffer-file-name) - (- p beg))) + "sweep" + "sweep_identifier_at_point" + (list contents + (buffer-file-name) + (- p beg))) (let ((sol (sweeprolog-next-solution))) (sweeprolog-close-query) (when (sweeprolog-true-p sol) -- 2.39.2