File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -676,13 +676,13 @@ fn apply_document_changes(
676
676
// remember the last valid line in the index and only rebuild it if needed.
677
677
enum IndexValid {
678
678
All ,
679
- UpToLine ( u64 ) ,
679
+ UpToLineExclusive ( u64 ) ,
680
680
}
681
681
682
682
impl IndexValid {
683
683
fn covers ( & self , line : u64 ) -> bool {
684
684
match * self {
685
- IndexValid :: UpToLine ( to) => to >= line,
685
+ IndexValid :: UpToLineExclusive ( to) => to > line,
686
686
_ => true ,
687
687
}
688
688
}
@@ -692,10 +692,10 @@ fn apply_document_changes(
692
692
for change in content_changes {
693
693
match change. range {
694
694
Some ( range) => {
695
- if !index_valid. covers ( range. start . line ) {
695
+ if !index_valid. covers ( range. end . line ) {
696
696
line_index = Cow :: Owned ( LineIndex :: new ( & old_text) ) ;
697
697
}
698
- index_valid = IndexValid :: UpToLine ( range. start . line ) ;
698
+ index_valid = IndexValid :: UpToLineExclusive ( range. start . line ) ;
699
699
let range = range. conv_with ( & line_index) ;
700
700
let mut text = old_text. to_owned ( ) ;
701
701
match std:: panic:: catch_unwind ( move || {
@@ -713,7 +713,7 @@ fn apply_document_changes(
713
713
}
714
714
None => {
715
715
* old_text = change. text ;
716
- index_valid = IndexValid :: UpToLine ( 0 ) ;
716
+ index_valid = IndexValid :: UpToLineExclusive ( 0 ) ;
717
717
}
718
718
}
719
719
}
You can’t perform that action at this time.
0 commit comments