Skip to content

Commit

Permalink
Adjust byte offset for Windows line endings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHines committed Apr 25, 2016
1 parent 7649a18 commit 76f09c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions goGuru.py
Expand Up @@ -181,6 +181,8 @@ def get_map(self, chars):
for char_offset, char in enumerate(chars):
cb_map[char_offset] = byte_offset
byte_offset += len(char.encode('utf-8'))
if char == '\n' and self.view.line_endings() == "Windows":
byte_offset += 1
return cb_map

def guru(self, end_offset, begin_offset=None, mode="describe", callback=None):
Expand Down

0 comments on commit 76f09c2

Please sign in to comment.