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-11 18:19:49 -06:00
committed by GitHub
parent 3ab9700155
commit 32806b8320
+3
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;
}