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

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

[elpa] externals/company 0503adea94 22/30: company-dabbrev: Also support


From: ELPA Syncer
Subject: [elpa] externals/company 0503adea94 22/30: company-dabbrev: Also support completion inside a word
Date: Sat, 13 Jul 2024 00:57:52 -0400 (EDT)

branch: externals/company
commit 0503adea946ba1bd434f0887af6b5a8cd4977001
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    company-dabbrev: Also support completion inside a word
    
    #340 #1106
---
 company-dabbrev.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/company-dabbrev.el b/company-dabbrev.el
index 9b256194e7..d55bc5b428 100644
--- a/company-dabbrev.el
+++ b/company-dabbrev.el
@@ -166,12 +166,13 @@ This variable affects both `company-dabbrev' and 
`company-dabbrev-code'."
     symbols))
 
 (defun company-dabbrev--prefix ()
-  ;; Not in the middle of a word.
-  (unless (looking-at-p company-dabbrev-char-regexp)
-    ;; Emacs can't do greedy backward-search.
-    (company-grab-line (format "\\(?:^\\| \\)[^ ]*?\\(\\(?:%s\\)*\\)"
-                               company-dabbrev-char-regexp)
-                       1)))
+  ;; Emacs can't do greedy backward-search.
+  (list
+   (company-grab-line (format "\\(?:^\\| \\)[^ ]*?\\(\\(?:%s\\)*\\)"
+                              company-dabbrev-char-regexp)
+                      1)
+   (and (looking-at (format "\\(?:%s\\)*" company-dabbrev-char-regexp))
+        (match-string 0))))
 
 (defun company-dabbrev--filter (prefix candidates)
   (let* ((completion-ignore-case company-dabbrev-ignore-case)



reply via email to

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