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

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

[elpa] master 0d9d2ba 26/34: Don't search for prefix through string boun


From: Vitalie Spinu
Subject: [elpa] master 0d9d2ba 26/34: Don't search for prefix through string boundary
Date: Tue, 7 May 2019 16:05:31 -0400 (EDT)

branch: master
commit 0d9d2bad327afc066f3ae26c17d22e84264bac6f
Author: Vitalie Spinu <address@hidden>
Commit: Vitalie Spinu <address@hidden>

    Don't search for prefix through string boundary
---
 company-math.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/company-math.el b/company-math.el
index e68eedc..7906337 100644
--- a/company-math.el
+++ b/company-math.el
@@ -139,8 +139,12 @@ corresponding unicode symbol."
                            (memq face allow-faces)))))
     (when insertp
       (save-excursion
-        (when (looking-back regexp (point-at-bol) 'greedy)
-          (match-string 0))))))
+        (let* ((ppss (syntax-ppss))
+               (min-point (if (nth 3 ppss)
+                              (max (nth 8 ppss) (point-at-bol))
+                            (point-at-bol))))
+          (when (looking-back regexp min-point 'greedy)
+            (match-string 0)))))))
 
 (defun company-math--substitute-unicode (symbol)
   "Substitute preceding latex command with with SYMBOL."



reply via email to

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