Add serializing and restoring editor scroll position
Co-authored-by: Kay <kay@zed.dev>
This commit is contained in:
parent
d237bdaa9b
commit
ebbe6e7aa9
5 changed files with 181 additions and 30 deletions
|
@ -3629,9 +3629,7 @@ impl Editor {
|
|||
}
|
||||
|
||||
pub fn undo(&mut self, _: &Undo, cx: &mut ViewContext<Self>) {
|
||||
dbg!("undo");
|
||||
if let Some(tx_id) = self.buffer.update(cx, |buffer, cx| buffer.undo(cx)) {
|
||||
dbg!(tx_id);
|
||||
if let Some((selections, _)) = self.selection_history.transaction(tx_id).cloned() {
|
||||
self.change_selections(None, cx, |s| {
|
||||
s.select_anchors(selections.to_vec());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue