void OnTextReplacing (object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
		{
			lock (document) {
				if (lastChange == null)
					lastChange = new ChangeInfo (e.Offset, new System.Web.Razor.Text.SeekableTextReader ((sender as MonoDevelop.Ide.Editor.ITextDocument).Text));
				if (e.ChangeDelta > 0) {
					lastChange.Length += e.InsertionLength;
				} else {
					lastChange.Length -= e.RemovalLength;
				}
			}
		}
Example #2
0
 void OnTextReplacing(object sender, DocumentChangeEventArgs e)
 {
     if (lastChange == null)
     {
         lastChange = new ChangeInfo(e.Offset, new SeekableTextReader((sender as TextDocument).Text));
     }
     if (e.ChangeDelta > 0)
     {
         lastChange.Length += e.InsertionLength;
     }
     else
     {
         lastChange.Length -= e.RemovalLength;
     }
 }
Example #3
0
        static TextChange CreateTextChange(RazorCSharpParserContext context, SeekableTextReader source)
        {
            ChangeInfo lastChange = context.GetLastTextChange();

            if (lastChange == null)
            {
                return(new TextChange(0, 0, new SeekableTextReader(String.Empty), 0, source.Length, source));
            }
            if (lastChange.DeleteChange)
            {
                return(new TextChange(lastChange.StartOffset, lastChange.AbsoluteLength, lastChange.Buffer,
                                      lastChange.StartOffset, 0, source));
            }
            return(new TextChange(lastChange.StartOffset, 0, lastChange.Buffer, lastChange.StartOffset,
                                  lastChange.AbsoluteLength, source));
        }
Example #4
0
 void OnTextReplacing(object sender, MonoDevelop.Core.Text.TextChangeEventArgs e)
 {
     lock (document) {
         if (lastChange == null)
         {
             lastChange = new ChangeInfo(e.Offset, new System.Web.Razor.Text.SeekableTextReader((sender as MonoDevelop.Ide.Editor.ITextDocument).Text));
         }
         if (e.ChangeDelta > 0)
         {
             lastChange.Length += e.InsertionLength;
         }
         else
         {
             lastChange.Length -= e.RemovalLength;
         }
     }
 }
Example #5
0
 public void ClearLastTextChange()
 {
     lock (document)
         lastChange = null;
 }
		void OnTextReplacing (object sender, DocumentChangeEventArgs e)
		{
			if (lastChange == null)
				lastChange = new ChangeInfo (e.Offset, new SeekableTextReader((sender as TextDocument).Text));
			if (e.ChangeDelta > 0) {
				lastChange.Length += e.InsertionLength;
			} else {
				lastChange.Length -= e.RemovalLength;
			}
		}
		void ClearLastChange ()
		{
			lastChange = null;
		}
		public void ClearLastTextChange ()
		{
			lock (document)
				lastChange = null;
		}
Example #9
0
 void ClearLastChange()
 {
     lastChange = null;
 }