Uniquify completion candidates of whole lines
If the same line is present more than once in the buffer, it will be offered more than once as a candidate. This commit deletes duplicate lines from the completion list. Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
8d388ebba9
commit
7c523f2c15
1 changed files with 7 additions and 6 deletions
|
@ -129,12 +129,13 @@ C-x C-l."
|
|||
(`candidates
|
||||
(all-completions
|
||||
arg
|
||||
(split-string
|
||||
(replace-regexp-in-string
|
||||
"^[\t\s]+" ""
|
||||
(concat (buffer-substring-no-properties (point-min) (line-beginning-position))
|
||||
(buffer-substring-no-properties (line-end-position) (point-max))))
|
||||
"\\(\r\n\\|[\n\r]\\)" t)))))
|
||||
(delete-dups
|
||||
(split-string
|
||||
(replace-regexp-in-string
|
||||
"^[\t\s]+" ""
|
||||
(concat (buffer-substring-no-properties (point-min) (line-beginning-position))
|
||||
(buffer-substring-no-properties (line-end-position) (point-max))))
|
||||
"\\(\r\n\\|[\n\r]\\)" t))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +company/dict-or-keywords ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue