private void SetupEditor(LispEditor editor) { if (editor == null) { return; } editor.Scintilla.ConfigurationManager.Configure(this.scintillaConfig.ScintillaConfiguration); editor.Scintilla.IsBraceMatching = true; editor.Scintilla.Folding.IsEnabled = ConfigurationManager.EnableFolding; editor.Scintilla.Margins[2].Width = ConfigurationManager.EnableFolding ? FOLD_MARGIN_WIDTH : 0; editor.Scintilla.Margins[0].Width = ConfigurationManager.ShowLineNumbers ? LINE_NUMBERS_MARGIN_WIDTH : 0; editor.Scintilla.EndOfLine.IsVisible = ConfigurationManager.ShowEOL; editor.Scintilla.Whitespace.Mode = ConfigurationManager.ShowWhitespace ? WhitespaceMode.VisibleAlways : WhitespaceMode.Invisible; editor.Scintilla.LineWrap.Mode = ConfigurationManager.EnableWordWrap ? WrapMode.Word : WrapMode.None; editor.Scintilla.Indentation.Guides = ConfigurationManager.EnableIndentGuides ? IndentGuideView.LookForward : IndentGuideView.None; if (ConfigurationManager.Font != null) { editor.Scintilla.UseFont = true; editor.Scintilla.Font = ConfigurationManager.Font; editor.Scintilla.Styles[32].Font = ConfigurationManager.Font; } }
private void NewFile() { LispEditor editor = FileCommands.NewFile(); SetupEditor(editor); ShowEditor(editor, DockState.Document); }
private void ShowEditor(LispEditor editor, DockState dockState) { if (editor == null) { return; } editor.Show(this.dockPanel1, dockState); SetStatusLabels(); }
void closeAllButThisContextMenuItem_Click(object sender, EventArgs e) { IDockContent[] editors = this.parent.DockPanel.DocumentsToArray(); foreach (IDockContent editor in editors) { LispEditor leditor = editor as LispEditor; if (leditor != null && leditor != this.parent) { leditor.Close(); } } }
private void OpenFile(string filePath, DockState dockState) { // Ensure this file isn't already open if (!IsOpen(filePath)) { LispEditor editor = FileCommands.OpenFile(filePath); //Open the file if (editor != null) { SetupEditor(editor); ShowEditor(editor, dockState); } } }
private void dockPanel1_ActiveDocumentChanged(object sender, EventArgs e) { SetTitle(); if (this.activeDocument != null) { this.activeDocument.Scintilla.SelectionChanged -= Scintilla_SelectionChanged; this.activeDocument.Scintilla.DocumentChange -= Scintilla_DocumentChange; this.activeDocument.TextChanged -= ActiveDocument_TextChanged; } this.activeDocument = this.ActiveDocument; bool editItems = true; if (this.activeDocument == null) { editItems = false; this.eolFormatStatusLabel.Enabled = false; this.lineInfoStatusLabel.Enabled = false; this.lengthStatusLabel.Enabled = false; } else { this.eolFormatStatusLabel.Enabled = true; this.lineInfoStatusLabel.Enabled = true; this.lengthStatusLabel.Enabled = true; this.activeDocument.Scintilla.SelectionChanged += Scintilla_SelectionChanged; this.activeDocument.Scintilla.DocumentChange += Scintilla_DocumentChange; this.activeDocument.TextChanged += ActiveDocument_TextChanged; } SetStatusLabels(); SetToolstripItemsEnabled(editItems); }
private void SaveFile(LispEditor editor) { FileCommands.SaveFile(this, editor); }
public LispEditorContextMenu(LispEditor parent) : base() { this.parent = parent; InitializeComponent(); }
public LispEditorContextMenu(LispEditor parent, IContainer container) : base(container) { this.parent = parent; InitializeComponent(); }