public UndoRedoStruct(BeforeModificationEventArgs e, UndoRedoAction Action)
 {
     Position       = e.Position;
     Length         = e.Text.Length;
     Text           = e.Text;
     UndoRedoAction = Action;
 }
        private void beforeDelete(object sender, BeforeModificationEventArgs e)
        {
            if (CanUndoRedo)
            {
                UndoRedoStruct ne = new UndoRedoStruct(e, UndoRedoAction.Delete);
                undoRedoList.Add(ne);
            }
            if (adding && e.Text.Length == 1)
            {
                if (sb.Length > 3)
                {
                    sb.Remove(sb.Length - 1, 1);
                    autocom.SearchPattern = sb.ToString();
                    List <AutocompleteItem> items = new List <AutocompleteItem>();

                    List <string> s = code.FilterAutocompleteWords(autocom.SearchPattern);

                    foreach (string def in s)
                    {
                        items.Add(new SnippetAutocompleteItem(def));
                    }
                    curpos = CurrentPosition;
                    autocom.SetAutocompleteItems(items);
                    autocom.CaptureFocus = false;
                    autocom.Show(this, true);
                }
                else
                {
                    autocom.Close();
                }
            }
            curLinesLen = Lines.Count;
        }
 public void OnBeforeTextInsert(object sender, BeforeModificationEventArgs e)
 {
     if (isFileLoading)
     {
         return;
     }
     m_NLEvent.Set((Scintilla)sender, e);
 }
Beispiel #4
0
            public void Set(ScintillaNET.Scintilla ed, BeforeModificationEventArgs e)
            {
                int len = 0;

                if (e.Text != null)
                {
                    len = e.Text.Length;
                }
                Set(ed,
                    e.Position,
                    len
                    );
            }
        public void OnBeforeTextDelete(object sender, BeforeModificationEventArgs e)
        {
            m_NLEvent.Set((Scintilla)sender, e);
            if (!m_NLEvent.isEnable)
            {
                return;
            }
            Scintilla        ed  = (Scintilla)sender;
            NewLineEventArgs nlE = new NewLineEventArgs(ed, e, m_NLEvent, NewLineEventArgs.DELETE);

            this.NewLineChanged(ed, nlE);
            UtilMarker.DeletRightMarginMarker(ed);
            this.SideMarginPaint(ed, new EventArgs());
        }
        private void beforeInsert(object sender, BeforeModificationEventArgs e)
        {
            if (CanUndoRedo)
            {
                UndoRedoStruct ne = new UndoRedoStruct(e, UndoRedoAction.Insert);
                undoRedoList.Add(ne);
            }
            int  lineIndex = LineFromPosition(e.Position);
            Line Curl      = Lines[lineIndex];
            int  linePos   = Curl.Position;

            code.ClearFlags();
            code.AddLinesAt(lineIndex, linePos, e.Position, e.Text);
        }
Beispiel #7
0
 public NewLineEventArgs(ScintillaNET.Scintilla ed, BeforeModificationEventArgs e, NewLine nl, int k)
 {
     kind = k;
     m_NL.Set(ed, e);
 }
Beispiel #8
0
 private void scintillaControl_BeforeDelete(object sender, BeforeModificationEventArgs e)
 {
     ScintillaTextModified();
 }