File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -752,11 +752,11 @@ impl LanguageServer for Backend {
752752 while let Some ( pos_in_line) = line[ start_pos..] . find ( & word) {
753753 let actual_pos = start_pos + pos_in_line;
754754 let char_before = if actual_pos > 0 {
755- line. chars ( ) . nth ( actual_pos - 1 )
755+ line[ ..actual_pos ] . chars ( ) . next_back ( )
756756 } else {
757757 None
758758 } ;
759- let char_after = line. chars ( ) . nth ( actual_pos + word_len ) ;
759+ let char_after = line[ actual_pos + word_len.. ] . chars ( ) . next ( ) ;
760760
761761 let is_boundary_before =
762762 char_before. map_or ( true , |c| !c. is_alphanumeric ( ) && c != '_' ) ;
@@ -803,11 +803,11 @@ impl LanguageServer for Backend {
803803 while let Some ( pos_in_line) = line[ start_pos..] . find ( & word) {
804804 let actual_pos = start_pos + pos_in_line;
805805 let char_before = if actual_pos > 0 {
806- line. chars ( ) . nth ( actual_pos - 1 )
806+ line[ ..actual_pos ] . chars ( ) . next_back ( )
807807 } else {
808808 None
809809 } ;
810- let char_after = line. chars ( ) . nth ( actual_pos + word_len ) ;
810+ let char_after = line[ actual_pos + word_len.. ] . chars ( ) . next ( ) ;
811811
812812 let is_boundary_before =
813813 char_before. map_or ( true , |c| !c. is_alphanumeric ( ) && c != '_' ) ;
You can’t perform that action at this time.
0 commit comments