Skip to content

Commit 877fb73

Browse files
committed
Do not show a caret / cursor in read-only mode
1 parent 9ef5438 commit 877fb73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

TextEditor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ void TextEditor::renderText() {
462462
//
463463

464464
void TextEditor::renderCursors() {
465+
// Read-only: no caret
466+
if (readOnly)
467+
return;
468+
465469
// update cursor animation timer
466470
cursorAnimationTimer = std::fmod(cursorAnimationTimer + ImGui::GetIO().DeltaTime, 1.0f);
467471

0 commit comments

Comments
 (0)