This commit is contained in:
Nathan Sobo
2021-08-22 11:58:19 -06:00
parent 030de803fe
commit 24639ec900
8 changed files with 378 additions and 388 deletions
+4 -4
View File
@@ -1,4 +1,4 @@
use super::{DisplayPoint, Editor, SelectAction, Snapshot};
use super::{DisplayPoint, Editor, SelectPhase, Snapshot};
use crate::time::ReplicaId;
use gpui::{
color::Color,
@@ -55,7 +55,7 @@ impl EditorElement {
if paint.text_bounds.contains_point(position) {
let snapshot = self.snapshot(cx.app);
let position = paint.point_for_position(&snapshot, layout, position);
cx.dispatch_action("buffer:select", SelectAction::Begin { position, add: cmd });
cx.dispatch_action("buffer:select", SelectPhase::Begin { position, add: cmd });
true
} else {
false
@@ -64,7 +64,7 @@ impl EditorElement {
fn mouse_up(&self, _position: Vector2F, cx: &mut EventContext) -> bool {
if self.view(cx.app.as_ref()).is_selecting() {
cx.dispatch_action("buffer:select", SelectAction::End);
cx.dispatch_action("buffer:select", SelectPhase::End);
true
} else {
false
@@ -115,7 +115,7 @@ impl EditorElement {
cx.dispatch_action(
"buffer:select",
SelectAction::Update {
SelectPhase::Update {
position,
scroll_position: (snapshot.scroll_position() + scroll_delta).clamp(
Vector2F::zero(),