Skip to content

Commit

Permalink
language-server: fixed broken \r\n line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed Apr 10, 2017
1 parent cf06b45 commit 38be788
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4519,11 +4519,11 @@ private static int lineAndCharacterToOffset(Reader in, int targetLine, int targe
}
else
{
//\r\n is treated as one character
if (next != '\r')
{
offset++;
}
//don't skip \r here if line endings are \r\n in the file
//there may be cases where the file line endings don't match
//what the editor ends up rendering. skipping \r will help
//that, but it will break other cases.
offset++;

if (next == '\n')
{
Expand Down

0 comments on commit 38be788

Please sign in to comment.