mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Get tests passing w/ multibuffer in editor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
75dd37d873
commit
6caf016df9
2 changed files with 5 additions and 1 deletions
|
@ -2403,8 +2403,9 @@ impl Editor {
|
||||||
let mut to_unfold = Vec::new();
|
let mut to_unfold = Vec::new();
|
||||||
let mut new_selections = Vec::new();
|
let mut new_selections = Vec::new();
|
||||||
{
|
{
|
||||||
|
let selections = self.selections::<Point>(cx);
|
||||||
let buffer = self.buffer.read(cx).read(cx);
|
let buffer = self.buffer.read(cx).read(cx);
|
||||||
for selection in self.selections::<Point>(cx) {
|
for selection in selections {
|
||||||
for row in selection.start.row..selection.end.row {
|
for row in selection.start.row..selection.end.row {
|
||||||
let cursor = Point::new(row, buffer.line_len(row));
|
let cursor = Point::new(row, buffer.line_len(row));
|
||||||
new_selections.push(Selection {
|
new_selections.push(Selection {
|
||||||
|
|
|
@ -31,6 +31,9 @@ impl Anchor {
|
||||||
pub fn cmp<'a>(&self, other: &Anchor, snapshot: &MultiBufferSnapshot) -> Result<Ordering> {
|
pub fn cmp<'a>(&self, other: &Anchor, snapshot: &MultiBufferSnapshot) -> Result<Ordering> {
|
||||||
let excerpt_id_cmp = self.excerpt_id.cmp(&other.excerpt_id);
|
let excerpt_id_cmp = self.excerpt_id.cmp(&other.excerpt_id);
|
||||||
if excerpt_id_cmp.is_eq() {
|
if excerpt_id_cmp.is_eq() {
|
||||||
|
if self.excerpt_id == ExcerptId::max() {
|
||||||
|
return Ok(Ordering::Equal);
|
||||||
|
}
|
||||||
self.text_anchor.cmp(
|
self.text_anchor.cmp(
|
||||||
&other.text_anchor,
|
&other.text_anchor,
|
||||||
snapshot
|
snapshot
|
||||||
|
|
Loading…
Reference in a new issue