diff --git a/CSharpMath.Editor/Keyboards/MathKeyboard.cs b/CSharpMath.Editor/Keyboards/MathKeyboard.cs index b85532cc2..ac1ce654d 100644 --- a/CSharpMath.Editor/Keyboards/MathKeyboard.cs +++ b/CSharpMath.Editor/Keyboards/MathKeyboard.cs @@ -662,12 +662,14 @@ void VisualizePlaceholders(IMathList mathList) { } } VisualizePlaceholders(MathList); - if(MathList.AtomAt(_insertionIndex) is IMathAtom atom && atom.AtomType is MathAtomType.Placeholder) + if (MathList.AtomAt(_insertionIndex) is IMathAtom atom && atom.AtomType is MathAtomType.Placeholder) { atom.Nucleus = Symbols.BlackSquare; - /* Find the insert point rect and create a caretView to draw the caret at this position. */ - + Caret = null; + } else { + /* Find the insert point rect and create a caretView to draw the caret at this position. */ + Caret = new CaretHandle(Font.PointSize); + } // Check that we were returned a valid position before displaying a caret there. - Caret = new CaretHandle(Font.PointSize); RecreateDisplayFromMathList(); RedrawRequested?.Invoke(this, EventArgs.Empty); }