From ed61d4819169f9b33fc1d47223c15ab09b407164 Mon Sep 17 00:00:00 2001 From: HuberHans <16579621+HuberHans@users.noreply.github.com> Date: Thu, 4 Jun 2020 23:15:42 +0200 Subject: [PATCH] Update Line.cs bugfix set AnnotationText allow empty annotation, set to null to remove --- src/ScintillaNET/Line.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 {