Skip to content

Commit

Permalink
Send byte position as opposed to character position
Browse files Browse the repository at this point in the history
As discussed on terhechte/SourceKittenDaemon#42,
Fixes #16.
  • Loading branch information
nathankot committed May 11, 2016
1 parent 8a2ab54 commit 809364d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion company-sourcekit.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ It never actually gets sent to the completion engine."
(lambda (port)
(if (not port) (funcall callback nil)
(let* ((tmpfile (company-sourcekit--tmp-file))
(offset (- (point) (length prefix) (point-min))))
(offset (- (position-bytes (point)) (length prefix) (point-min))))
(write-region (point-min) (point-max) tmpfile)
(when company-sourcekit-verbose
(message "[company-sourcekit] prefix: `%s`, file: %s, offset: %d" prefix tmpfile offset))
Expand Down

0 comments on commit 809364d

Please sign in to comment.