mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Merge pull request #186 from cpbotha/cpb-kernel-in-ein-cell-edit
ein:get-kernel works in edit-cell-mode
This commit is contained in:
commit
2547226f2e
2 changed files with 9 additions and 1 deletions
|
@ -265,7 +265,8 @@ but can operate in different contexts."
|
|||
(ein:generic-getter '(ein:get-kernel--notebook
|
||||
ein:get-kernel--worksheet
|
||||
ein:get-kernel--shared-output
|
||||
ein:get-kernel--connect)))
|
||||
ein:get-kernel--connect
|
||||
ein:get-kernel--worksheet-in-edit-cell)))
|
||||
|
||||
(defun ein:get-kernel-or-error ()
|
||||
(or (ein:get-kernel)
|
||||
|
|
|
@ -940,6 +940,13 @@ in the history."
|
|||
(defun ein:get-kernel--worksheet ()
|
||||
(when (ein:worksheet-p ein:%worksheet%) (oref ein:%worksheet% :kernel)))
|
||||
|
||||
;; in edit-cell-mode, worksheet is bound as src--ws
|
||||
;; used by ein:get-kernel as a last option so completion, tooltips
|
||||
;; work in edit-cell-mode
|
||||
(defun ein:get-kernel--worksheet-in-edit-cell ()
|
||||
"Get kernel when in edit-cell-mode."
|
||||
(when (ein:worksheet-p ein:src--ws) (oref ein:src--ws :kernel)))
|
||||
|
||||
(defun ein:get-cell-at-point--worksheet ()
|
||||
(ein:worksheet-get-current-cell :noerror t))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue