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;
				}
			}
		}
Пример #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;
     }
 }
Пример #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));
        }
Пример #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;
         }
     }
 }
Пример #5
0
 public void ClearLastTextChange()
 {
     lock (document)
         lastChange = null;
 }
Пример #6
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;
			}
		}
Пример #7
0
		void ClearLastChange ()
		{
			lastChange = null;
		}
		public void ClearLastTextChange ()
		{
			lock (document)
				lastChange = null;
		}
Пример #9
0
 void ClearLastChange()
 {
     lastChange = null;
 }