mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Allow switching whitespace visibility in source code view.
This commit is contained in:
parent
53fe688bff
commit
e33690c5f3
@ -151,6 +151,7 @@ void View::InitTextEditor()
|
|||||||
m_textEditor = std::make_unique<TextEditor>();
|
m_textEditor = std::make_unique<TextEditor>();
|
||||||
m_textEditor->SetReadOnly( true );
|
m_textEditor->SetReadOnly( true );
|
||||||
m_textEditor->SetLanguageDefinition( TextEditor::LanguageDefinition::CPlusPlus() );
|
m_textEditor->SetLanguageDefinition( TextEditor::LanguageDefinition::CPlusPlus() );
|
||||||
|
m_textEditor->SetShowWhitespaces( m_textEditorWhitespace );
|
||||||
|
|
||||||
m_textEditorFile = nullptr;
|
m_textEditorFile = nullptr;
|
||||||
}
|
}
|
||||||
@ -8847,6 +8848,10 @@ void View::DrawTextEditor()
|
|||||||
TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), "/!\\" );
|
TextColoredUnformatted( ImVec4( 1.f, 1.f, 0.2f, 1.f ), "/!\\" );
|
||||||
#endif
|
#endif
|
||||||
TextFocused( "File:", m_textEditorFile );
|
TextFocused( "File:", m_textEditorFile );
|
||||||
|
if( SmallCheckbox( "Show whitespace", &m_textEditorWhitespace ) );
|
||||||
|
{
|
||||||
|
m_textEditor->SetShowWhitespaces( m_textEditorWhitespace );
|
||||||
|
}
|
||||||
if( m_textEditorFont ) ImGui::PushFont( m_textEditorFont );
|
if( m_textEditorFont ) ImGui::PushFont( m_textEditorFont );
|
||||||
m_textEditor->Render( m_textEditorFile, ImVec2(), true );
|
m_textEditor->Render( m_textEditorFile, ImVec2(), true );
|
||||||
if( m_textEditorFont ) ImGui::PopFont();
|
if( m_textEditorFont ) ImGui::PopFont();
|
||||||
|
@ -310,6 +310,7 @@ private:
|
|||||||
std::unique_ptr<TextEditor> m_textEditor;
|
std::unique_ptr<TextEditor> m_textEditor;
|
||||||
const char* m_textEditorFile;
|
const char* m_textEditorFile;
|
||||||
ImFont* m_textEditorFont;
|
ImFont* m_textEditorFont;
|
||||||
|
bool m_textEditorWhitespace = true;
|
||||||
|
|
||||||
float m_rootWidth, m_rootHeight;
|
float m_rootWidth, m_rootHeight;
|
||||||
SetTitleCallback m_stcb;
|
SetTitleCallback m_stcb;
|
||||||
|
Loading…
Reference in New Issue
Block a user