Skip to content

Commit da306a6

Browse files
committed
Add jupyter-repl-clear-input command
* jupyter-repl.el (jupyter-repl-clear-input): The new command. (jupyter-repl-mode-map): Add a binding for it. closes #512
1 parent 42626c8 commit da306a6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

jupyter-repl.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,14 @@ lines, truncate it to something less than
800800
(jupyter-repl-insert-prompt 'in))))
801801
(goto-char (point-max)))
802802

803+
(defun jupyter-repl-clear-input ()
804+
"Clear the contents of the input cell."
805+
(interactive)
806+
(goto-char (point-max))
807+
(delete-region
808+
(jupyter-repl-cell-code-beginning-position)
809+
(point-max)))
810+
803811
;;; Handlers
804812

805813
(defun jupyter-repl-history-add (code)
@@ -1649,6 +1657,7 @@ Return the buffer switched to."
16491657
(define-key map (kbd "M-n") #'jupyter-repl-history-next)
16501658
(define-key map (kbd "M-p") #'jupyter-repl-history-previous)
16511659
(define-key map (kbd "C-c C-o") #'jupyter-repl-clear-cells)
1660+
(define-key map (kbd "C-c C-u") #'jupyter-repl-clear-input)
16521661
(define-key map (kbd "C-c M-r") #'jupyter-repl-history-previous-matching)
16531662
(define-key map (kbd "C-c M-s") #'jupyter-repl-history-next-matching)
16541663
map))

0 commit comments

Comments
 (0)