diff --git a/src/ScintillaNET/Line.cs b/src/ScintillaNET/Line.cs index e8d4821..5aa63df 100644 --- a/src/ScintillaNET/Line.cs +++ b/src/ScintillaNET/Line.cs @@ -279,10 +279,11 @@ public unsafe string AnnotationText } set { - if (string.IsNullOrEmpty(value)) + // allow empty annotation, set to null to remove + if (value == null) { // Scintilla docs suggest that setting to NULL rather than an empty string will free memory - scintilla.DirectMessage(NativeMethods.SCI_ANNOTATIONGETTEXT, new IntPtr(Index), IntPtr.Zero); + scintilla.DirectMessage(NativeMethods.SCI_ANNOTATIONSETTEXT, new IntPtr(Index), IntPtr.Zero); } else {