private void MainRepl_PreviewKeyDown(object sender, KeyEventArgs args) { if (args.IsCtrl(Key.E)) { RunSelection(MainRepl.Selection); args.Handled = true; } else if (args.Is(Key.Return)) { InsertSmartLineBreak(); args.Handled = true; } else if (args.Is(Key.Tab)) { MainRepl.CaretPosition.InsertTextInRun(" "); args.Handled = true; } else if (args.IsCtrl(Key.S)) { SaveDocument(); args.Handled = true; } else if (args.IsCtrl(Key.Return)) { RunCurrentLine(); args.Handled = true; } else if (args.IsCtrl(Key.Space)) { ChangeRunUnderCursorToDefaultTextStyle(); args.Handled = true; } }