LuaWriter. Pressing Enter when there's no if, while, for, etc.. will add the tabs that the previous line had.

This commit is contained in:
rolanmen1 2012-08-09 20:18:43 +00:00
parent 5239b4f55b
commit 4771ba0f15
2 changed files with 338 additions and 337 deletions

View File

@ -28,106 +28,106 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LuaWriter)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LuaWriter));
this.timer = new System.Windows.Forms.Timer(this.components); this.timer = new System.Windows.Forms.Timer(this.components);
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.replaceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.goToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.goToToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.configToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.configToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.fontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.syntaxHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.syntaxHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.backgroundColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.startWithEmptyScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.restoreSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.startWithEmptyScriptToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MessageLabel = new System.Windows.Forms.Label(); this.restoreSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.AutoCompleteView = new System.Windows.Forms.ListView(); this.MessageLabel = new System.Windows.Forms.Label();
this.PositionLabel = new System.Windows.Forms.Label(); this.AutoCompleteView = new System.Windows.Forms.ListView();
this.ZoomLabel = new System.Windows.Forms.Label(); this.PositionLabel = new System.Windows.Forms.Label();
this.LuaText = new BizHawk.MultiClient.LuaWriterBox(); this.ZoomLabel = new System.Windows.Forms.Label();
this.backgroundColorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.LuaText = new BizHawk.MultiClient.LuaWriterBox();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// timer // timer
// //
this.timer.Enabled = true; this.timer.Enabled = true;
this.timer.Interval = 1000; this.timer.Interval = 1000;
this.timer.Tick += new System.EventHandler(this.timer_Tick); this.timer.Tick += new System.EventHandler(this.timer_Tick);
// //
// menuStrip1 // menuStrip1
// //
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem, this.fileToolStripMenuItem,
this.editToolStripMenuItem, this.editToolStripMenuItem,
this.configToolStripMenuItem}); this.configToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(474, 24); this.menuStrip1.Size = new System.Drawing.Size(474, 24);
this.menuStrip1.TabIndex = 1; this.menuStrip1.TabIndex = 1;
this.menuStrip1.Text = "menuStrip1"; this.menuStrip1.Text = "menuStrip1";
// //
// fileToolStripMenuItem // fileToolStripMenuItem
// //
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.saveToolStripMenuItem, this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem, this.saveAsToolStripMenuItem,
this.toolStripSeparator1, this.toolStripSeparator1,
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File"; this.fileToolStripMenuItem.Text = "&File";
// //
// saveToolStripMenuItem // saveToolStripMenuItem
// //
this.saveToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.SaveAs; this.saveToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.SaveAs;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.saveToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.saveToolStripMenuItem.Text = "&Save"; this.saveToolStripMenuItem.Text = "&Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
// //
// saveAsToolStripMenuItem // saveAsToolStripMenuItem
// //
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) this.saveAsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.S))); | System.Windows.Forms.Keys.S)));
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.saveAsToolStripMenuItem.Text = "Save &As..."; this.saveAsToolStripMenuItem.Text = "Save &As...";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6);
// //
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4"; this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(195, 22); this.exitToolStripMenuItem.Size = new System.Drawing.Size(195, 22);
this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
// //
// editToolStripMenuItem // editToolStripMenuItem
// //
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.undoToolStripMenuItem, this.undoToolStripMenuItem,
this.redoToolStripMenuItem, this.redoToolStripMenuItem,
this.toolStripSeparator2, this.toolStripSeparator2,
@ -140,239 +140,239 @@
this.searchToolStripMenuItem, this.searchToolStripMenuItem,
this.replaceToolStripMenuItem, this.replaceToolStripMenuItem,
this.goToToolStripMenuItem}); this.goToToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "Edit"; this.editToolStripMenuItem.Text = "Edit";
// //
// undoToolStripMenuItem // undoToolStripMenuItem
// //
this.undoToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.undo; this.undoToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.undo;
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem"; this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z))); this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
this.undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.undoToolStripMenuItem.Text = "Undo"; this.undoToolStripMenuItem.Text = "Undo";
this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click); this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click);
// //
// redoToolStripMenuItem // redoToolStripMenuItem
// //
this.redoToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.redo; this.redoToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.redo;
this.redoToolStripMenuItem.Name = "redoToolStripMenuItem"; this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y))); this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.redoToolStripMenuItem.Text = "Redo"; this.redoToolStripMenuItem.Text = "Redo";
this.redoToolStripMenuItem.Click += new System.EventHandler(this.redoToolStripMenuItem_Click); this.redoToolStripMenuItem.Click += new System.EventHandler(this.redoToolStripMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(161, 6);
// //
// cutToolStripMenuItem // cutToolStripMenuItem
// //
this.cutToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CutHS; this.cutToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.CutHS;
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem"; this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.cutToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.cutToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.cutToolStripMenuItem.Text = "Cut"; this.cutToolStripMenuItem.Text = "Cut";
this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click); this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
// //
// copyToolStripMenuItem // copyToolStripMenuItem
// //
this.copyToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Duplicate; this.copyToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Duplicate;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem"; this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.copyToolStripMenuItem.Text = "Copy"; this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click); this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
// //
// pasteToolStripMenuItem // pasteToolStripMenuItem
// //
this.pasteToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Paste; this.pasteToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.Paste;
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.pasteToolStripMenuItem.Text = "Paste"; this.pasteToolStripMenuItem.Text = "Paste";
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click); this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
// //
// toolStripSeparator3 // toolStripSeparator3
// //
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(161, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(161, 6);
// //
// selectAllToolStripMenuItem // selectAllToolStripMenuItem
// //
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.selectAllToolStripMenuItem.Text = "Select All"; this.selectAllToolStripMenuItem.Text = "Select All";
this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click); this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click);
// //
// toolStripSeparator4 // toolStripSeparator4
// //
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(161, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(161, 6);
// //
// searchToolStripMenuItem // searchToolStripMenuItem
// //
this.searchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS; this.searchToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.FindHS;
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); this.searchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this.searchToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.searchToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.searchToolStripMenuItem.Text = "Search"; this.searchToolStripMenuItem.Text = "Search";
// //
// replaceToolStripMenuItem // replaceToolStripMenuItem
// //
this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem"; this.replaceToolStripMenuItem.Name = "replaceToolStripMenuItem";
this.replaceToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H))); this.replaceToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.H)));
this.replaceToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.replaceToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.replaceToolStripMenuItem.Text = "Replace"; this.replaceToolStripMenuItem.Text = "Replace";
// //
// goToToolStripMenuItem // goToToolStripMenuItem
// //
this.goToToolStripMenuItem.Name = "goToToolStripMenuItem"; this.goToToolStripMenuItem.Name = "goToToolStripMenuItem";
this.goToToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); this.goToToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G)));
this.goToToolStripMenuItem.Size = new System.Drawing.Size(164, 22); this.goToToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
this.goToToolStripMenuItem.Text = "Go to..."; this.goToToolStripMenuItem.Text = "Go to...";
this.goToToolStripMenuItem.Click += new System.EventHandler(this.goToToolStripMenuItem_Click); this.goToToolStripMenuItem.Click += new System.EventHandler(this.goToToolStripMenuItem_Click);
// //
// configToolStripMenuItem // configToolStripMenuItem
// //
this.configToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.configToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fontToolStripMenuItem, this.fontToolStripMenuItem,
this.syntaxHighlightingToolStripMenuItem, this.syntaxHighlightingToolStripMenuItem,
this.backgroundColorToolStripMenuItem, this.backgroundColorToolStripMenuItem,
this.toolStripSeparator5, this.toolStripSeparator5,
this.startWithEmptyScriptToolStripMenuItem, this.startWithEmptyScriptToolStripMenuItem,
this.restoreSettingsToolStripMenuItem}); this.restoreSettingsToolStripMenuItem});
this.configToolStripMenuItem.Name = "configToolStripMenuItem"; this.configToolStripMenuItem.Name = "configToolStripMenuItem";
this.configToolStripMenuItem.Size = new System.Drawing.Size(55, 20); this.configToolStripMenuItem.Size = new System.Drawing.Size(55, 20);
this.configToolStripMenuItem.Text = "&Config"; this.configToolStripMenuItem.Text = "&Config";
// //
// fontToolStripMenuItem // fontToolStripMenuItem
// //
this.fontToolStripMenuItem.Name = "fontToolStripMenuItem"; this.fontToolStripMenuItem.Name = "fontToolStripMenuItem";
this.fontToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.fontToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.fontToolStripMenuItem.Text = "&Font"; this.fontToolStripMenuItem.Text = "&Font";
this.fontToolStripMenuItem.Click += new System.EventHandler(this.fontToolStripMenuItem_Click); this.fontToolStripMenuItem.Click += new System.EventHandler(this.fontToolStripMenuItem_Click);
// //
// syntaxHighlightingToolStripMenuItem // syntaxHighlightingToolStripMenuItem
// //
this.syntaxHighlightingToolStripMenuItem.Name = "syntaxHighlightingToolStripMenuItem"; this.syntaxHighlightingToolStripMenuItem.Name = "syntaxHighlightingToolStripMenuItem";
this.syntaxHighlightingToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.syntaxHighlightingToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.syntaxHighlightingToolStripMenuItem.Text = "&Syntax Highlighting"; this.syntaxHighlightingToolStripMenuItem.Text = "&Syntax Highlighting";
this.syntaxHighlightingToolStripMenuItem.Click += new System.EventHandler(this.syntaxHighlightingToolStripMenuItem_Click); this.syntaxHighlightingToolStripMenuItem.Click += new System.EventHandler(this.syntaxHighlightingToolStripMenuItem_Click);
// //
// toolStripSeparator5 // backgroundColorToolStripMenuItem
// //
this.toolStripSeparator5.Name = "toolStripSeparator5"; this.backgroundColorToolStripMenuItem.Name = "backgroundColorToolStripMenuItem";
this.toolStripSeparator5.Size = new System.Drawing.Size(193, 6); this.backgroundColorToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
// this.backgroundColorToolStripMenuItem.Text = "Background Color";
// startWithEmptyScriptToolStripMenuItem this.backgroundColorToolStripMenuItem.Click += new System.EventHandler(this.backgroundColorToolStripMenuItem_Click);
// //
this.startWithEmptyScriptToolStripMenuItem.Name = "startWithEmptyScriptToolStripMenuItem"; // toolStripSeparator5
this.startWithEmptyScriptToolStripMenuItem.Size = new System.Drawing.Size(196, 22); //
this.startWithEmptyScriptToolStripMenuItem.Text = "Start With Empty Script"; this.toolStripSeparator5.Name = "toolStripSeparator5";
this.startWithEmptyScriptToolStripMenuItem.Click += new System.EventHandler(this.startWithEmptyScriptToolStripMenuItem_Click); this.toolStripSeparator5.Size = new System.Drawing.Size(193, 6);
// //
// restoreSettingsToolStripMenuItem // startWithEmptyScriptToolStripMenuItem
// //
this.restoreSettingsToolStripMenuItem.Name = "restoreSettingsToolStripMenuItem"; this.startWithEmptyScriptToolStripMenuItem.Name = "startWithEmptyScriptToolStripMenuItem";
this.restoreSettingsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.startWithEmptyScriptToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.restoreSettingsToolStripMenuItem.Text = "Restore Settings"; this.startWithEmptyScriptToolStripMenuItem.Text = "Start With Empty Script";
this.restoreSettingsToolStripMenuItem.Click += new System.EventHandler(this.restoreSettingsToolStripMenuItem_Click); this.startWithEmptyScriptToolStripMenuItem.Click += new System.EventHandler(this.startWithEmptyScriptToolStripMenuItem_Click);
// //
// MessageLabel // restoreSettingsToolStripMenuItem
// //
this.MessageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.restoreSettingsToolStripMenuItem.Name = "restoreSettingsToolStripMenuItem";
this.MessageLabel.AutoSize = true; this.restoreSettingsToolStripMenuItem.Size = new System.Drawing.Size(196, 22);
this.MessageLabel.Location = new System.Drawing.Point(15, 424); this.restoreSettingsToolStripMenuItem.Text = "Restore Settings";
this.MessageLabel.Name = "MessageLabel"; this.restoreSettingsToolStripMenuItem.Click += new System.EventHandler(this.restoreSettingsToolStripMenuItem_Click);
this.MessageLabel.Size = new System.Drawing.Size(91, 13); //
this.MessageLabel.TabIndex = 2; // MessageLabel
this.MessageLabel.Text = " "; //
// this.MessageLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
// AutoCompleteView this.MessageLabel.AutoSize = true;
// this.MessageLabel.Location = new System.Drawing.Point(15, 424);
this.AutoCompleteView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.MessageLabel.Name = "MessageLabel";
this.AutoCompleteView.FullRowSelect = true; this.MessageLabel.Size = new System.Drawing.Size(91, 13);
this.AutoCompleteView.Location = new System.Drawing.Point(324, 322); this.MessageLabel.TabIndex = 2;
this.AutoCompleteView.Name = "AutoCompleteView"; this.MessageLabel.Text = " ";
this.AutoCompleteView.Size = new System.Drawing.Size(121, 97); //
this.AutoCompleteView.TabIndex = 3; // AutoCompleteView
this.AutoCompleteView.UseCompatibleStateImageBehavior = false; //
this.AutoCompleteView.View = System.Windows.Forms.View.List; this.AutoCompleteView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.AutoCompleteView.Visible = false; this.AutoCompleteView.FullRowSelect = true;
this.AutoCompleteView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.AutoCompleteView_MouseDoubleClick); this.AutoCompleteView.Location = new System.Drawing.Point(324, 322);
// this.AutoCompleteView.Name = "AutoCompleteView";
// PositionLabel this.AutoCompleteView.Size = new System.Drawing.Size(121, 97);
// this.AutoCompleteView.TabIndex = 3;
this.PositionLabel.AutoSize = true; this.AutoCompleteView.UseCompatibleStateImageBehavior = false;
this.PositionLabel.Location = new System.Drawing.Point(14, 30); this.AutoCompleteView.View = System.Windows.Forms.View.List;
this.PositionLabel.Name = "PositionLabel"; this.AutoCompleteView.Visible = false;
this.PositionLabel.Size = new System.Drawing.Size(46, 13); this.AutoCompleteView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.AutoCompleteView_MouseDoubleClick);
this.PositionLabel.TabIndex = 4; //
this.PositionLabel.Text = " "; // PositionLabel
// //
// ZoomLabel this.PositionLabel.AutoSize = true;
// this.PositionLabel.Location = new System.Drawing.Point(14, 30);
this.ZoomLabel.AutoSize = true; this.PositionLabel.Name = "PositionLabel";
this.ZoomLabel.Location = new System.Drawing.Point(393, 30); this.PositionLabel.Size = new System.Drawing.Size(46, 13);
this.ZoomLabel.Name = "ZoomLabel"; this.PositionLabel.TabIndex = 4;
this.ZoomLabel.Size = new System.Drawing.Size(66, 13); this.PositionLabel.Text = " ";
this.ZoomLabel.TabIndex = 5; //
this.ZoomLabel.Text = "Zoom: 100%"; // ZoomLabel
// //
// LuaText this.ZoomLabel.AutoSize = true;
// this.ZoomLabel.Location = new System.Drawing.Point(393, 30);
this.LuaText.AcceptsTab = true; this.ZoomLabel.Name = "ZoomLabel";
this.LuaText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.ZoomLabel.Size = new System.Drawing.Size(66, 13);
this.ZoomLabel.TabIndex = 5;
this.ZoomLabel.Text = "Zoom: 100%";
//
// LuaText
//
this.LuaText.AcceptsTab = true;
this.LuaText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.LuaText.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.LuaText.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.LuaText.EnableAutoDragDrop = true; this.LuaText.EnableAutoDragDrop = true;
this.LuaText.Location = new System.Drawing.Point(15, 50); this.LuaText.Location = new System.Drawing.Point(15, 50);
this.LuaText.Name = "LuaText"; this.LuaText.Name = "LuaText";
this.LuaText.Size = new System.Drawing.Size(444, 369); this.LuaText.Size = new System.Drawing.Size(444, 369);
this.LuaText.TabIndex = 0; this.LuaText.TabIndex = 0;
this.LuaText.Text = ""; this.LuaText.Text = "";
this.LuaText.WordWrap = false; this.LuaText.WordWrap = false;
this.LuaText.SelectionChanged += new System.EventHandler(this.LuaText_SelectionChanged); this.LuaText.SelectionChanged += new System.EventHandler(this.LuaText_SelectionChanged);
this.LuaText.TextChanged += new System.EventHandler(this.LuaText_TextChanged); this.LuaText.TextChanged += new System.EventHandler(this.LuaText_TextChanged);
this.LuaText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LuaText_KeyDown); this.LuaText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.LuaText_KeyDown);
this.LuaText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.LuaText_KeyUp); this.LuaText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.LuaText_KeyUp);
this.LuaText.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.LuaText_PreviewKeyDown); this.LuaText.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(this.LuaText_PreviewKeyDown);
// //
// backgroundColorToolStripMenuItem // LuaWriter
// //
this.backgroundColorToolStripMenuItem.Name = "backgroundColorToolStripMenuItem"; this.AllowDrop = true;
this.backgroundColorToolStripMenuItem.Size = new System.Drawing.Size(196, 22); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.backgroundColorToolStripMenuItem.Text = "Background Color"; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.backgroundColorToolStripMenuItem.Click += new System.EventHandler(this.backgroundColorToolStripMenuItem_Click); this.ClientSize = new System.Drawing.Size(474, 441);
// this.Controls.Add(this.AutoCompleteView);
// LuaWriter this.Controls.Add(this.ZoomLabel);
// this.Controls.Add(this.PositionLabel);
this.AllowDrop = true; this.Controls.Add(this.MessageLabel);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.Controls.Add(this.LuaText);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.menuStrip1);
this.ClientSize = new System.Drawing.Size(474, 441); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Controls.Add(this.AutoCompleteView); this.MainMenuStrip = this.menuStrip1;
this.Controls.Add(this.ZoomLabel); this.Name = "LuaWriter";
this.Controls.Add(this.PositionLabel); this.Text = "LuaWriter";
this.Controls.Add(this.MessageLabel); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LuaWriter_FormClosing);
this.Controls.Add(this.LuaText); this.Load += new System.EventHandler(this.LuaWriter_Load);
this.Controls.Add(this.menuStrip1); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaWriter_DragDrop);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.LuaWriter_DragEnter);
this.MainMenuStrip = this.menuStrip1; this.menuStrip1.ResumeLayout(false);
this.Name = "LuaWriter"; this.menuStrip1.PerformLayout();
this.Text = "LuaWriter"; this.ResumeLayout(false);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LuaWriter_FormClosing); this.PerformLayout();
this.Load += new System.EventHandler(this.LuaWriter_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaWriter_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.LuaWriter_DragEnter);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
} }

