mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -05:00
new function ein:cell-goto-line.
This is a simple modification of ein:cell-goto to jump to a certain line instead of a certain character.
This commit is contained in:
parent
e72ae55d11
commit
efec1b50f1
1 changed files with 17 additions and 0 deletions
|
@ -714,6 +714,23 @@ PROP is a name of cell element. Default is `:input'.
|
|||
(t 0))))
|
||||
(forward-char (+ relpos offset))))
|
||||
|
||||
(defmethod ein:cell-goto-line ((cell ein:basecell) &optional inputline prop)
|
||||
"Go to the input area of the given CELL.
|
||||
INPUTLINE is the line number relative to the input area. Default is 1.
|
||||
PROP is a name of cell element. Default is `:input'.
|
||||
|
||||
\(fn cell inputline prop)"
|
||||
(unless inputline (setq inputline 1))
|
||||
(unless prop (setq prop :input))
|
||||
(ewoc-goto-node (oref cell :ewoc) (ein:cell-element-get cell prop))
|
||||
(let ((offset (case prop
|
||||
((:input :before-output) 1)
|
||||
(:after-input -1)
|
||||
(t 0))))
|
||||
(forward-char offset)
|
||||
(forward-line (- inputline 1))))
|
||||
|
||||
|
||||
(defmethod ein:cell-relative-point ((cell ein:basecell) &optional pos)
|
||||
"Return the point relative to the input area of CELL.
|
||||
If the position POS is not given, current point is considered."
|
||||
|
|
Loading…
Add table
Reference in a new issue