Compare commits
18 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e4b486e768 | ||
![]() |
ebcf6d4207 | ||
![]() |
7adfc40825 | ||
![]() |
c226b9bcae | ||
![]() |
302f8f4aca | ||
![]() |
277dfccb1d | ||
![]() |
f2cc00ee2f | ||
![]() |
b89582cf98 | ||
![]() |
5c64fde1ce | ||
![]() |
f48ef7bbef | ||
![]() |
8761fe9e1d | ||
![]() |
26a6316e02 | ||
![]() |
08fd5cc968 | ||
![]() |
f8647c7c23 | ||
![]() |
b13a60735b | ||
![]() |
4b612882a3 | ||
![]() |
e108c16333 | ||
![]() |
ec3835b989 |
8 changed files with 41 additions and 16 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -8130,7 +8130,7 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zed"
|
name = "zed"
|
||||||
version = "0.68.0"
|
version = "0.67.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"activity_indicator",
|
"activity_indicator",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -5453,11 +5453,17 @@ impl Editor {
|
||||||
pub fn set_selections_from_remote(
|
pub fn set_selections_from_remote(
|
||||||
&mut self,
|
&mut self,
|
||||||
selections: Vec<Selection<Anchor>>,
|
selections: Vec<Selection<Anchor>>,
|
||||||
|
pending_selection: Option<Selection<Anchor>>,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) {
|
) {
|
||||||
let old_cursor_position = self.selections.newest_anchor().head();
|
let old_cursor_position = self.selections.newest_anchor().head();
|
||||||
self.selections.change_with(cx, |s| {
|
self.selections.change_with(cx, |s| {
|
||||||
s.select_anchors(selections);
|
s.select_anchors(selections);
|
||||||
|
if let Some(pending_selection) = pending_selection {
|
||||||
|
s.set_pending(pending_selection, SelectMode::Character);
|
||||||
|
} else {
|
||||||
|
s.clear_pending();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
self.selections_did_change(false, &old_cursor_position, cx);
|
self.selections_did_change(false, &old_cursor_position, cx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,13 +130,17 @@ impl FollowableItem for Editor {
|
||||||
.ok_or_else(|| anyhow!("invalid selection"))
|
.ok_or_else(|| anyhow!("invalid selection"))
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>>>()?;
|
.collect::<Result<Vec<_>>>()?;
|
||||||
|
let pending_selection = state
|
||||||
|
.pending_selection
|
||||||
|
.map(|selection| deserialize_selection(&buffer, selection))
|
||||||
|
.flatten();
|
||||||
let scroll_top_anchor = state
|
let scroll_top_anchor = state
|
||||||
.scroll_top_anchor
|
.scroll_top_anchor
|
||||||
.and_then(|anchor| deserialize_anchor(&buffer, anchor));
|
.and_then(|anchor| deserialize_anchor(&buffer, anchor));
|
||||||
drop(buffer);
|
drop(buffer);
|
||||||
|
|
||||||
if !selections.is_empty() {
|
if !selections.is_empty() || pending_selection.is_some() {
|
||||||
editor.set_selections_from_remote(selections, cx);
|
editor.set_selections_from_remote(selections, pending_selection, cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(scroll_top_anchor) = scroll_top_anchor {
|
if let Some(scroll_top_anchor) = scroll_top_anchor {
|
||||||
|
@ -216,6 +220,11 @@ impl FollowableItem for Editor {
|
||||||
.iter()
|
.iter()
|
||||||
.map(serialize_selection)
|
.map(serialize_selection)
|
||||||
.collect(),
|
.collect(),
|
||||||
|
pending_selection: self
|
||||||
|
.selections
|
||||||
|
.pending_anchor()
|
||||||
|
.as_ref()
|
||||||
|
.map(serialize_selection),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,9 +278,13 @@ impl FollowableItem for Editor {
|
||||||
.selections
|
.selections
|
||||||
.disjoint_anchors()
|
.disjoint_anchors()
|
||||||
.iter()
|
.iter()
|
||||||
.chain(self.selections.pending_anchor().as_ref())
|
|
||||||
.map(serialize_selection)
|
.map(serialize_selection)
|
||||||
.collect();
|
.collect();
|
||||||
|
update.pending_selection = self
|
||||||
|
.selections
|
||||||
|
.pending_anchor()
|
||||||
|
.as_ref()
|
||||||
|
.map(serialize_selection);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
|
@ -307,6 +320,10 @@ impl FollowableItem for Editor {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|selection| deserialize_selection(&multibuffer, selection))
|
.filter_map(|selection| deserialize_selection(&multibuffer, selection))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
let pending_selection = message
|
||||||
|
.pending_selection
|
||||||
|
.and_then(|selection| deserialize_selection(&multibuffer, selection));
|
||||||
|
|
||||||
let scroll_top_anchor = message
|
let scroll_top_anchor = message
|
||||||
.scroll_top_anchor
|
.scroll_top_anchor
|
||||||
.and_then(|anchor| deserialize_anchor(&multibuffer, anchor));
|
.and_then(|anchor| deserialize_anchor(&multibuffer, anchor));
|
||||||
|
@ -361,8 +378,8 @@ impl FollowableItem for Editor {
|
||||||
multibuffer.remove_excerpts(removals, cx);
|
multibuffer.remove_excerpts(removals, cx);
|
||||||
});
|
});
|
||||||
|
|
||||||
if !selections.is_empty() {
|
if !selections.is_empty() || pending_selection.is_some() {
|
||||||
this.set_selections_from_remote(selections, cx);
|
this.set_selections_from_remote(selections, pending_selection, cx);
|
||||||
this.request_autoscroll_remotely(Autoscroll::newest(), cx);
|
this.request_autoscroll_remotely(Autoscroll::newest(), cx);
|
||||||
} else if let Some(anchor) = scroll_top_anchor {
|
} else if let Some(anchor) = scroll_top_anchor {
|
||||||
this.set_scroll_anchor_remote(ScrollAnchor {
|
this.set_scroll_anchor_remote(ScrollAnchor {
|
||||||
|
|
|
@ -853,9 +853,10 @@ message UpdateView {
|
||||||
repeated ExcerptInsertion inserted_excerpts = 1;
|
repeated ExcerptInsertion inserted_excerpts = 1;
|
||||||
repeated uint64 deleted_excerpts = 2;
|
repeated uint64 deleted_excerpts = 2;
|
||||||
repeated Selection selections = 3;
|
repeated Selection selections = 3;
|
||||||
EditorAnchor scroll_top_anchor = 4;
|
optional Selection pending_selection = 4;
|
||||||
float scroll_x = 5;
|
EditorAnchor scroll_top_anchor = 5;
|
||||||
float scroll_y = 6;
|
float scroll_x = 6;
|
||||||
|
float scroll_y = 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -872,9 +873,10 @@ message View {
|
||||||
optional string title = 2;
|
optional string title = 2;
|
||||||
repeated Excerpt excerpts = 3;
|
repeated Excerpt excerpts = 3;
|
||||||
repeated Selection selections = 4;
|
repeated Selection selections = 4;
|
||||||
EditorAnchor scroll_top_anchor = 5;
|
optional Selection pending_selection = 5;
|
||||||
float scroll_x = 6;
|
EditorAnchor scroll_top_anchor = 6;
|
||||||
float scroll_y = 7;
|
float scroll_x = 7;
|
||||||
|
float scroll_y = 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,4 +6,4 @@ pub use conn::Connection;
|
||||||
pub use peer::*;
|
pub use peer::*;
|
||||||
mod macros;
|
mod macros;
|
||||||
|
|
||||||
pub const PROTOCOL_VERSION: u32 = 43;
|
pub const PROTOCOL_VERSION: u32 = 44;
|
||||||
|
|
|
@ -3,7 +3,7 @@ authors = ["Nathan Sobo <nathansobo@gmail.com>"]
|
||||||
description = "The fast, collaborative code editor."
|
description = "The fast, collaborative code editor."
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
name = "zed"
|
name = "zed"
|
||||||
version = "0.68.0"
|
version = "0.67.5"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "zed"
|
name = "zed"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
dev
|
stable
|
|
@ -93,7 +93,7 @@ impl LspAdapter for RustLspAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn disk_based_diagnostics_progress_token(&self) -> Option<String> {
|
async fn disk_based_diagnostics_progress_token(&self) -> Option<String> {
|
||||||
Some("rust-analyzer/checkOnSave".into())
|
Some("rust-analyzer/flycheck".into())
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
|
async fn process_diagnostics(&self, params: &mut lsp::PublishDiagnosticsParams) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue