public static ViBuilderContext Create(ViEditor editor)
 {
     return(new ViBuilderContext(editor)
     {
         Builder = normalBuilder
     });
 }
Beispiel #2
0
 public static void CaretToScreenBottom(ViEditor ed)
 {
     int line = ed.Editor.PointToLocation (0, ed.Editor.Allocation.Height - ed.Editor.LineHeight * 2 - 2).Line;
     if (line < 0)
         line = ed.Data.Document.LineCount;
     ed.Data.Caret.Line = line;
 }
Beispiel #3
0
 public static void CaretToScreenCenter(ViEditor ed)
 {
     var line = ed.Editor.PointToLocation (0, ed.Editor.Allocation.Height/2).Line;
     if (line < 0)
         line = ed.Data.Document.LineCount;
     ed.Data.Caret.Line = line;
 }
Beispiel #4
0
        public static void CaretToScreenBottom(ViEditor ed)
        {
            int line = ed.Editor.PointToLocation(0, ed.Editor.Allocation.Height - ed.Editor.LineHeight * 2 - 2).Line;

            if (line < 0)
            {
                line = ed.Data.Document.LineCount;
            }
            ed.Data.Caret.Line = line;
        }
Beispiel #5
0
        public static void CaretToScreenCenter(ViEditor ed)
        {
            var line = ed.Editor.PointToLocation(0, ed.Editor.Allocation.Height / 2).Line;

            if (line < 0)
            {
                line = ed.Data.Document.LineCount;
            }
            ed.Data.Caret.Line = line;
        }
Beispiel #6
0
 public NewViEditMode()
 {
     ViEditor = new ViEditor (this);
     ViEditor.ModeChanged += (sender, e) => {
         if (statusArea != null)
             statusArea.ShowCaret = ViEditor.Mode == ViEditorMode.Command;
     };
     ViEditor.MessageChanged += (sender, e) => {
         if (statusArea != null)
             statusArea.Message = ViEditor.Message;
     };
 }
Beispiel #7
0
 public NewViEditMode()
 {
     ViEditor              = new ViEditor(this);
     ViEditor.ModeChanged += (sender, e) => {
         if (statusArea != null)
         {
             statusArea.ShowCaret = ViEditor.Mode == ViEditorMode.Command;
         }
     };
     ViEditor.MessageChanged += (sender, e) => {
         if (statusArea != null)
         {
             statusArea.Message = ViEditor.Message;
         }
     };
 }
Beispiel #8
0
 static void StartRegisterBuilder(ViBuilderContext ctx, ViBuilder nextBuilder)
 {
     if (ctx.Register != '\0')
     {
         ctx.SetError("Register already set");
         return;
     }
     ctx.Builder = (ViBuilderContext x) => {
         char c = x.LastKey.Char;
         if (!ViEditor.IsValidRegister(c))
         {
             x.SetError("Invalid register");
             return(true);
         }
         x.Register = c;
         x.Builder  = nextBuilder;
         return(true);
     };
 }
Beispiel #9
0
 public static ViBuilderContext Create(ViEditor editor)
 {
     return new ViBuilderContext (editor) {
         Builder = normalBuilder
     };
 }
Beispiel #10
0
 ViBuilderContext(ViEditor editor)
 {
     this.editor = editor;
     Multiplier = 1;
 }
Beispiel #11
0
 protected override void CaretPositionChanged()
 {
     ViEditor.OnCaretPositionChanged();
 }
Beispiel #12
0
 ViBuilderContext(ViEditor editor)
 {
     this.editor = editor;
     Multiplier  = 1;
 }
Beispiel #13
0
 public static void CaretToScreenTop(ViEditor ed)
 {
     ed.Data.Caret.Line = System.Math.Max (0, ed.Editor.PointToLocation (0, ed.Editor.LineHeight - 1).Line);
 }
Beispiel #14
0
 public static void CaretToLineNumber(int lineNumber, ViEditor ed)
 {
     ed.Data.Caret.Line = System.Math.Max (1, lineNumber);
 }
Beispiel #15
0
 public static void CaretToLineNumber(int lineNumber, ViEditor ed)
 {
     ed.Data.Caret.Line = System.Math.Max(1, lineNumber);
 }
Beispiel #16
0
 public static void CaretToScreenTop(ViEditor ed)
 {
     ed.Data.Caret.Line = System.Math.Max(0, ed.Editor.PointToLocation(0, ed.Editor.LineHeight - 1).Line);
 }