mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
Consider operators during completion
This commit is contained in:
parent
1f812ddf7c
commit
54810022a9
1 changed files with 5 additions and 3 deletions
|
@ -1581,7 +1581,7 @@ If POS is non-nil return the position of the symbol before POS
|
||||||
otherwise return the position of the symbol before point."
|
otherwise return the position of the symbol before point."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(and pos (goto-char pos))
|
(and pos (goto-char pos))
|
||||||
(+ (point) (skip-syntax-backward "w_"))))
|
(+ (point) (skip-syntax-backward "w_."))))
|
||||||
|
|
||||||
;; Adapted from `company-grab-symbol-cons'
|
;; Adapted from `company-grab-symbol-cons'
|
||||||
(defun jupyter-completion-grab-symbol-cons (re &optional max-len)
|
(defun jupyter-completion-grab-symbol-cons (re &optional max-len)
|
||||||
|
@ -1593,9 +1593,11 @@ done at point, return nil.
|
||||||
|
|
||||||
MAX-LEN is the maximum number of characters to search behind the
|
MAX-LEN is the maximum number of characters to search behind the
|
||||||
begiining of the symbol at point to look for a match of RE."
|
begiining of the symbol at point to look for a match of RE."
|
||||||
(let ((symbol (if (looking-at "\\>\\|\\_>")
|
(let ((symbol (if (or (looking-at "\\>\\|\\_>")
|
||||||
|
;; Complete operators
|
||||||
|
(eq (char-syntax (char-before)) ?.))
|
||||||
(buffer-substring-no-properties
|
(buffer-substring-no-properties
|
||||||
(point) (jupyter-completion-symbol-beginning))
|
(jupyter-completion-symbol-beginning) (point))
|
||||||
(unless (and (char-after)
|
(unless (and (char-after)
|
||||||
(memq (char-syntax (char-after)) '(?w ?_)))
|
(memq (char-syntax (char-after)) '(?w ?_)))
|
||||||
""))))
|
""))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue