]> code.delx.au - gnu-emacs-elpa/blobdiff - company-dabbrev.el
company-dabbrev--search-buffer: Use `syntax-ppss' to get to the beg of str-or-cmt
[gnu-emacs-elpa] / company-dabbrev.el
index 7fd20b65647afe6a3e8803127f36f5accaaaf98b..3d57bb5c2eb53405ab2436eb48b9f7b75860b16e 100644 (file)
@@ -64,7 +64,8 @@ If you set this value to nil, you may also want to set
 `company-dabbrev-ignore-case' to any value other than `keep-prefix'.")
 
 (defcustom company-dabbrev-minimum-length (1+ company-minimum-prefix-length)
-  "The minimum length for the string to be included.")
+  "The minimum length for the string to be included."
+  :type 'integer)
 
 (defmacro company-dabrev--time-limit-while (test start limit &rest body)
   (declare (indent 3) (debug t))
@@ -94,7 +95,7 @@ If you set this value to nil, you may also want to set
           start limit
         (setq match (match-string-no-properties 0))
         (if (and ignore-comments (company-in-string-or-comment))
-            (re-search-backward "\\s<\\|\\s!\\|\\s\"\\|\\s|" nil t)
+            (goto-char (nth 8 (syntax-ppss)))
           (when (>= (length match) company-dabbrev-minimum-length)
             (push match symbols))))
       (goto-char (or pos (point-min)))