vim: Don’t allow edits in the read-only state (#10404)

Fix #8423 

Release Notes:

- vim: Fixed vim-surround motions editing read-only buffer
(preview-only)
This commit is contained in:
Hans 2024-04-12 08:19:49 +08:00 committed by GitHub
parent 3ab9700155
commit 32806b8320
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -418,6 +418,9 @@ impl MultiBuffer {
S: ToOffset,
T: Into<Arc<str>>,
{
if self.read_only() {
return;
}
if self.buffers.borrow().is_empty() {
return;
}