diff options
Diffstat (limited to 'helix-core/src/comment.rs')
-rw-r--r-- | helix-core/src/comment.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs index c3b91b4f..fd9d9058 100644 --- a/helix-core/src/comment.rs +++ b/helix-core/src/comment.rs @@ -96,13 +96,15 @@ mod test { // comment let transaction = toggle_line_comments(&state.doc, &state.selection); - transaction.apply(&mut state); + transaction.apply(&mut state.doc); + state.selection = state.selection.clone().map(transaction.changes()); assert_eq!(state.doc, " // 1\n\n // 2\n // 3"); // uncomment let transaction = toggle_line_comments(&state.doc, &state.selection); - transaction.apply(&mut state); + transaction.apply(&mut state.doc); + state.selection = state.selection.clone().map(transaction.changes()); assert_eq!(state.doc, " 1\n\n 2\n 3"); // TODO: account for no margin after comment |