editor: Fix toggle_comment in readonly mode (#20464)

Closes #20459

Release Notes:

- Fixed comments toggle in readonly mode
This commit is contained in:
Antar 2024-11-10 08:47:30 +01:00 committed by GitHub
parent 0a28800049
commit ba8f027c18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8782,6 +8782,9 @@ impl Editor {
}
pub fn toggle_comments(&mut self, action: &ToggleComments, cx: &mut ViewContext<Self>) {
if self.read_only(cx) {
return;
}
let text_layout_details = &self.text_layout_details(cx);
self.transact(cx, |this, cx| {
let mut selections = this.selections.all::<MultiBufferPoint>(cx);