F7MUSI5FFYOWTCR4CBL42CT3GE6UL66CQVJANCIISBLAMKRMQQ6AC "open_file and switch_buffer place point at the beginning of the buffer.""search_forward/search_backward wrap by default; pass wrap=false for strict no-wrap.""For search ops, use needle (text/query aliases are accepted).""References are 1-based over prior ops in the same exec_ops call, e.g. $2.point."
(madrigal--alist-get* :count raw-op)1))(set-region0 (or (madrigal--alist-get* 'set_region raw-op)(madrigal--alist-get* :set_region raw-op)nil))(needle (format "%s" (madrigal--resolve-ref needle0 results)))(count (madrigal--require-integer(madrigal--resolve-ref count0 results) "count"))(set-region-p (not (memq set-region0 '(nil :false false)))))(when (string-empty-p needle)(error "madrigal: needle must be non-empty"))(when (<= count 0)(error "madrigal: count must be > 0"))(with-current-buffer replica(let ((found nil))(dotimes (_ count)(setq found (search-forward needle nil t))(unless found(error "madrigal: search_forward needle not found")))(when set-region-p(madrigal--set-region replica (- (point) (length needle)) (point)))(setq row (append row(list (cons 'point (point))(cons 'match_start (- (point) (length needle)))(cons 'match_end (point)))))))))
(madrigal--alist-get* :count raw-op)1))(set-region0 (or (madrigal--alist-get* 'set_region raw-op)(madrigal--alist-get* :set_region raw-op)nil))(wrap0 (or (madrigal--alist-get* 'wrap raw-op)(madrigal--alist-get* :wrap raw-op)t))(needle (format "%s" (madrigal--resolve-ref needle0 results)))(count (madrigal--require-integer(madrigal--resolve-ref count0 results) "count"))(set-region-p (not (memq set-region0 '(nil :false false))))(wrap-p (not (memq wrap0 '(nil :false false)))))(when (string-empty-p needle)(error "madrigal: needle must be non-empty"))(when (<= count 0)(error "madrigal: count must be > 0"))(with-current-buffer replica(let ((found nil)(wrapped nil))(dotimes (_ count)(setq found (search-forward needle nil t))(unless found(when wrap-p(goto-char (point-min))(setq wrapped t)(setq found (search-forward needle nil t)))(unless found(error "madrigal: search_forward needle not found"))))(when set-region-p(madrigal--set-region replica (- (point) (length needle)) (point)))(setq row (append row(list (cons 'point (point))(cons 'match_start (- (point) (length needle)))(cons 'match_end (point))(cons 'wrapped wrapped))))))))
(madrigal--alist-get* :count raw-op)1))(set-region0 (or (madrigal--alist-get* 'set_region raw-op)(madrigal--alist-get* :set_region raw-op)nil))(needle (format "%s" (madrigal--resolve-ref needle0 results)))(count (madrigal--require-integer(madrigal--resolve-ref count0 results) "count"))(set-region-p (not (memq set-region0 '(nil :false false)))))(when (string-empty-p needle)(error "madrigal: needle must be non-empty"))(when (<= count 0)(error "madrigal: count must be > 0"))(with-current-buffer replica(let ((found nil))(dotimes (_ count)(setq found (search-backward needle nil t))(unless found(error "madrigal: search_backward needle not found")))(when set-region-p(madrigal--set-region replica found (+ found (length needle))))(goto-char found)(setq row (append row(list (cons 'point (point))(cons 'match_start found)(cons 'match_end (+ found (length needle))))))))))
(madrigal--alist-get* :count raw-op)1))(set-region0 (or (madrigal--alist-get* 'set_region raw-op)(madrigal--alist-get* :set_region raw-op)nil))(wrap0 (or (madrigal--alist-get* 'wrap raw-op)(madrigal--alist-get* :wrap raw-op)t))(needle (format "%s" (madrigal--resolve-ref needle0 results)))(count (madrigal--require-integer(madrigal--resolve-ref count0 results) "count"))(set-region-p (not (memq set-region0 '(nil :false false))))(wrap-p (not (memq wrap0 '(nil :false false)))))(when (string-empty-p needle)(error "madrigal: needle must be non-empty"))(when (<= count 0)(error "madrigal: count must be > 0"))(with-current-buffer replica(let ((found nil)(wrapped nil))(dotimes (_ count)(setq found (search-backward needle nil t))(unless found(when wrap-p(goto-char (point-max))(setq wrapped t)(setq found (search-backward needle nil t)))(unless found(error "madrigal: search_backward needle not found"))))(when set-region-p(madrigal--set-region replica found (+ found (length needle))))(goto-char found)(setq row (append row(list (cons 'point (point))(cons 'match_start found)(cons 'match_end (+ found (length needle)))(cons 'wrapped wrapped))))))))
"insert_text, delete_selection, replace_selection, replace_match, replace_in_selection, ""save_buffer. ""Supports references like $1.point to consume previous step outputs.")
"insert_text, delete_selection, replace_selection, replace_match, replace_in_selection, ""save_buffer. ""search_forward/search_backward support needle plus text/query aliases and optional wrap boolean (default true). ""Supports references like $1.point to consume previous step outputs.")