From a28ac4811fac929686aca6aa6976845c02d6efd3 Mon Sep 17 00:00:00 2001 From: Nathan Kot Date: Mon, 16 Jan 2017 08:51:58 +0900 Subject: [PATCH] Use string-bytes to get length of prefix --- company-sourcekit.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/company-sourcekit.el b/company-sourcekit.el index aa34ac6..3fb5c21 100644 --- a/company-sourcekit.el +++ b/company-sourcekit.el @@ -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))