public bool ExecuteCommand(NavigateToPreviousIssueInDocumentCommandArgs args, CommandExecutionContext executionContext) { var snapshot = args.TextView.TextSnapshot; var spans = this.GetTagSpansCollection(snapshot, args.ErrorTagTypeNames); if (spans.Count == 0) { return(true); } (int indexOfErrorSpan, bool containsPoint) = IndexOfTagSpanNearPoint(spans, args.TextView.Caret.Position.BufferPosition.Position); int nextIndex = indexOfErrorSpan - 1; if (containsPoint && (spans.Count == 1)) { // There is only one error tag and it contains the caret. Ensure it stays put. return(true); } // Wrap if needed. if (nextIndex < 0) { nextIndex = (spans.Count - 1); } args.TextView.Caret.MoveTo(new SnapshotPoint(snapshot, spans[nextIndex].Start)); args.TextView.Caret.EnsureVisible(); return(true); }
public CommandState GetCommandState(NavigateToPreviousIssueInDocumentCommandArgs args) => CommandState.Available;
public bool ExecuteCommand(NavigateToPreviousIssueInDocumentCommandArgs args, CommandExecutionContext executionContext) { return(NavigateToPreviousIssue(args, executionContext)); }