AutoInsertCode.cs изменения
This commit is contained in:
parent
c6b2efb398
commit
f88e438d25
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "5";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "2199";
|
||||
public const string Revision = "2202";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=5
|
||||
%REVISION%=2199
|
||||
%COREVERSION%=0
|
||||
%REVISION%=2202
|
||||
%MINOR%=5
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.5.0.2199'
|
||||
!define VERSION '3.5.0.2202'
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ namespace VisualPascalABC
|
|||
int start1 = TextUtilities.FindPrevWordStart(editor.Document, caret1.Offset);
|
||||
var Text1 = editor.Document.GetText(start1, caret1.Offset - start1).TrimEnd();
|
||||
|
||||
if (Text1.ToLower().StartsWith("for"))
|
||||
if (Text1.ToLower().StartsWith("for") || Text1.ToLower().StartsWith("foreach"))
|
||||
{
|
||||
doc.Insert(CurrentOffset(), " var");
|
||||
ta.Caret.Column = ta.Caret.Column + 5;
|
||||
|
|
@ -83,20 +83,6 @@ namespace VisualPascalABC
|
|||
int offset = doc.PositionToOffset(tl_beg);
|
||||
doc.Insert(offset, ")");
|
||||
return false;
|
||||
}
|
||||
if (ch == '[')
|
||||
{
|
||||
var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line);
|
||||
int offset = doc.PositionToOffset(tl_beg);
|
||||
doc.Insert(offset, "]");
|
||||
return false;
|
||||
}
|
||||
if (ch == '{')
|
||||
{
|
||||
var tl_beg = new TextLocation(ta.Caret.Column, ta.Caret.Line);
|
||||
int offset = doc.PositionToOffset(tl_beg);
|
||||
doc.Insert(offset, "}");
|
||||
return false;
|
||||
}*/
|
||||
if (ch != '\n')
|
||||
return false;
|
||||
|
|
@ -186,7 +172,9 @@ namespace VisualPascalABC
|
|||
var curline = doc.GetText(seg);
|
||||
if (curline.Contains(":="))
|
||||
{
|
||||
var curlinenew = Regex.Replace(curline, @"(\s*)(\S+)(\s*):=(\s*)(.+)(;?)(\s*)", @"$1$2 := $5;");
|
||||
var curlinenew = Regex.Replace(curline, @"(\s*)(\S+)(\s*):=(\s*)([^;]+)(;?)(\s*)", @"$1$2 := $5;");
|
||||
//if (curlinenew.EndsWith(";;"))
|
||||
// curlinenew = curlinenew.Remove(curlinenew.Length - 1);
|
||||
doc.Replace(seg.Offset, curline.Length, curlinenew);
|
||||
ta.Caret.Column = curlinenew.Length;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue