From 9b5cad16b89a9ef22ab2ab206b5cb3cff560b619 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 21 Mar 2014 06:47:30 +0200 Subject: [PATCH] company-clang--build-location: try to be more careful with encoding http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00656.html --- company-clang.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/company-clang.el b/company-clang.el index b101c4155..787ecef6e 100644 --- a/company-clang.el +++ b/company-clang.el @@ -196,9 +196,12 @@ or automatically through a custom `company-clang-prefix-guesser'." (format "%s:%d:%d" (if (company-clang--auto-save-p) buffer-file-name "-") (line-number-at-pos) - (1+ (string-bytes (buffer-substring - (line-beginning-position) - (point))))))) + (1+ (length + (encode-coding-region + (line-beginning-position) + (point) + 'utf-8 + t)))))) (defsubst company-clang--build-complete-args (pos) (append '("-cc1" "-fsyntax-only" "-code-completion-macros") -- 2.39.2