jupyter-completion-symbol-beginning: Allow operator completions

This commit is contained in:
Nathaniel Nicandro 2018-10-10 00:16:12 -05:00
parent 7d824f4915
commit 6c836bd3d8

View file

@ -1595,7 +1595,13 @@ If POS is non-nil return the position of the symbol before POS
otherwise return the position of the symbol before point."
(save-excursion
(and pos (goto-char pos))
(+ (point) (skip-syntax-backward "w_."))))
(if (and (eq (char-syntax (char-before)) ?.)
(not (eq (char-before) ?.)))
;; Complete operators, but not the field/attribute
;; accessor .
(skip-syntax-backward ".")
(skip-syntax-backward "w_"))
(point)))
;; Adapted from `company-grab-symbol-cons'
(defun jupyter-completion-grab-symbol-cons (re &optional max-len)