File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
- Fixed bug with Fixed Format references being incorrectly detected in comments
8
8
([ #447 ] ( https://github.com/fortran-lang/fortls/issues/447 ) )
9
+ - Fixed bug with where form feed characters broke LSP features
10
+ ([ #443 ] ( https://github.com/fortran-lang/fortls/issues/443 ) )
9
11
10
12
## 3.1.2
11
13
Original file line number Diff line number Diff line change @@ -840,6 +840,11 @@ def find_external(
840
840
return False
841
841
842
842
843
+ def splitlines (text : str ) -> list [str ]:
844
+ """Split text into lines by \r \n , \n , or \r """
845
+ return re .split (r"\n|\r\n?" , text )
846
+
847
+
843
848
class FortranFile :
844
849
def __init__ (self , path : str = None , pp_suffixes : list = None ):
845
850
self .path : str = path
@@ -900,7 +905,7 @@ def load_from_disk(self) -> tuple[str | None, bool | None]:
900
905
return None , False
901
906
902
907
self .hash = hash
903
- self .contents_split = contents . splitlines ()
908
+ self .contents_split = splitlines (contents )
904
909
self .fixed = detect_fixed_format (self .contents_split )
905
910
self .contents_pp = self .contents_split
906
911
self .nLines = len (self .contents_split )
@@ -956,7 +961,7 @@ def check_change_reparse(line_no: int) -> bool:
956
961
if len (text ) == 0 :
957
962
text_split = ["" ]
958
963
else :
959
- text_split = text . splitlines ()
964
+ text_split = splitlines (text )
960
965
# Check for ending newline
961
966
if (text [- 1 ] == "\n " ) or (text [- 1 ] == "\r " ):
962
967
text_split .append ("" )
You can’t perform that action at this time.
0 commit comments