Unified · Split
| @@ -85,7 +85,7 @@ impl RefactoringAssistant { · 84 unmodified lines | |||
| 85 | anyhow::Ok(()) | 85 | anyhow::Ok(()) |
| 86 | }); | 86 | }); |
| 87 | 87 | ||
| 88 | let mut last_transaction = None; | 88 | let mut first_transaction = None; |
| 89 | while let Some(hunks) = hunks_rx.next().await { | 89 | while let Some(hunks) = hunks_rx.next().await { |
| 90 | editor.update(&mut cx, |editor, cx| { | 90 | editor.update(&mut cx, |editor, cx| { |
| 91 | let mut highlights = Vec::new(); | 91 | let mut highlights = Vec::new(); |
| @@ -120,14 +120,15 @@ impl RefactoringAssistant { · 28 unmodified lines | |||
| 120 | cx, | 120 | cx, |
| 121 | ); | 121 | ); |
| 122 | if let Some(transaction) = buffer.end_transaction(cx) { | 122 | if let Some(transaction) = buffer.end_transaction(cx) { |
| 123 | if let Some(last_transaction) = last_transaction { | 123 | if let Some(first_transaction) = first_transaction { |
| 124 | buffer.merge_transaction_into( | 124 | buffer.merge_transaction_into( |
| 125 | last_transaction, | ||
| 126 | transaction, | 125 | transaction, |
| 126 | first_transaction, | ||
| 127 | cx, | 127 | cx, |
| 128 | ); | 128 | ); |
| 129 | } else { | ||
| 130 | first_transaction = Some(transaction); | ||
| 129 | } | 131 | } |
| 130 | last_transaction = Some(transaction); | ||
| 131 | buffer.finalize_last_transaction(cx); | 132 | buffer.finalize_last_transaction(cx); |
| 132 | } | 133 | } |
| 133 | }); | 134 | }); |