예제 #1
0
        public void RefreshAfterNormalEdit()
        {
            var lineView = new AdornedTextViewStub();
            IReadOnlyList <ViewLineStub> changedLines =
                new List <ViewLineStub>(lineView.Lines.Skip(3).Take(5));

            foreach (var line in changedLines)
            {
                line.AdornmentCount = 0;
            }

            EolAdornment.RefreshAdornments(lineView, changedLines);

            AssertAllLinesHaveSingleAdornment(lineView);
        }
예제 #2
0
        public void RefreshAfterPressingEnterOnEmptyLine()
        {
            // When pressing enter on an empty line VS2013 removes the
            // adornment of the empty line, but only sends the newly
            // created line below in e.NewOrReformattedLines
            var lineView = new AdornedTextViewStub();

            lineView.Lines[4].AdornmentCount = 0;
            var newLine = lineView.Lines[5];

            newLine.AdornmentCount = 0;
            var changedLines = new[] { newLine };

            EolAdornment.RefreshAdornments(lineView, changedLines);
            AssertAllLinesHaveSingleAdornment(lineView);
        }
예제 #3
0
        public void RefreshAfterChangingEndingsOfMultipleRunsOfEmptyLines()
        {
            // When Visual studio changes the line endings of multiple runs
            // of empty lines as a single edit, there may be more than one
            // leading line that has been omitted from
            // e.NewOrReformattedLines.
            var lineView     = new AdornedTextViewStub();
            var changedLines = new List <ViewLineStub>();

            foreach (int i in new[] { 2, 3, 7, 8 })
            {
                lineView.Lines[i - 1].AdornmentCount = 0;
                lineView.Lines[i].AdornmentCount     = 0;
                changedLines.Add(lineView.Lines[i]);
            }

            EolAdornment.RefreshAdornments(lineView, changedLines);
            AssertAllLinesHaveSingleAdornment(lineView);
        }