Subject: Re: bug#76124: eglot buffer corruption

From: Eli Zaretskii <[email-masked]>
Date: Sat, 08 Feb 2025 09:32:18 +0200

> From: Johann Höchtl <[email-masked]>
> Date: Fri, 7 Feb 2025 21:14:54 +0100
> 
> When I edit a markdown file using markdown-mode AND enable eglot in that buffer, at least one text
> operation corrupts the buffer.
> 
> When I am on an markdown list item:
> 
> - some text a
> - some text b []  <-point
> 
> and press C-c <up> (which swaps the current list item with the preceding one), the buffers content gets
> messed up: Parts of the preceding text are not properly swapped but "bleeds into" the swapped line.
> 
> Possibly eglot and the interaction with "track-changes" is at fault: When I eglot-shutdown, I never see this
> corruption.

I'm guess the information about the LSP server you are using might be
relevant?

> This is not a visual problem: When I check the eglot logs changes transfered to the language server or save
> and revert the buffer I see that the buffer contains garbled text.

Adding João and Stefan to the discussion.

> Using emacs as of commit 5e12843fa32150d2f18ce21fc6f3ae58732df6a7

Is that from the master branch of the Emacs Git repository?  (Your
report elided all version and configuration information, so it's hard
to tell.)

Thanks.