Skip to content

Commit

Permalink
Generalize View::object_selections into map
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dead10ck committed Mar 6, 2023
1 parent 0b5d95f commit ae01866
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 125 deletions.
4 changes: 2 additions & 2 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ impl Application {
// NOTE: this isn't necessarily true anymore. If
// `--vsplit` or `--hsplit` are used, the file which is
// opened last is focused on.
let view_id = editor.tree.focus;
let view = view_mut!(editor);
let doc = doc_mut!(editor, &doc_id);
let pos = Selection::point(pos_at_coords(doc.text().slice(..), pos, true));
doc.set_selection(view_id, pos);
doc.set_selection(view, pos);
}
}
editor.set_status(format!(
Expand Down
Loading

0 comments on commit ae01866

Please sign in to comment.