|
|
@ -187,8 +187,16 @@ namespace ICSharpCode.SharpDevelop.Editor |
|
|
|
|
|
|
|
|
|
|
|
if (commentStartOffset >= 0) { |
|
|
|
if (commentStartOffset >= 0) { |
|
|
|
commentEndOffset = selectedText.IndexOf(commentEnd, commentStartOffset + commentStart.Length - editor.SelectionStart); |
|
|
|
commentEndOffset = selectedText.IndexOf(commentEnd, commentStartOffset + commentStart.Length - editor.SelectionStart); |
|
|
|
} else { |
|
|
|
} |
|
|
|
commentEndOffset = selectedText.IndexOf(commentEnd); |
|
|
|
|
|
|
|
|
|
|
|
// Try to search end of comment in whole selection
|
|
|
|
|
|
|
|
bool startAfterEnd = false; |
|
|
|
|
|
|
|
int commentEndOffsetWholeText = selectedText.IndexOf(commentEnd); |
|
|
|
|
|
|
|
if ((commentEndOffsetWholeText >= 0) && (commentEndOffsetWholeText < (commentStartOffset - editor.SelectionStart))) { |
|
|
|
|
|
|
|
// There seems to be an end offset before the start offset in selection
|
|
|
|
|
|
|
|
commentStartOffset = -1; |
|
|
|
|
|
|
|
startAfterEnd = true; |
|
|
|
|
|
|
|
commentEndOffset = commentEndOffsetWholeText; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (commentEndOffset >= 0) { |
|
|
|
if (commentEndOffset >= 0) { |
|
|
@ -205,7 +213,11 @@ namespace ICSharpCode.SharpDevelop.Editor |
|
|
|
offset = document.TextLength; |
|
|
|
offset = document.TextLength; |
|
|
|
} |
|
|
|
} |
|
|
|
string text = document.GetText(0, offset); |
|
|
|
string text = document.GetText(0, offset); |
|
|
|
|
|
|
|
if (startAfterEnd) { |
|
|
|
|
|
|
|
commentStartOffset = text.LastIndexOf(commentStart, editor.SelectionStart); |
|
|
|
|
|
|
|
} else { |
|
|
|
commentStartOffset = text.LastIndexOf(commentStart); |
|
|
|
commentStartOffset = text.LastIndexOf(commentStart); |
|
|
|
|
|
|
|
} |
|
|
|
if (commentStartOffset >= 0) { |
|
|
|
if (commentStartOffset >= 0) { |
|
|
|
// Find end of comment before comment start.
|
|
|
|
// Find end of comment before comment start.
|
|
|
|
commentEndBeforeStartOffset = text.IndexOf(commentEnd, commentStartOffset, editor.SelectionStart - commentStartOffset); |
|
|
|
commentEndBeforeStartOffset = text.IndexOf(commentEnd, commentStartOffset, editor.SelectionStart - commentStartOffset); |
|
|
|