fix(fn-run): propagar stdout/stderr de bash functions library-style #1

Open
dataforge wants to merge 537 commits from auto/0077-fn-run-bash-mudo into master
2 changed files with 25 additions and 0 deletions
Showing only changes of commit bdce314199 - Show all commits
Binary file not shown.
+25
View File
@@ -95,6 +95,8 @@ bool dag_panel(std::vector<DagStep>& pipeline) {
int delete_idx = -1;
int move_up_idx = -1;
int move_down_idx = -1;
int drop_src_idx = -1;
int drop_target_idx = -1;
ImGui::BeginChild("dag_pipeline_scroll", ImVec2(0, 0), false);
@@ -115,6 +117,19 @@ bool dag_panel(std::vector<DagStep>& pipeline) {
ImGui::PopStyleColor(3);
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID)) {
ImGui::SetDragDropPayload("DAG_STEP", &i, sizeof(int));
ImGui::Text("Move %s", def->label.c_str());
ImGui::EndDragDropSource();
}
if (ImGui::BeginDragDropTarget()) {
if (const ImGuiPayload* pl = ImGui::AcceptDragDropPayload("DAG_STEP")) {
drop_src_idx = *static_cast<const int*>(pl->Data);
drop_target_idx = i;
}
ImGui::EndDragDropTarget();
}
if (open) {
ImGui::Indent(8.0f);
@@ -221,6 +236,16 @@ bool dag_panel(std::vector<DagStep>& pipeline) {
std::swap(pipeline[static_cast<size_t>(move_down_idx)], pipeline[static_cast<size_t>(move_down_idx + 1)]);
changed = true;
}
if (drop_src_idx >= 0 && drop_target_idx >= 0 && drop_src_idx != drop_target_idx &&
drop_src_idx < static_cast<int>(pipeline.size()) &&
drop_target_idx < static_cast<int>(pipeline.size())) {
DagStep moved = pipeline[static_cast<size_t>(drop_src_idx)];
pipeline.erase(pipeline.begin() + drop_src_idx);
int target = drop_target_idx;
if (drop_src_idx < drop_target_idx) target--;
pipeline.insert(pipeline.begin() + target, moved);
changed = true;
}
return changed;
}