View File

@ -129,7 +129,6 @@ namespace BizHawk.MultiClient
ending += tempBracket.Length - 1; ending += tempBracket.Length - 1;
} }
//Validate if such text is not part of a comment
AddPosition(firstBracket, ending - firstBracket + 1, Global.Config.LuaStringColor, Global.Config.LuaStringBold); AddPosition(firstBracket, ending - firstBracket + 1, Global.Config.LuaStringColor, Global.Config.LuaStringBold);
if (ending < temp.Length - 1) if (ending < temp.Length - 1)
@ -252,7 +251,6 @@ namespace BizHawk.MultiClient
if (opening != temp.Length) if (opening != temp.Length)
{ {
//Validate if such text is not part of a comment
AddPosition(opening, ending - opening + 1, Global.Config.LuaStringColor, Global.Config.LuaStringBold); AddPosition(opening, ending - opening + 1, Global.Config.LuaStringColor, Global.Config.LuaStringBold);
if (ending >= temp.Length) if (ending >= temp.Length)
@ -300,7 +298,6 @@ namespace BizHawk.MultiClient
else else
endComment = temp.Length; endComment = temp.Length;
//Validate if such text is not part of a string
AddPosition(match.Index, endComment, Global.Config.LuaCommentColor, Global.Config.LuaCommentBold); AddPosition(match.Index, endComment, Global.Config.LuaCommentColor, Global.Config.LuaCommentBold);
} }
else else
@ -310,7 +307,6 @@ namespace BizHawk.MultiClient
else else
endComment = LuaText.GetFirstCharIndexFromLine(LuaText.GetLineFromCharIndex(match.Index) + 1) - match.Index; endComment = LuaText.GetFirstCharIndexFromLine(LuaText.GetLineFromCharIndex(match.Index) + 1) - match.Index;
//Validate if such text is not part of a string
AddPosition(match.Index, endComment, Global.Config.LuaCommentColor, Global.Config.LuaCommentBold); AddPosition(match.Index, endComment, Global.Config.LuaCommentColor, Global.Config.LuaCommentBold);
} }
} }
@ -362,12 +358,12 @@ namespace BizHawk.MultiClient
{ {
foreach (int[] positions in pos) foreach (int[] positions in pos)
{ {
LuaText.Select(positions[0], positions[1]); LuaText.Select(positions[0], positions[1]);
LuaText.SelectionColor = Color.FromArgb(positions[2]); LuaText.SelectionColor = Color.FromArgb(positions[2]);
if (positions[3] == 1) if (positions[3] == 1)
LuaText.SelectionFont = new Font(LuaText.SelectionFont, FontStyle.Bold); LuaText.SelectionFont = new Font(LuaText.SelectionFont, FontStyle.Bold);
else else
LuaText.SelectionFont = new Font(LuaText.SelectionFont, FontStyle.Regular); LuaText.SelectionFont = new Font(LuaText.SelectionFont, FontStyle.Regular);
} }
pos = new List<int[]>(); pos = new List<int[]>();
@ -660,28 +656,33 @@ namespace BizHawk.MultiClient
if (e.KeyCode == Keys.Enter) if (e.KeyCode == Keys.Enter)
{ {
string[] Words = { "if", "for", "while", "function" }; string[] Words = { "if", "for", "while", "function" };
string tabsStr = "";
int linenumber = LuaText.GetLineFromCharIndex(LuaText.GetFirstCharIndexOfCurrentLine());
int tabs = CountTabsAtBeginningOfLine(LuaText.Lines[linenumber]);
for (int a = 1; a <= tabs; a++)
tabsStr += "\t";
foreach (string Word in Words) foreach (string Word in Words)
{ {
try try
{ {
int linenumber = LuaText.GetLineFromCharIndex(LuaText.GetFirstCharIndexOfCurrentLine());
int tabs = CountTabsAtBeginningOfLine(LuaText.Lines[linenumber]);
if (LuaText.Lines[linenumber].Substring(0 + tabs, Word.Length) == Word) if (LuaText.Lines[linenumber].Substring(0 + tabs, Word.Length) == Word)
{ {
string str, tabsStr = ""; string str = LuaText.Text.Insert(LuaText.SelectionStart, "\n" + tabsStr + "\t\n" + tabsStr + "end");
for (int a = 1; a <= tabs; a++)
tabsStr += "\t";
str = LuaText.Text.Insert(LuaText.SelectionStart, "\n" + tabsStr + "\t\n" + tabsStr + "end");
LuaText.Text = str; LuaText.Text = str;
LuaText.Select(LuaText.GetFirstCharIndexFromLine(linenumber + 1) + 1 + tabs, 0); LuaText.Select(LuaText.GetFirstCharIndexFromLine(linenumber + 1) + 1 + tabs, 0);
e.SuppressKeyPress = true; e.SuppressKeyPress = true;
break; return;
} }
} }
catch { } catch { }
} }
string tempStr = LuaText.Text.Insert(LuaText.SelectionStart, "\n" + tabsStr);
LuaText.Text = tempStr;
LuaText.Select(LuaText.GetFirstCharIndexFromLine(linenumber + 1) + tabs, 0);
e.SuppressKeyPress = true;
} }
} }