Skip to content

Commit 8daaea7

Browse files
committed
add abort compiling button
1 parent 00a52f0 commit 8daaea7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/main.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,7 @@ std::cout << vec.size() << std::endl;
321321
ImGui::GetTextLineHeight() * scale + 5);
322322
}
323323
// input for compiler flags with button to set it
324-
ImGui::Text("Compiler flags:");
325-
ImGui::SameLine();
326-
ImGui::PushItemWidth(ImGui::GetTextLineHeight() * 10.0);
327-
ImGui::InputText("", flags, 255);
328-
ImGui::SameLine();
329-
if (ImGui::Button("Set compiler flags")) {
324+
if (ImGui::Button("Set compiler flags:")) {
330325
size_t start;
331326
size_t end = 0;
332327
auto str = string(flags);
@@ -338,6 +333,9 @@ std::cout << vec.size() << std::endl;
338333
compiler.set_flags(args);
339334
}
340335
ImGui::SameLine();
336+
ImGui::PushItemWidth(ImGui::GetTextLineHeight() * 10.0);
337+
ImGui::InputText("", flags, 255);
338+
ImGui::SameLine();
341339
auto compile = ImGui::Button("Compile and run");
342340
ImGui::SameLine();
343341
if (ImGui::Button("Cleanup Plugins") && !compiler.IsCompiling()) {
@@ -355,6 +353,10 @@ std::cout << vec.size() << std::endl;
355353
ImGui::SameLine();
356354
if (ImGui::Button("Clear Output")) program_output.SetText("");
357355
ImGui::SameLine();
356+
if (ImGui::Button("Abort")) {
357+
compiler.AbortCompiling();
358+
}
359+
ImGui::SameLine();
358360
ImGui::Dummy({20, 0});
359361
ImGui::SameLine();
360362
ImGui::Text("Use Ctrl+Enter to submit code");

0 commit comments

Comments
 (0)