Skip to content

Commit 1a112c0

Browse files
committed
fix: Use buffered request to write to console buffer ALWAYS
1 parent 32c0e98 commit 1a112c0

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

crates/cmd_prompt/src/actions/actions/basic_input.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,21 @@ pub fn write_char(
7070

7171
pub fn submit(
7272
input: In<ConsoleActionSystemInput>,
73-
mut query: Query<(
74-
&mut ConsoleBuffer,
75-
&mut ConsoleInputText,
76-
&ConsoleAssetHandle<ConsoleHistory>,
77-
)>,
73+
mut query: Query<(&mut ConsoleInputText, &ConsoleAssetHandle<ConsoleHistory>)>,
7874
mut assets: ResMut<Assets<ConsoleHistory>>,
7975
mut commands: Commands,
8076
) {
81-
if let Ok((mut buffer, mut input_text, history_handle)) = query.get_mut(input.console_id) {
77+
if let Ok((mut input_text, history_handle)) = query.get_mut(input.console_id) {
8278
let history = assets.get_mut(history_handle.as_asset_id());
8379
if history.is_none() {
8480
error!("Failed to get console history!");
8581
return;
8682
}
8783
let history = history.unwrap();
88-
buffer.write("\n").unwrap();
84+
commands.write_message(ConsoleWriteMsg {
85+
message: "\n".to_string(),
86+
console_id: input.console_id,
87+
});
8988
if let Some(event) = SubmitEvent::new(input.console_id, input_text.text.clone()) {
9089
commands.trigger(event);
9190
} else {

0 commit comments

Comments
 (0)