1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Initialize text editor.

This commit is contained in:
Bartosz Taudul
2018-08-17 14:44:41 +02:00
parent a90ed5b4b8
commit 9dbc56beb6
4 changed files with 30 additions and 0 deletions
+13
View File
@@ -19,6 +19,8 @@
#include "TracyPopcnt.hpp"
#include "TracyView.hpp"
#include "../imguicolortextedit/TextEditor.h"
#ifdef TRACY_FILESELECTOR
# include "../nfd/nfd.h"
#endif
@@ -333,6 +335,8 @@ View::View( const char* addr )
ImGuiStyle& style = ImGui::GetStyle();
style.FrameRounding = 2.f;
InitTextEditor();
}
View::View( FileRead& f )
@@ -373,6 +377,8 @@ View::View( FileRead& f )
{
assert( s_instance == nullptr );
s_instance = this;
InitTextEditor();
}
View::~View()
@@ -385,6 +391,13 @@ View::~View()
s_instance = nullptr;
}
void View::InitTextEditor()
{
m_textEditor = std::make_unique<TextEditor>();
m_textEditor->SetReadOnly( true );
m_textEditor->SetLanguageDefinition( TextEditor::LanguageDefinition::CPlusPlus() );
}
const char* View::ShortenNamespace( const char* name ) const
{
if( m_namespace == Namespace::Full ) return name;