File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 66
77- Fixed bug with Fixed Format references being incorrectly detected in comments
88 ([ #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 ) )
911
1012## 3.1.2
1113
Original file line number Diff line number Diff line change @@ -840,6 +840,11 @@ def find_external(
840840 return False
841841
842842
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+
843848class FortranFile :
844849 def __init__ (self , path : str = None , pp_suffixes : list = None ):
845850 self .path : str = path
@@ -900,7 +905,7 @@ def load_from_disk(self) -> tuple[str | None, bool | None]:
900905 return None , False
901906
902907 self .hash = hash
903- self .contents_split = contents . splitlines ()
908+ self .contents_split = splitlines (contents )
904909 self .fixed = detect_fixed_format (self .contents_split )
905910 self .contents_pp = self .contents_split
906911 self .nLines = len (self .contents_split )
@@ -956,7 +961,7 @@ def check_change_reparse(line_no: int) -> bool:
956961 if len (text ) == 0 :
957962 text_split = ["" ]
958963 else :
959- text_split = text . splitlines ()
964+ text_split = splitlines (text )
960965 # Check for ending newline
961966 if (text [- 1 ] == "\n " ) or (text [- 1 ] == "\r " ):
962967 text_split .append ("" )
You can’t perform that action at this time.
0 commit comments