Subject: Re: bug#61369: Problem with keeping tree-sitter parse tree up-to-date

From: Dmitry Gutov <[email-masked]>
Date: Wed, 08 Feb 2023 22:41:14 +0300

20:21, 8 February 2023, "Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email-masked]>:

Dmitry Gutov <[email-masked]> writes:

1. Have some buffer with text

"use std::Path::{self, Path, PathBuf}; // good: std is a crate name
... (maybe something else
"

2. Have this text in a different buffer (I used scratch):

"

let date = DateTime::<chrono::Utc>::from_utc(date, chrono::Utc);
"

Meaning, the buffer starts with two empty lines.

3. Select the first line from the first buffer including the trailing newline,
yank and then paste at the beginning of the second buffer.

The second buffer will now look like this:

"use std::Path::{self, Path, PathBuf}; // good: std is a crate name

let date = DateTime::<chrono::Utc>::from_utc(date, chrono::Utc);
"

I just want to confirm that I can reproduce this, and that if you skip
the trailing newline from the use-statement, I don't get this behavior.
So it seems like the newline is the crucial point, right?

Yes, same.

Thr trailing newline is necessary.

The empty lines at the beginning of the buffer (being copied to) are necessary to reproduce this as well.