Browse Source

fixed +-1 issue.

newNRvisualizers
Mike Krüger 15 years ago
parent
commit
96195ac0ef
  1. 4
      ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs

4
ICSharpCode.NRefactory/Editor/ReadOnlyDocument.cs

@ -151,10 +151,10 @@ namespace ICSharpCode.NRefactory.Editor @@ -151,10 +151,10 @@ namespace ICSharpCode.NRefactory.Editor
if (line < 1 || line > lines.Length)
throw new ArgumentOutOfRangeException("line", line, "Value must be between 1 and " + lines.Length);
int lineStart = GetStartOffset(line);
if (column <= 0)
if (column <= 1)
return lineStart;
int lineEnd = GetEndOffset(line);
if (column >= lineEnd - lineStart)
if (column - 1 >= lineEnd - lineStart)
return lineEnd;
return lineStart + column - 1;
}

Loading…
Cancel
Save