@@ -5018,6 +5018,9 @@ impl Editor {
this.change_selections(Default::default(), window, cx, |s| s.select(new_selections));
this.refresh_edit_prediction(true, false, window, cx);
+ if let Some(task) = this.trigger_on_type_formatting("\n".to_owned(), window, cx) {
+ task.detach_and_log_err(cx);
+ }
});
}
@@ -5082,6 +5085,9 @@ impl Editor {
}
}
editor.edit(indent_edits, cx);
+ if let Some(format) = editor.trigger_on_type_formatting("\n".to_owned(), window, cx) {
+ format.detach_and_log_err(cx);
+ }
});
}
@@ -5144,6 +5150,9 @@ impl Editor {
}
}
editor.edit(indent_edits, cx);
+ if let Some(format) = editor.trigger_on_type_formatting("\n".to_owned(), window, cx) {
+ format.detach_and_log_err(cx);
+ }
});
}
@@ -5454,7 +5463,7 @@ impl Editor {
window: &mut Window,
cx: &mut Context<Self>,
) -> Option<Task<Result<()>>> {
- if input.len() != 1 {
+ if input.chars().count() != 1 {
return None;
}