Introduce terminal button count

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Petros Amoiridis 2023-03-22 16:13:58 +02:00
parent aa7254167a
commit d5bb2d13b8
No known key found for this signature in database
5 changed files with 38 additions and 10 deletions

View file

@ -43,11 +43,12 @@ impl Project {
.push(terminal_handle.downgrade());
let id = terminal_handle.id();
cx.observe_release(&terminal_handle, move |project, _terminal, _cx| {
cx.observe_release(&terminal_handle, move |project, _terminal, cx| {
let handles = &mut project.terminals.local_handles;
if let Some(index) = handles.iter().position(|terminal| terminal.id() == id) {
handles.remove(index);
cx.notify();
}
})
.detach();