Remove Copy trait for enum Operator (#9378)
In this commit, the Copy trait has been removed from Operator. This change was necessary due to the value of operator may wish to attach a motion type, which is not compatible with the Copy trait. All instances where Operator was previously copied have been updated to use the clone() or cloned() method instead. This includes function parameters, variable assignments, and closures.
This commit is contained in:
@@ -106,8 +106,8 @@ fn register(workspace: &mut Workspace, cx: &mut ViewContext<Workspace>) {
|
||||
Vim::update(cx, |vim, cx| vim.switch_mode(mode, false, cx))
|
||||
});
|
||||
workspace.register_action(
|
||||
|_: &mut Workspace, &PushOperator(operator): &PushOperator, cx| {
|
||||
Vim::update(cx, |vim, cx| vim.push_operator(operator, cx))
|
||||
|_: &mut Workspace, PushOperator(operator): &PushOperator, cx| {
|
||||
Vim::update(cx, |vim, cx| vim.push_operator(operator.clone(), cx))
|
||||
},
|
||||
);
|
||||
workspace.register_action(|_: &mut Workspace, n: &Number, cx: _| {
|
||||
@@ -493,7 +493,7 @@ impl Vim {
|
||||
}
|
||||
|
||||
fn active_operator(&self) -> Option<Operator> {
|
||||
self.state().operator_stack.last().copied()
|
||||
self.state().operator_stack.last().cloned()
|
||||
}
|
||||
|
||||
fn transaction_begun(&mut self, transaction_id: TransactionId, _: &mut WindowContext) {
|
||||
|
||||
Reference in New Issue
Block a user