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

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

[elpa] master f24b794 32/38: Make sure the error text is present before


From: Dmitry Gutov
Subject: [elpa] master f24b794 32/38: Make sure the error text is present before trying to use it
Date: Sat, 25 Jul 2020 19:51:16 -0400 (EDT)

branch: master
commit f24b7947b60ec92a41177cbfa63eda2ae94309a5
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Make sure the error text is present before trying to use it
    
    Fixes #878
---
 company-clang.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/company-clang.el b/company-clang.el
index 272dd8f..1460e09 100644
--- a/company-clang.el
+++ b/company-clang.el
@@ -194,7 +194,11 @@ or automatically through a custom 
`company-clang-prefix-guesser'."
          (cmd (concat company-clang-executable " " (mapconcat 'identity args " 
")))
          (pattern (format company-clang--completion-pattern ""))
          (message-truncate-lines t)
-         (err (if (re-search-forward pattern nil t)
+         (err (if (and (re-search-forward pattern nil t)
+                       ;; Something in the Windows build?
+                       ;; Looks like Clang doesn't always include the error 
text
+                       ;; before completions (even if exited with error).
+                       (> (match-beginning 0) (point-min)))
                   (buffer-substring-no-properties (point-min)
                                                   (1- (match-beginning 0)))
                 ;; Warn the user more aggressively if no match was found.



reply via email to

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