Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add nullify-last-flags function to interp
i have command that duplicates a line, but because it uses `copy-region` or `kill-whole-line`, it behaves unexpectedly when it is repeated.  with `nullify-last-flags`, the command works as intended when it is repeated
  • Loading branch information
SequentialDesign committed Dec 4, 2024
commit d35894e4f9598ef73381de0883856fc732f5b084
1 change: 1 addition & 0 deletions src/internal-packages.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@
:exit-editor
:interactive-p
:continue-flag
:nullify-last-flags
:pop-up-backtrace
:call-background-job
:command-loop-counter
Expand Down
7 changes: 7 additions & 0 deletions src/interp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
(push (cons flag t) *last-flags*)
(push (cons flag t) *curr-flags*)))

(defun nullify-last-flags (flag &rest more-flags)
"Set FLAG and FLAGS to nil in *LAST-FLAGS*."
(push (cons flag nil) *last-flags*)
(when more-flags
(dotimes (i (length more-flags))
(push (cons (nth i more-flags) nil) *last-flags*))))

(defmacro do-command-loop ((&key interactive) &body body)
(alexandria:once-only (interactive)
`(loop :for *last-flags* := nil :then *curr-flags*
Expand Down