Skip to content

Commit

Permalink
Use string-bytes to get length of prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nathankot committed Jan 15, 2017
1 parent 71d9e70 commit a28ac48
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 (- (position-bytes (point)) (length prefix) (point-min))))
(offset (- (position-bytes (point)) (string-bytes prefix) (position-bytes (point-min)))))
(write-region (point-min) (point-max) tmpfile nil 'silent)
(when company-sourcekit-verbose
(message "[company-sourcekit] prefix: `%s`, file: %s, offset: %d" prefix tmpfile offset))
Expand Down

0 comments on commit a28ac48

Please sign in to comment.