editor: Disable edit predictions in read-only buffers (#26804)
Closes #26797 Release Notes: - Fixed edit predictions appearing in read-only buffers. Co-authored-by: Marshall Bowers <git@maxdeviant.com>
This commit is contained in:
parent
7a888de9f5
commit
96b747e31d
1 changed files with 3 additions and 0 deletions
|
@ -5200,6 +5200,9 @@ impl Editor {
|
||||||
cx: &App,
|
cx: &App,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
maybe!({
|
maybe!({
|
||||||
|
if self.read_only(cx) {
|
||||||
|
return Some(false);
|
||||||
|
}
|
||||||
let provider = self.edit_prediction_provider()?;
|
let provider = self.edit_prediction_provider()?;
|
||||||
if !provider.is_enabled(&buffer, buffer_position, cx) {
|
if !provider.is_enabled(&buffer, buffer_position, cx) {
|
||||||
return Some(false);
|
return Some(false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue