Add the ability to propose changes to a set of buffers (#18170)
This PR introduces functionality for creating *branches* of buffers that can be used to preview and edit change sets that haven't yet been applied to the buffers themselves. Release Notes: - N/A --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
parent
e309fbda2a
commit
743feb98bc
20 changed files with 622 additions and 186 deletions
|
@ -2182,7 +2182,10 @@ impl Project {
|
|||
|
||||
let buffer_id = buffer.read(cx).remote_id();
|
||||
match event {
|
||||
BufferEvent::Operation(operation) => {
|
||||
BufferEvent::Operation {
|
||||
operation,
|
||||
is_local: true,
|
||||
} => {
|
||||
let operation = language::proto::serialize_operation(operation);
|
||||
|
||||
if let Some(ssh) = &self.ssh_session {
|
||||
|
@ -2267,7 +2270,7 @@ impl Project {
|
|||
.filter_map(|buffer| {
|
||||
let buffer = buffer.upgrade()?;
|
||||
buffer
|
||||
.update(&mut cx, |buffer, cx| buffer.git_diff_recalc(cx))
|
||||
.update(&mut cx, |buffer, cx| buffer.recalculate_diff(cx))
|
||||
.ok()
|
||||
.flatten()
|
||||
})
|
||||
|
|
|
@ -3288,7 +3288,7 @@ async fn test_buffer_is_dirty(cx: &mut gpui::TestAppContext) {
|
|||
cx.subscribe(&buffer1, {
|
||||
let events = events.clone();
|
||||
move |_, _, event, _| match event {
|
||||
BufferEvent::Operation(_) => {}
|
||||
BufferEvent::Operation { .. } => {}
|
||||
_ => events.lock().push(event.clone()),
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue