]> code.delx.au - gnu-emacs-elpa/commitdiff
company-clang--build-location: try to be more careful with encoding
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Mar 2014 04:47:30 +0000 (06:47 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Mar 2014 04:47:30 +0000 (06:47 +0200)
http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00656.html

company-clang.el

index b101c41558a939c707ca430e937f240f49637ded..787ecef6eaa6e87d88115a099e72e3002cb06dcb 100644 (file)
@@ -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")