language: Make Buffer::new take an explicit ID (#2900)
See Linear description for the full explanation of the issue. This PR is mostly a mechanical change, except for the one case where we do pass in an explicit `next_id` instead of `model_id` in project.rs. Release Notes: - Fixed a bug where some results were not reported in project search in presence of unnamed buffers.
This commit is contained in:
parent
81a5043b61
commit
07b9c6c302
16 changed files with 141 additions and 104 deletions
|
@ -1568,9 +1568,9 @@ impl Project {
|
|||
if self.is_remote() {
|
||||
return Err(anyhow!("creating buffers as a guest is not supported yet"));
|
||||
}
|
||||
|
||||
let id = post_inc(&mut self.next_buffer_id);
|
||||
let buffer = cx.add_model(|cx| {
|
||||
Buffer::new(self.replica_id(), text, cx)
|
||||
Buffer::new(self.replica_id(), id, text)
|
||||
.with_language(language.unwrap_or_else(|| language::PLAIN_TEXT.clone()), cx)
|
||||
});
|
||||
self.register_buffer(&buffer, cx)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue