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

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

[elpa] master 1c7a872 31/38: Merge pull request #983 from qhuyduong/make


From: Dmitry Gutov
Subject: [elpa] master 1c7a872 31/38: Merge pull request #983 from qhuyduong/make-post-completion-command-dedicated-function
Date: Sat, 25 Jul 2020 19:51:16 -0400 (EDT)

branch: master
commit 1c7a87283146f429c5076e8ea0a559556a4d4272
Merge: 6333fc4 e93b3dc
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: GitHub <noreply@github.com>

    Merge pull request #983 from 
qhuyduong/make-post-completion-command-dedicated-function
    
    [company-files] Make post-completion command a dedicated function
---
 company-files.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/company-files.el b/company-files.el
index 91de1c6..8859266 100644
--- a/company-files.el
+++ b/company-files.el
@@ -127,6 +127,10 @@ The values should use the same format as 
`completion-ignored-extensions'."
   (and (equal (cdr old) (cdr new))
        (string-prefix-p (car old) (car new))))
 
+(defun company-files--post-completion (arg)
+  (when (company-files--trailing-slash-p arg)
+    (delete-char -1)))
+
 ;;;###autoload
 (defun company-files (command &optional arg &rest ignored)
   "`company-mode' completion backend existing file names.
@@ -139,8 +143,7 @@ File paths with spaces are only supported inside strings."
     (candidates (company-files--complete arg))
     (location (cons (dired-noselect
                      (file-name-directory (directory-file-name arg))) 1))
-    (post-completion (when (company-files--trailing-slash-p arg)
-                       (delete-char -1)))
+    (post-completion (company-files--post-completion arg))
     (sorted t)
     (no-cache t)))
 



reply via email to

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