GNU bug report logs - #64101
29.0.91; Eglot inlay hints rendered out of order

Previous Next

Package: emacs;

Reported by: Krzysztof Klimonda <kklimonda <at> syntaxhighlighted.com>

Date: Fri, 16 Jun 2023 05:57:04 UTC

Severity: normal

Found in version 29.0.91

Full log


Message #71 received at 64101 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: João Távora <joaotavora <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 Krzysztof Klimonda <kklimonda <at> syntaxhighlighted.com>, 64101 <at> debbugs.gnu.org
Subject: Re: bug#64101: 29.0.91; Eglot inlay hints rendered out of order
Date: Sun, 18 Jun 2023 11:20:05 -0400
>> Anyway, can you explain this?
> [ Revised answer: ]  Yes.

The patch below won't fix it, but maybe it can help someone else write
an actual fix?  AFAICT the place that needs fixing is the one in xdisp.c


        Stefan


diff --git a/src/buffer.c b/src/buffer.c
index 0c46b201586..26938dc5f78 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3376,6 +3376,10 @@ record_overlay_string (struct sortstrlist *ssl, Lisp_Object str,
    that string via PSTR, if that variable is non-NULL.  The storage of
    the concatenated strings may be overwritten by subsequent calls.  */
 
+/* AFAICT, this is used only by indent.c:compute_motion,
+   which does not actually care about the ordering of the strings
+   but only its total width.  */
+
 ptrdiff_t
 overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr)
 {
@@ -3416,6 +3420,7 @@ overlay_strings (ptrdiff_t pos, struct window *w, unsigned char **pstr)
 			       endpos - startpos);
     }
 
+  /* FIXME: Use `sort_overlays` instead?  */
   if (overlay_tails.used > 1)
     qsort (overlay_tails.buf, overlay_tails.used, sizeof (struct sortstr),
 	   cmp_for_strings);
diff --git a/src/xdisp.c b/src/xdisp.c
index 8bcf2acfe04..f487dfbb5ba 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6794,6 +6794,7 @@ #define RECORD_OVERLAY_STRING(OVERLAY, STRING, AFTER_P)			\
 
   /* Sort entries.  */
   if (n > 1)
+    /* FIXME: Use `sort_overlays` instead?  */
     qsort (entries, n, sizeof *entries, compare_overlay_entries);
 
   /* Record number of overlay strings, and where we computed it.  */





This bug report was last modified 2 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.