mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
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:
parent
ffb53244ce
commit
e299a3b3eb
1 changed files with 4 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Reference in a new issue