hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/ui/source_view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/source_view.cpp')
-rw-r--r--src/ui/source_view.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ui/source_view.cpp b/src/ui/source_view.cpp
index a98594c..f9a3f85 100644
--- a/src/ui/source_view.cpp
+++ b/src/ui/source_view.cpp
@@ -259,8 +259,7 @@ namespace Hsdbg
while (at < size && is_word(line[at]))
++at;
- const std::string_view word =
- std::string_view(line).substr(start, at - start);
+ const std::string_view word = std::string_view(line).substr(start, at - start);
SyntaxKind kind = classify_word(word, language);
if (kind == SyntaxKind::Default && language == Language::Cpp &&
@@ -479,25 +478,31 @@ namespace Hsdbg
if (m_lines.empty())
{
- ImGui::TextDisabled("no source file open");
+ ImGui::TextDisabled("No source file open");
return;
}
+ if (m_mono_font != nullptr)
+ ImGui::PushFont(m_mono_font, 0.0f);
+
draw_lines(debugger);
+
+ if (m_mono_font != nullptr)
+ ImGui::PopFont();
}
auto SourceView::draw_open_bar() -> void
{
- ImGui::SetNextItemWidth(-ImGui::CalcTextSize("open").x - ImGui::GetStyle().FramePadding.x * 4.0f);
+ ImGui::SetNextItemWidth(-ImGui::CalcTextSize("Open").x - ImGui::GetStyle().FramePadding.x * 4.0f);
const bool submitted = ImGui::InputTextWithHint("##source_path",
- "path to a source file",
+ "Path to a source file",
&m_path_input,
ImGuiInputTextFlags_EnterReturnsTrue);
ImGui::SameLine();
- if (ImGui::Button("open") || submitted)
+ if (ImGui::Button("Open") || submitted)
{
if (const auto result = open(m_path_input); !result)
{
@@ -530,9 +535,9 @@ namespace Hsdbg
m_scroll_to_highlight = false;
}
- const std::span<const Variable> locals =
- (debugger.is_stopped() && m_highlighted_line != 0) ? debugger.locals()
- : std::span<const Variable>{};
+ const std::span<const Variable> locals = debugger.is_stopped() && m_highlighted_line != 0
+ ? debugger.locals()
+ : std::span<const Variable>{};
ImGuiListClipper clipper;
clipper.Begin(static_cast<int>(m_lines.size()), text_height);
@@ -743,7 +748,7 @@ namespace Hsdbg
const size_t steps = expansion.levels.size() - 1;
if (steps == 0)
- ImGui::TextDisabled("no expansion");
+ ImGui::TextDisabled("No expansion");
else if (!expansion.fully_expanded())
ImGui::TextDisabled("%zu+ levels — click to step through", steps);
else