aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-21 04:26:10 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-21 04:26:10 +0800
commit2683d7c6c3c88355fd3188ac2b2c68338ae2d205 (patch)
treecc89cfe0d377e8550aa3577add86f4366b804c07 /CHANGELOG.md
parenta3b75b7eeae5e7a0c53b6167bafb75a85fa6d9ce (diff)
feat(core, macros): add r_append! macro and RenderResult::append_other
Implement `RenderResult::append_other()` to merge buffered content and immediate output behavior from one result into another. Add the `r_append!` macro with both explicit buffer (`dst, src`) and implicit buffer (`src`) usage forms, re-exported from `mingling::prelude`.
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 40e82d9..2bc0318 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -302,6 +302,14 @@ None
- Updated `try_redispatch_simple` and `try_redispatch_completion` to emit `#[#exts]` instead of bare `#exts`, ensuring proper attribute syntax in the re-dispatched token stream.
- Registered `#[proc_macro_attribute] pub fn routeify` in `mingling_macros/src/lib.rs`.
+12. **[`core`]** **[`macros`]** Added the `r_append!` macro and `RenderResult::append_other()` method for appending the contents of one `RenderResult` to another. The `append_other()` method on `RenderResult` merges the buffered content (text and output modes) from another `RenderResult` into the current one. If the destination result has `immediate_output` enabled but the source does not, the source's content will be immediately flushed to the appropriate output stream (stdout/stderr) while also being appended to the render buffer. The `exit_code` of the source result is **not** transferred — only the buffered content and the `immediate_output` flag are merged.
+
+ The `r_append!` macro supports two usage forms:
+ - **Explicit buffer** — `r_append!(dst, src)` appends the contents of `src` into the `dst` `RenderResult`.
+ - **Implicit buffer** — `r_append!(src)` appends the contents of `src` into the implicit `__render_result_buffer` (available inside `#[buffer]` functions).
+
+ The macro is re-exported as `mingling::macros::r_append` and included in `mingling::prelude::*`.
+
#### **BREAKING CHANGES** (API CHANGES):
1. **[`macros:renderer`]** **[`macros:help`]** Removed `r_println!` and `r_print!` macros from being implicitly injected by `#[renderer]` and `#[help]` macros. These macros still exist, but must now be used **explicitly** — either with an explicit buffer argument, or via the `#[buffer]` extension attribute that re-enables implicit buffer injection.