Add editor command COM-KILL-LINE

Works as close as I care to get it to its Emacs counterpart
This commit is contained in:
John Lorentzson 2025-07-31 10:51:21 +02:00
parent c7e66e6c51
commit 6f6a800897

View file

@ -640,6 +640,17 @@ Additionally ensures correct line numbers on the way, as a bonus."
(decf column)
(redisplay-line line)))))
(defun com-kill-line ()
(with-editor-accessors *editor* (:current-column column
:current-line line)
(cond ((and (= column (line-length line)) (null (next-line line)))
(feep))
((= column (line-length line))
(com-forward-delete))
(t
(setf (fill-pointer (line-content line)) column)
(redisplay-line line :start column)))))
(defun com-newline ()
(with-editor-accessors *editor* (:current-column column
:current-line line)
@ -888,6 +899,7 @@ Additionally ensures correct line numbers on the way, as a bonus."
(:left com-backward-char)
(#\Del com-backward-delete)
((:c . #\d) com-forward-delete)
((:c . #\k) com-kill-line)
((:c . #\j) com-newline)
((:c . #\n) com-new-buffer)
((:c . #\l) com-refresh-screen)