Small fixes after terminal split (#22468)

* removes cache access workarounds as
https://github.com/zed-industries/zed/pull/21165 is supposed to fix this
* use `WeakModel<Project>` inside `Pane` just in case 

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-12-28 19:29:13 +02:00 committed by GitHub
parent 7903f4ea58
commit 3e3a5f04a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 46 additions and 46 deletions

View file

@ -385,28 +385,20 @@ impl LineLayoutCache {
let mut previous_frame = &mut *self.previous_frame.lock();
let mut current_frame = &mut *self.current_frame.write();
if let Some(cached_keys) = previous_frame
.used_lines
.get(range.start.lines_index..range.end.lines_index)
{
for key in cached_keys {
if let Some((key, line)) = previous_frame.lines.remove_entry(key) {
current_frame.lines.insert(key, line);
}
current_frame.used_lines.push(key.clone());
for key in &previous_frame.used_lines[range.start.lines_index..range.end.lines_index] {
if let Some((key, line)) = previous_frame.lines.remove_entry(key) {
current_frame.lines.insert(key, line);
}
current_frame.used_lines.push(key.clone());
}
if let Some(cached_keys) = previous_frame
.used_wrapped_lines
.get(range.start.wrapped_lines_index..range.end.wrapped_lines_index)
for key in &previous_frame.used_wrapped_lines
[range.start.wrapped_lines_index..range.end.wrapped_lines_index]
{
for key in cached_keys {
if let Some((key, line)) = previous_frame.wrapped_lines.remove_entry(key) {
current_frame.wrapped_lines.insert(key, line);
}
current_frame.used_wrapped_lines.push(key.clone());
if let Some((key, line)) = previous_frame.wrapped_lines.remove_entry(key) {
current_frame.wrapped_lines.insert(key, line);
}
current_frame.used_wrapped_lines.push(key.clone());
}
}