Remove focused
field and use FocusHandle
instead in Editor
This commit is contained in:
parent
a866370dc1
commit
6ae09634ce
5 changed files with 276 additions and 278 deletions
|
@ -159,16 +159,14 @@ impl FollowableItem for Editor {
|
|||
self.buffer.update(cx, |buffer, cx| {
|
||||
buffer.remove_active_selections(cx);
|
||||
});
|
||||
} else {
|
||||
} else if self.focus_handle.is_focused(cx) {
|
||||
self.buffer.update(cx, |buffer, cx| {
|
||||
if self.focused {
|
||||
buffer.set_active_selections(
|
||||
&self.selections.disjoint_anchors(),
|
||||
self.selections.line_mode,
|
||||
self.cursor_shape,
|
||||
cx,
|
||||
);
|
||||
}
|
||||
buffer.set_active_selections(
|
||||
&self.selections.disjoint_anchors(),
|
||||
self.selections.line_mode,
|
||||
self.cursor_shape,
|
||||
cx,
|
||||
);
|
||||
});
|
||||
}
|
||||
cx.notify();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue