Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vendor/regex"]
path = vendor/regex
url = git@github.com:boostorg/regex.git
url = https://github.com/boostorg/regex.git
72 changes: 37 additions & 35 deletions ImGuiDebugPanel.cpp
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
#include "TextEditor.h"

void TextEditor::ImGuiDebugPanel(const std::string& panelName)
{
ImGui::Begin(panelName.c_str());

if (ImGui::CollapsingHeader("Editor state info"))
namespace ImGuiColorTextEdit {
void TextEditor::ImGuiDebugPanel(const std::string& panelName)
{
ImGui::Checkbox("Panning", &mState.mPanning);
ImGui::DragInt("Cursor count", &mState.mCurrentCursor);
for (int i = 0; i <= mState.mCurrentCursor; i++)
ImGui::Begin(panelName.c_str());

if (ImGui::CollapsingHeader("Editor state info"))
{
ImGui::DragInt2("Cursor", &mState.mCursors[i].mCursorPosition.mLine);
ImGui::DragInt2("Selection start", &mState.mCursors[i].mSelectionStart.mLine);
ImGui::DragInt2("Selection end", &mState.mCursors[i].mSelectionEnd.mLine);
ImGui::DragInt2("Interactive start", &mState.mCursors[i].mInteractiveStart.mLine);
ImGui::DragInt2("Interactive end", &mState.mCursors[i].mInteractiveEnd.mLine);
ImGui::Checkbox("Panning", &mState.mPanning);
ImGui::DragInt("Cursor count", &mState.mCurrentCursor);
for (int i = 0; i <= mState.mCurrentCursor; i++)
{
ImGui::DragInt2("Cursor", &mState.mCursors[i].mCursorPosition.mLine);
ImGui::DragInt2("Selection start", &mState.mCursors[i].mSelectionStart.mLine);
ImGui::DragInt2("Selection end", &mState.mCursors[i].mSelectionEnd.mLine);
ImGui::DragInt2("Interactive start", &mState.mCursors[i].mInteractiveStart.mLine);
ImGui::DragInt2("Interactive end", &mState.mCursors[i].mInteractiveEnd.mLine);
}
}
}
if (ImGui::CollapsingHeader("Undo"))
{
static std::string numberOfRecordsText;
numberOfRecordsText = "Number of records: " + std::to_string(mUndoBuffer.size());
ImGui::Text("%s", numberOfRecordsText.c_str());
ImGui::DragInt("Undo index", &mState.mCurrentCursor);
for (int i = 0; i < mUndoBuffer.size(); i++)
if (ImGui::CollapsingHeader("Undo"))
{
if (ImGui::CollapsingHeader(std::to_string(i).c_str()))
static std::string numberOfRecordsText;
numberOfRecordsText = "Number of records: " + std::to_string(mUndoBuffer.size());
ImGui::Text("%s", numberOfRecordsText.c_str());
ImGui::DragInt("Undo index", &mState.mCurrentCursor);
for (int i = 0; i < mUndoBuffer.size(); i++)
{

ImGui::Text("Operations");
for (int j = 0; j < mUndoBuffer[i].mOperations.size(); j++)
if (ImGui::CollapsingHeader(std::to_string(i).c_str()))
{
ImGui::Text("%s", mUndoBuffer[i].mOperations[j].mText.c_str());
ImGui::Text(mUndoBuffer[i].mOperations[j].mType == UndoOperationType::Add ? "Add" : "Delete");
ImGui::DragInt2("Start", &mUndoBuffer[i].mOperations[j].mStart.mLine);
ImGui::DragInt2("End", &mUndoBuffer[i].mOperations[j].mEnd.mLine);
ImGui::Separator();

ImGui::Text("Operations");
for (int j = 0; j < mUndoBuffer[i].mOperations.size(); j++)
{
ImGui::Text("%s", mUndoBuffer[i].mOperations[j].mText.c_str());
ImGui::Text(mUndoBuffer[i].mOperations[j].mType == UndoOperationType::Add ? "Add" : "Delete");
ImGui::DragInt2("Start", &mUndoBuffer[i].mOperations[j].mStart.mLine);
ImGui::DragInt2("End", &mUndoBuffer[i].mOperations[j].mEnd.mLine);
ImGui::Separator();
}
}
}
}
if (ImGui::Button("Run unit tests"))
{
UnitTests();
}
ImGui::End();
}
if (ImGui::Button("Run unit tests"))
{
UnitTests();
}
ImGui::End();
}
Loading