Skip to content

Commit 41b6b98

Browse files
committed
Generalize View::object_selections into map
This allows using multiple distinct state histories. By default, all history is also cleared any time a view's selection is set, unless explicitly told to save the state. This way, we can have control over when selection history is saved.
1 parent eccc6d5 commit 41b6b98

File tree

10 files changed

+137
-122
lines changed

10 files changed

+137
-122
lines changed

helix-term/src/application.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ impl Application {
221221
// NOTE: this isn't necessarily true anymore. If
222222
// `--vsplit` or `--hsplit` are used, the file which is
223223
// opened last is focused on.
224-
let view_id = editor.tree.focus;
224+
let view = view_mut!(editor);
225225
let doc = doc_mut!(editor, &doc_id);
226226
let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true));
227-
doc.set_selection(view_id, pos);
227+
doc.set_selection(view, pos);
228228
}
229229
}
230230
editor.set_status(format!(

0 commit comments

Comments
 (0)