diff options
author | Blaž Hrastnik | 2021-03-31 06:45:18 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-31 06:45:18 +0000 |
commit | 9eaef6e33376407931162780cd402297c44f26c4 (patch) | |
tree | da14993d99a50f502113befcd0f78538f4e7c716 /helix-core/src/comment.rs | |
parent | dfc17becd56efbc1f65de7c8d65cb32ad4690db1 (diff) |
Fully drop State references.
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 |