editor: Fix edit_predictions_disabled_in not disabling predictions (#36469)

Closes #25744

Only setting changes and editor init determined whether to show
predictions, so glob patterns and toggles correctly disabled them. On
cursor changes we call `update_visible_edit_prediction`, but we weren’t
discarding predictions when the scope changed. This PR fixes that.

Release Notes:

- Fixed an issue where the `edit_predictions_disabled_in` setting was
ignored in some cases.
This commit is contained in:
Smit Barmase 2025-08-19 14:43:41 +05:30 committed by GitHub
parent b8ddb0141c
commit 47e1d4511c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 49 additions and 1 deletions

View file

@ -7764,6 +7764,14 @@ impl Editor {
self.edit_prediction_settings =
self.edit_prediction_settings_at_position(&buffer, cursor_buffer_position, cx);
match self.edit_prediction_settings {
EditPredictionSettings::Disabled => {
self.discard_edit_prediction(false, cx);
return None;
}
_ => {}
};
self.edit_prediction_indent_conflict = multibuffer.is_line_whitespace_upto(cursor);
if self.edit_prediction_indent_conflict {