mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
Merge pull request #513 from millejoh/issue-506
Avoid completing against punctuation (again).
This commit is contained in:
commit
5accc13b51
1 changed files with 5 additions and 3 deletions
|
@ -91,7 +91,8 @@
|
|||
(let* ((kernel (ein:get-kernel-or-error))
|
||||
(cached (ein:completions-get-cached arg (ein:$kernel-oinfo-cache kernel))))
|
||||
(ein:aif cached it
|
||||
(unless (and (looking-at "[[:nonascii:]]") (ein:company--punctuation-check (thing-at-point 'line) (current-column)))
|
||||
(unless (ein:company--punctuation-check (thing-at-point 'line)
|
||||
(current-column))
|
||||
(case ein:completion-backend
|
||||
(t
|
||||
(cons :async
|
||||
|
@ -99,8 +100,9 @@
|
|||
(ein:company--complete arg cb)))))))))))
|
||||
|
||||
(defun ein:company--punctuation-check (thing col)
|
||||
(or (string-match "[[:nonascii:]]" thing)
|
||||
(let ((query (ein:trim-right (subseq thing 0 col) "[\n]")))
|
||||
(string-match "[]()\",[{}'=: ]$" query (- col 2))))
|
||||
(string-match "[]()\",[{}'=: ]$" query (- col 2)))))
|
||||
|
||||
|
||||
(defun ein:company-handle-doc-buffer-finish (packed content _metadata-not-used_)
|
||||
|
|
Loading…
Add table
Reference in a new issue