Emit an Edited event when ending, undoing or redoing a transaction
This commit is contained in:
@@ -3364,6 +3364,7 @@ impl Editor {
|
|||||||
self.set_selections(selections, None, true, cx);
|
self.set_selections(selections, None, true, cx);
|
||||||
}
|
}
|
||||||
self.request_autoscroll(Autoscroll::Fit, cx);
|
self.request_autoscroll(Autoscroll::Fit, cx);
|
||||||
|
cx.emit(Event::Edited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3373,6 +3374,7 @@ impl Editor {
|
|||||||
self.set_selections(selections, None, true, cx);
|
self.set_selections(selections, None, true, cx);
|
||||||
}
|
}
|
||||||
self.request_autoscroll(Autoscroll::Fit, cx);
|
self.request_autoscroll(Autoscroll::Fit, cx);
|
||||||
|
cx.emit(Event::Edited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5148,6 +5150,8 @@ impl Editor {
|
|||||||
} else {
|
} else {
|
||||||
log::error!("unexpectedly ended a transaction that wasn't started by this editor");
|
log::error!("unexpectedly ended a transaction that wasn't started by this editor");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cx.emit(Event::Edited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5657,6 +5661,7 @@ fn compute_scroll_position(
|
|||||||
pub enum Event {
|
pub enum Event {
|
||||||
Activate,
|
Activate,
|
||||||
BufferEdited,
|
BufferEdited,
|
||||||
|
Edited,
|
||||||
Blurred,
|
Blurred,
|
||||||
Dirtied,
|
Dirtied,
|
||||||
Saved,
|
Saved,
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ impl FollowableItem for Editor {
|
|||||||
|
|
||||||
fn should_unfollow_on_event(event: &Self::Event, _: &AppContext) -> bool {
|
fn should_unfollow_on_event(event: &Self::Event, _: &AppContext) -> bool {
|
||||||
match event {
|
match event {
|
||||||
// Event::BufferEdited { local } => *local,
|
Event::Edited => true,
|
||||||
Event::SelectionsChanged { local } => *local,
|
Event::SelectionsChanged { local } => *local,
|
||||||
Event::ScrollPositionChanged { local } => *local,
|
Event::ScrollPositionChanged { local } => *local,
|
||||||
_ => false,
|
_ => false,
|
||||||
|
|||||||
Reference in New Issue
Block a user