jupyter-code-context (completion): Only consider the deepest nested parenthesis level

This is a better default when considering kernels like Clojupyter.
This commit is contained in:
Nathaniel Nicandro 2019-03-17 20:27:19 -05:00
parent ffb53244ce
commit e299a3b3eb
No known key found for this signature in database
GPG key ID: C34814B309DD06B8

View file

@ -1367,10 +1367,11 @@ If the region is active, return it. Otherwise return the line."
(if (zerop (nth 0 ppss))
(jupyter-region-context (line-beginning-position) (point))
(jupyter-region-context
;; Return a context including all nested parenthesis and the closest
;; contiguous non-whitespace sequence of characters at the top level.
;; Return a context including the deepest nested parenthesis and the
;; closest contiguous non-whitespace sequence of characters at the top
;; level.
(save-excursion
(goto-char (car (nth 9 ppss)))
(goto-char (nth 1 ppss))
(skip-syntax-backward "->")
(skip-syntax-backward "^->")
(point))