]> code.delx.au - gnu-emacs-elpa/commitdiff
company-clang: handle multibyte chars between bol and point
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 18 Mar 2014 13:44:36 +0000 (15:44 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 18 Mar 2014 13:44:36 +0000 (15:44 +0200)
Thanks @Sarcasm!

company-clang.el

index cfd9cd4e5de920344e32df98b155d32e8b05dd0b..b101c41558a939c707ca430e937f240f49637ded 100644 (file)
@@ -196,7 +196,9 @@ 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)
-            (- (point) (line-beginning-position) -1))))
+            (1+ (string-bytes (buffer-substring
+                               (line-beginning-position)
+                               (point)))))))
 
 (defsubst company-clang--build-complete-args (pos)
   (append '("-cc1" "-fsyntax-only" "-code-completion-macros")