update packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; company-files.el --- company-mode completion backend for file names
|
||||
|
||||
;; Copyright (C) 2009-2011, 2014-2015 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009-2011, 2014-2021 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Nikolaj Schumacher
|
||||
|
||||
@@ -33,11 +33,19 @@
|
||||
:group 'company)
|
||||
|
||||
(defcustom company-files-exclusions nil
|
||||
"File name extensions and directory names to ignore.
|
||||
"A list of file name extensions and directory names to ignore.
|
||||
The values should use the same format as `completion-ignored-extensions'."
|
||||
:type '(const string)
|
||||
:type '(repeat (string :tag "File extension or directory name"))
|
||||
:package-version '(company . "0.9.1"))
|
||||
|
||||
(defcustom company-files-chop-trailing-slash t
|
||||
"Non-nil to remove the trailing slash after inserting directory name.
|
||||
|
||||
This way it's easy to continue completion by typing `/' again.
|
||||
|
||||
Set this to nil to disable that behavior."
|
||||
:type 'boolean)
|
||||
|
||||
(defun company-files--directory-files (dir prefix)
|
||||
;; Don't use directory-files. It produces directories without trailing /.
|
||||
(condition-case err
|
||||
@@ -51,7 +59,7 @@ The values should use the same format as `completion-ignored-extensions'."
|
||||
(file-error nil)))
|
||||
|
||||
(defun company-files--exclusions-filtered (completions)
|
||||
(let* ((dir-exclusions (cl-delete-if-not #'company-files--trailing-slash-p
|
||||
(let* ((dir-exclusions (cl-remove-if-not #'company-files--trailing-slash-p
|
||||
company-files-exclusions))
|
||||
(file-exclusions (cl-set-difference company-files-exclusions
|
||||
dir-exclusions)))
|
||||
@@ -128,7 +136,8 @@ The values should use the same format as `completion-ignored-extensions'."
|
||||
(string-prefix-p (car old) (car new))))
|
||||
|
||||
(defun company-files--post-completion (arg)
|
||||
(when (company-files--trailing-slash-p arg)
|
||||
(when (and company-files-chop-trailing-slash
|
||||
(company-files--trailing-slash-p arg))
|
||||
(delete-char -1)))
|
||||
|
||||
;;;###autoload
|
||||
@@ -144,6 +153,7 @@ File paths with spaces are only supported inside strings."
|
||||
(location (cons (dired-noselect
|
||||
(file-name-directory (directory-file-name arg))) 1))
|
||||
(post-completion (company-files--post-completion arg))
|
||||
(kind (if (string-suffix-p "/" arg) 'folder 'file))
|
||||
(sorted t)
|
||||
(no-cache t)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user