emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master d00bbba 4/8: company-clang: Skip over identity preprocesso


From: Dmitry Gutov
Subject: [elpa] master d00bbba 4/8: company-clang: Skip over identity preprocessor #defines
Date: Wed, 12 Dec 2018 17:46:40 -0500 (EST)

branch: master
commit d00bbbac3be99d042024734fc417ecad253a52e4
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    company-clang: Skip over identity preprocessor #defines
    
    Fixes #841
---
 NEWS.md          |  5 +++++
 company-clang.el | 11 ++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/NEWS.md b/NEWS.md
index 0d715c6..d2c0ac6 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,10 @@
 # History of user-visible changes
 
+## Next
+
+* `company-clang` removes identity preprocessor #defines from completions
+  ([#841](https://github.com/company-mode/company-mode/issues/841)).
+
 ## 2018-12-08 (0.9.8)
 
 * CAPF backend fixed to use the right `:exit-function`. It can now safely be a
diff --git a/company-clang.el b/company-clang.el
index 962db1e..d43eebb 100644
--- a/company-clang.el
+++ b/company-clang.el
@@ -134,11 +134,12 @@ or automatically through a custom 
`company-clang-prefix-guesser'."
           (when (string-match ":" match)
             (setq match (substring match 0 (match-beginning 0)))))
         (let ((meta (match-string-no-properties 2)))
-          (when (and meta (not (string= match meta)))
-            (put-text-property 0 1 'meta
-                               (company-clang--strip-formatting meta)
-                               match)))
-        (push match lines)))
+          (unless (equal match meta)
+            (when meta
+              (put-text-property 0 1 'meta
+                                 (company-clang--strip-formatting meta)
+                                 match))
+            (push match lines)))))
     lines))
 
 (defun company-clang--meta (candidate)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]