Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange Visual Studio 2012 Exception: Unable to use Text Editor

Exceptions Thrown:

  • The specified SnapshotPoint or SnapshotSpan is on a different ITextSnapshot than this SnapshotSpan.
  • Attempted TextBuffer edit operation while another edit is in progress
  • Index was outside the bounds of the array

Attempted TextBuffer edit operation while another edit is in progress

Index was outside the bounds of the array

I currently have open a .ascx file and I was in the process of editing some html code that contained Knockout.js data-bind's. When editing the text in the file I was greeted by the above error and I am unable to backspace, delete, or edit the code. The Visual Studio text editor shifted all the colors as if it had no idea what code was on the screen.

Code in question:

<div class="paging item-pad-top clearfix">
   <ul>
      <li><a href="#" data-bind="click: grouped.moveFirst">«</a></li>           
          <!-- ko foreach: new Array(grouped.pageCount()) -->
              <<li>
                   <a data-bind='text: $index() + 1'/>
              </li>
          <!-- /ko -->
      <li><a href="#" data-bind="click: grouped.moveLast">»</a></li>   
   </ul>
</div>

Note that the second li has TWO < characters. I am unable to remove this second character.

I am running as administrator. I cannot edit any other code on this page.

like image 719
Andrew Quaschnick Avatar asked Jan 22 '14 16:01

Andrew Quaschnick


1 Answers

This error sometimes comes after the ActivityLog.xml file for the particular file you are editing gets corrupted. I have encountered the error a few times and from what it seems, ActivityLog.xml handles all the text edit operations for the associated file.

Closing and opening the file again should resolve the issue as it always did for mine.

like image 143
Nikhil Girraj Avatar answered Oct 12 '22 22:10

Nikhil Girraj