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(
676676 // remember the last valid line in the index and only rebuild it if needed.
677677 enum IndexValid {
678678 All ,
679- UpToLine ( u64 ) ,
679+ UpToLineExclusive ( u64 ) ,
680680 }
681681
682682 impl IndexValid {
683683 fn covers ( & self , line : u64 ) -> bool {
684684 match * self {
685- IndexValid :: UpToLine ( to) => to >= line,
685+ IndexValid :: UpToLineExclusive ( to) => to > line,
686686 _ => true ,
687687 }
688688 }
@@ -692,10 +692,10 @@ fn apply_document_changes(
692692 for change in content_changes {
693693 match change. range {
694694 Some ( range) => {
695- if !index_valid. covers ( range. start . line ) {
695+ if !index_valid. covers ( range. end . line ) {
696696 line_index = Cow :: Owned ( LineIndex :: new ( & old_text) ) ;
697697 }
698- index_valid = IndexValid :: UpToLine ( range. start . line ) ;
698+ index_valid = IndexValid :: UpToLineExclusive ( range. start . line ) ;
699699 let range = range. conv_with ( & line_index) ;
700700 let mut text = old_text. to_owned ( ) ;
701701 match std:: panic:: catch_unwind ( move || {
@@ -713,7 +713,7 @@ fn apply_document_changes(
713713 }
714714 None => {
715715 * old_text = change. text ;
716- index_valid = IndexValid :: UpToLine ( 0 ) ;
716+ index_valid = IndexValid :: UpToLineExclusive ( 0 ) ;
717717 }
718718 }
719719 }
You can’t perform that action at this time.
0 commit comments