示例#1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (File.Exists(ConfigurationManager.AppSettings["neovim_path"]))
                {
                    _neovim         = new NeovimClient(ConfigurationManager.AppSettings["neovim_path"]);
                    _neovim.Redraw += OnRedraw;
                    _neovim.ui_attach(80, 24, true);

                    this.KeyDown     += term_KeyDown;
                    Grid.SizeChanged += Window_SizeChanged;
                }
                else
                {
                    MessageBox.Show("Couldn't find the neovim executable at location [" +
                                    ConfigurationManager.AppSettings["neovim_path"] +
                                    "]\r\nIt may be missing, inaccessible or you may need to change Neovim.cs XML configuration.");
                    Environment.Exit(1);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("There was an error starting the NeovimClient.\r\n" + ex.ToString());
                Environment.Exit(1);
            }
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            _uiContext = SynchronizationContext.Current;
            _neovim    = new NeovimClient(@"C:\Program Files\Neovim\bin\nvim.exe");
            // Event is asynchronous so we need to handle the redraw event in the UI thread
            _neovim.Redraw += (o, args) => _uiContext.Post((x) => NeovimOnRedraw(o, args), null);
            _neovim.ui_attach(_columns, _rows, true);
        }
示例#3
0
        public static void ClassInit(TestContext context)
        {
            var info = new ProcessStartInfo("neovim/nvim.exe", "--embed --headless");

            info.CreateNoWindow  = true;
            info.UseShellExecute = false;
            info.EnvironmentVariables.Add("NVIM_LISTEN_ADDRESS", "127.0.0.1:20000");

            proc           = new Process();
            proc.StartInfo = info;
            proc.Start();

            nvim = new NeovimClient <NeovimTcp>(new NeovimTcp("127.0.0.1", 20000));
            nvim.Init();
        }
示例#4
0
        public MainWindow()
        {
            log.Debug("Enter a constructor");
            Text = "Codesanook Vim Animation";

            InitializeComponent();
            SuspendLayout();

            // glControl
            glControl = new GLControl
            {
                Font = new Font(
                    "Consolas",
                    15F,
                    FontStyle.Regular,
                    GraphicsUnit.Point,
                    0
                    ),

                Location = new Point(0, 0),
                Margin   = new Padding(10),
                Name     = "glControl",
                TabIndex = 0,
                VSync    = false,
                Dock     = DockStyle.Fill
            };

            glControl.Load    += new EventHandler(glControl_Load);
            glControl.Paint   += new PaintEventHandler(glControl_Paint);
            glControl.KeyDown += new KeyEventHandler(glControl_KeyDown);

            mainPanel.Controls.Add(glControl);
            Name = "MainWindow";
            ResumeLayout(false);
            uiContext = SynchronizationContext.Current;

            neovim = new NeovimClient(neoVimPath);

            // Event is asynchronous so we need to handle the redraw event in the UI thread
            neovim.Redraw += (obj, args) => uiContext.Post(x => NeovimOnRedraw(obj, args), null);
            neovim.ui_attach(columns, rows, true);
        }
示例#5
0
 public static void ClassInit(TestContext context)
 {
     nvim = new NeovimClient <NeovimHost>(new NeovimHost("neovim/nvim.exe"));
     nvim.Init();
 }