kikocis/company-english-helper public
Changesets · Branches · Tags · Compare
| Changeset | af4f8814e395c887ff3a203f42a588735a93ff36b69c647566c522f634169a19 |
|---|---|
| Author | Andy Stewart <lazycat.manatee@gmail.com> · 2018-08-28 22:03 +08:00 |
| Committer | Andy Stewart <lazycat.manatee@gmail.com> · 2018-08-28 22:03 +08:00 |
| Parents | 11db1b6ed013 |
1 file changed
modified company-english-helper.el +11 −4
| @@ -6,8 +6,8 @@ | ||
| 6 | 6 | ;; Maintainer: Andy Stewart <lazycat.manatee@gmail.com> |
| 7 | 7 | ;; Copyright (C) 2018, Andy Stewart, all rights reserved. |
| 8 | 8 | ;; Created: 2018-07-06 23:22:22 |
| 9 | -;; Version: 0.7 | |
| 10 | -;; Last-Updated: 2018-08-10 12:39:24 | |
| 9 | +;; Version: 0.8 | |
| 10 | +;; Last-Updated: 2018-08-28 21:58:45 | |
| 11 | 11 | ;; By: Andy Stewart |
| 12 | 12 | ;; URL: http://www.emacswiki.org/emacs/download/company-english-helper.el |
| 13 | 13 | ;; Keywords: |
| @@ -66,6 +66,9 @@ | ||
| 66 | 66 | |
| 67 | 67 | ;;; Change log: |
| 68 | 68 | ;; |
| 69 | +;; 2018/08/27 | |
| 70 | +;; * Add fuzz search algorithm. | |
| 71 | +;; | |
| 69 | 72 | ;; 2018/08/10 |
| 70 | 73 | ;; * Require `cl' avoid error "Symbol's function definition is void: remove-if-not". |
| 71 | 74 | ;; |
| @@ -128,11 +131,15 @@ | ||
| 128 | 131 | (prefix (company-grab-symbol)) |
| 129 | 132 | (candidates |
| 130 | 133 | (remove-if-not |
| 131 | - (lambda (c) (string-prefix-p (downcase arg) c)) | |
| 134 | + (lambda (c) (or (string-prefix-p (downcase arg) c) | |
| 135 | + (string-suffix-p (downcase arg) c) | |
| 136 | + (and (string-match-p "-" (downcase arg)) | |
| 137 | + (and (string-prefix-p (car (split-string (downcase arg) "-")) c) | |
| 138 | + (string-suffix-p (cadr (split-string (downcase arg) "-")) c) | |
| 139 | + )))) | |
| 132 | 140 | en-words-completions)) |
| 133 | 141 | (annotation (en-words-annotation arg)) |
| 134 | 142 | (sorted t) |
| 135 | - (ignore-case 'keep-prefix) | |
| 136 | 143 | )) |
| 137 | 144 | |
| 138 | 145 | (defun toggle-company-english-helper () |