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; }
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; }
public static ViBuilderContext Create(ViEditor editor) { return(new ViBuilderContext(editor) { Builder = normalBuilder }); }
public void Build (ViEditor editor, Key key, char ch, ModifierType modifiers) { var k = ch == '\0'? new ViKey (modifiers, key) : new ViKey (modifiers, ch); Keys.Add (k); if (!Builder (this)) { Error = "Unknown command"; } }
public static void CaretToScreenBottom(ViEditor ed) { int line = ed.Editor.VisualToDocumentLocation(0, ed.Editor.Allocation.Height - ed.Editor.LineHeight * 2 - 2).Line; if (line < 0) { line = ed.Data.Document.LineCount - 1; } ed.Data.Caret.Line = line; }
public static void CaretToScreenCenter(ViEditor ed) { var line = ed.Editor.PointToLocation(0, ed.Editor.Bounds.Height / 2).Line; if (line < 0) { line = ed.Data.Document.LineCount; } ed.Data.Caret.Line = line; }
public static void CaretToScreenCenter(ViEditor ed) { var line = ed.Editor.VisualToDocumentLocation(0, ed.Editor.Allocation.Height / 2).Line; if (line < 0) { line = ed.Data.Document.LineCount - 1; } ed.Data.Caret.Line = line; }
public static void CaretToScreenBottom(ViEditor ed) { int line = ed.Editor.PointToLocation(0, ed.Editor.Bounds.Height - ed.Editor.LineHeight * 2 - 2).Line; if (line < 0) { line = ed.Data.Document.LineCount; } ed.Data.Caret.Line = line; }
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; }; }
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; } }; }
static void StartRegisterBuilder(ViBuilderContext ctx, ViBuilder nextBuilder) { if (ctx.Register != '\0') { ctx.Error = "Register already set"; return; } ctx.Builder = (ViBuilderContext x) => { char c = x.LastKey.Char; if (!ViEditor.IsValidRegister(c)) { x.Error = "Invalid register"; return(true); } x.Register = c; x.Builder = nextBuilder; return(true); }; }
protected override void CaretPositionChanged() { ViEditor.OnCaretPositionChanged(); }
protected override void OnAddedToEditor(TextEditorData data) { ViEditor.SetMode(ViEditorMode.Normal); SetCaretMode(CaretMode.Block, data); ViActions.RetreatFromLineEnd(data); }
public NewViEditMode() { ViEditor = new ViEditor(this); }
ViBuilderContext (ViEditor editor) { this.editor = editor; Multiplier = 1; }
public static void CaretToScreenTop (ViEditor ed) { ed.Data.Caret.Line = System.Math.Max (0, ed.Editor.PointToLocation (0, ed.Editor.LineHeight - 1).Line); }
public static void CaretToLineNumber(int lineNumber, ViEditor ed) { ed.Data.Caret.Line = System.Math.Max(1, lineNumber); }
public static void CaretToScreenTop(ViEditor ed) { ed.Data.Caret.Line = System.Math.Max(0, ed.Editor.VisualToDocumentLocation(0, ed.Editor.LineHeight - 1).Line); }
public static void CaretToLineNumber (int lineNumber, ViEditor ed) { ed.Data.Caret.Line = System.Math.Max (1, lineNumber); }
public static void CaretToScreenTop(ViEditor ed) { ed.Data.Caret.Line = System.Math.Max(0, ed.Editor.PointToLocation(0, ed.Editor.LineHeight - 1).Line); }
ViBuilderContext(ViEditor editor) { this.editor = editor; Multiplier = 1; }
public NewViEditMode () { ViEditor = new ViEditor (this); }
public static ViBuilderContext Create (ViEditor editor) { return new ViBuilderContext (editor) { Builder = normalBuilder }; }