mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-03 17:12:21 +00:00
read_file determined line indices via Python's splitlines, which breaks on \f, \v, \x1c-\x1e, \x85, U+2028 and U+2029 in addition to the LSP-compliant line breaks counted by delete_lines/replace_lines. In a file containing any of those characters the indices reported by read_file referred to different physical lines than the editing tools operate on, so an edit made after the required read_file could silently hit the wrong line. Use TextUtils.split_lines, as already applied to search_text and MatchedConsecutiveLines.from_file_contents. Files whose line breaks are all LSP-compliant are decomposed exactly as before.