/// <summary> /// Highlights the specified line. /// </summary> /// <param name="line">1-based index of the line to highlight. 0 or less to remove the highlight.</param> public override void HighlightLine(int line) { var doc = Editor.Document; line = Math.Min(line, doc.TotalNumberOfLines); line--; // Check if the line is already highlighted. if (Highlight != null && Highlight.LineNumber == line) { return; } // Remove highlight. if (Highlight != null) { doc.BookmarkManager.RemoveMark(Highlight); Highlight = null; } // Add new HighlightBookmark if line was greater than 0. if (line >= 0) { Highlight = new HighlightBookmark(doc, new TextLocation(0, line)); doc.BookmarkManager.AddMark(Highlight); Editor.ActiveTextAreaControl.Caret.Line = line; Editor.ActiveTextAreaControl.Caret.Column = 0; } }
/// <summary> /// Highlights the specified line. /// </summary> /// <param name="line">1-based index of the line to highlight. 0 or less to remove the highlight.</param> public override void HighlightLine(int line) { var doc = Editor.Document; line = Math.Min(line, doc.TotalNumberOfLines); line--; // Check if the line is already highlighted. if (Highlight != null && Highlight.LineNumber == line) return; // Remove highlight. if (Highlight != null) { doc.BookmarkManager.RemoveMark(Highlight); Highlight = null; } // Add new HighlightBookmark if line was greater than 0. if (line >= 0) { Highlight = new HighlightBookmark(doc, new TextLocation(0, line)); doc.BookmarkManager.AddMark(Highlight); Editor.ActiveTextAreaControl.Caret.Line = line; Editor.ActiveTextAreaControl.Caret.Column = 0; } }