Function: ghostel-line-mode-newline
ghostel-line-mode-newline is an interactive and natively compiled
function defined in ghostel-line-mode.el.
Signature
(ghostel-line-mode-newline)
Documentation
Insert a literal newline in the line-mode input region.
Discoverable shortcut for C-q (quoted-insert) followed by a newline: lets
you compose multi-line prompts in apps that distinguish submit (Enter)
from newline (Shift-Enter). The newline goes through to the running app
verbatim when ghostel-line-mode-send ships the input.
Snaps point to the end of the input region first when point is in the
read-only scrollback portion, mirroring ghostel-line-mode-self-insert.
Key Bindings
ghostel-line-mode-map S-<return> ghostel-line-mode-map S-RET
Source Code
;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel-line-mode.el
(defun ghostel-line-mode-newline ()
"Insert a literal newline in the line-mode input region.
Discoverable shortcut for `\\[quoted-insert]' followed by a newline: lets
you compose multi-line prompts in apps that distinguish submit (Enter)
from newline (Shift-Enter). The newline goes through to the running app
verbatim when `ghostel-line-mode-send' ships the input.
Snaps point to the end of the input region first when point is in the
read-only scrollback portion, mirroring `ghostel-line-mode-self-insert'."
(interactive)
(let ((start (and (markerp ghostel--line-input-start)
(marker-position ghostel--line-input-start)))
(end (and (markerp ghostel--line-input-end)
(marker-position ghostel--line-input-end))))
(when (and start end (or (< (point) start) (> (point) end)))
(deactivate-mark)
(goto-char end)))
(insert "\n"))