Skip to content

Commit c92054e

Browse files
IDE v1.1.1 : Added Ctrl + D to duplicate line. Also Updated Syntax Xml
1 parent b570534 commit c92054e

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

EZ_IDE/EZCode_Syntax.xml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
11
<doc>
2+
<style name="Pipe" color="Yellow" fontStyle="Bold"/>
3+
<rule style="Pipe">\|</rule>
4+
25
<style name="Comment" color="Green" fontStyle="Regular"/>
36
<rule style="Comment">\/\/(.*?)(?:\||$|(?:\r?\n|$))</rule>
47

58
<style name="Hashtag" color="Orange" fontStyle="Regular"/>
69
<rule style="Hashtag"> #.*|^\s*#.*|\n#.*</rule>
710

11+
<style name="Yellow" color="Yellow" fontStyle="Regular"/>
12+
<rule style="Yellow">(\# eztext start|\#eztext start)([^}]*)(\# eztext end|\#eztext end)</rule>
13+
814
<style name="Pink" color="HotPink" fontStyle="Regular"/>
915
<rule style="Pink">\b(if|loop|else|DEVPORTAL|method|endmethod)\b</rule>
1016

1117
<style name="Keyword" color="CadetBlue" fontStyle="Regular"></style>
1218
<rule style="Keyword">\b(list|group|sound|var|print|await|bringto|clear|instance|destroy|event|file|input|math|intersects|messagebox|stop|shape|textbox|label|button|window|global)\b</rule>
1319

14-
<style name="Loop" color="LightBlue" fontStyle="Regular"/>
15-
<rule style="Loop">(?&lt;=\blist\b\s*).*\b(new|add|equals|remove|destroy|clear)\b</rule>
16-
1720
<style name="Sky" color="SkyBlue" fontStyle="Regular"/>
1821
<rule style="Sky">'(.*?)'|=|-|\+|\*|/|!|\&amp;|~/|~\\</rule>
1922

2023
<style name="LightGreen" color="PaleGreen" fontStyle="Regular"/>
2124
<rule style="LightGreen">\b(-?[0-9]\d*)\b</rule>
2225

23-
<style name="Group" color="LightBlue" fontStyle="Regular"/>
24-
<rule style="Group">(?&lt;=\bgroup\b\s*).*\b(new|change|add|equals|remove|destroy|destroyall|clear)\b</rule>
26+
<style name="All" color="LightBlue" fontStyle="Regular"/>
27+
<rule style="All">((?&lt;=\bgroup\b\s*).*\b(new|change|add|equals|remove|destroy|destroyall|clear)\b)|((?&lt;=\blist\b\s*).*\b(new|add|equals|remove|destroy|split|clear)\b)|((?&lt;=\bsound\b\s*).*\b(new|play|playall|volume|destroy|stop|playloop)\b)|((?&lt;=\bfile\b\s*).*\b(read|write|validpath|play|playproj|create|exists|delete)\b)|((?&lt;=\bwindow\b\s*).*\b(new|display|change|close|open|destroy)\b)</rule>
2528

26-
<style name="Sound" color="LightBlue" fontStyle="Regular"/>
27-
<rule style="Sound">(?&lt;=\bsound\b\s*).*\b(new|play|playall|volume|destroy|stop|playloop)\b</rule>
28-
29-
<style name="File" color="LightBlue" fontStyle="Regular"/>
30-
<rule style="File">(?&lt;=\bfile\b\s*).*\b(read|write|validpath|play|playproj|create|exists|delete)\b</rule>
31-
32-
<style name="Window" color="LightBlue" fontStyle="Regular"/>
33-
<rule style="Window">(?&lt;=\bwindow\b\s*).*\b(new|display|change|close|open|destroy)\b</rule>
34-
3529
<style name="Characters" color="Yellow" fontStyle="Regular"/>
36-
<rule style="Characters">\\n|\\!|\\_|\\;|\\q|\\c|\\e|\\|\\\$|\\&amp;|\\\(|\\\)|\\-|\\"|\&#63;\(|\)\&#63;|\||</rule>
30+
<rule style="Characters">\\n|\\!|\\_|\\;|\\q|\\c|\\e|\\|\\\$|\\&amp;|\\\(|\\\)|\\-|\\"|\&#63;\(|\)\&#63;</rule>
3731

3832
<style name="AfterWordText" color="LightBlue" fontStyle="Regular"/>
3933
<rule style="AfterWordText">(?&lt;=\b(print|messagebox|DEVPORTAL)\b\s*).*</rule>

EZ_IDE/IDE.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
635635
textToCodeToolStripMenuItem.PerformClick(); break;
636636
case Keys.Control | Keys.W:
637637
playInDedicatedWindowToolStripMenuItem.PerformClick(); break;
638+
case Keys.Control | Keys.D:
639+
FCTB_DuplicateLine(); break;
638640
}
639641
}
640642
else if (msg.Msg == 260)
@@ -657,6 +659,20 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
657659
#endregion
658660

659661
#region events
662+
private void FCTB_DuplicateLine()
663+
{
664+
int currentLine = fctb.Selection.Start.iLine;
665+
string currentLineText = fctb.Lines[currentLine].ToString();
666+
667+
int charIndex = 0;
668+
for (int i = 0; i < fctb.GetLine(currentLine).Start.iLine; i++)
669+
{
670+
charIndex += fctb.Lines[i].Length + 2;
671+
}
672+
fctb.Text = fctb.Text.Insert(charIndex, currentLineText + Environment.NewLine);
673+
674+
fctb.Selection = new FastColoredTextBoxNS.Range(fctb, currentLineText.Length, currentLine + 1, currentLineText.Length, currentLine + 1);
675+
}
660676

661677
public int changeTime = 0;
662678

0 commit comments

Comments
 (0)