Исправление ошибки с автозавершением при переносе в середине оператора с ;

This commit is contained in:
miks1965 2019-07-19 14:08:57 +03:00
parent c6b2efb398
commit c52a893178
7 changed files with 19 additions and 17 deletions

View file

@ -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 = "2201";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%MINOR%=5
%REVISION%=2199
%REVISION%=2201
%COREVERSION%=0
%MAJOR%=3

View file

@ -1 +1 @@
!define VERSION '3.5.0.2199'
!define VERSION '3.5.0.2201'

View file

@ -1228,8 +1228,8 @@ function ExpandFileName(fname: string): string;
// -----------------------------------------------------
//>> Математические подпрограммы # Math subroutines
// -----------------------------------------------------
///-function Sign(x: число): число;
/// Возвращает знак числа x
///-function Sign(x: число): integer;
/// Возвращает -1, 0 или +1 в зависимости от знака числа x
function Sign(x: shortint): integer;
///--
function Sign(x: smallint): integer;

View file

@ -104,7 +104,7 @@ namespace VisualPascalABC
int start = TextUtilities.FindPrevWordStart(editor.Document, caret.Offset);
var Text = editor.Document.GetText(start, caret.Offset - start).TrimEnd();
if (Text.ToLower() == "begin")
if (Text.ToLower() == "begin")
{
string cur, next, prev;
GetCurNextLines(out cur, out next, out prev);
@ -183,15 +183,17 @@ namespace VisualPascalABC
else
{
var seg = doc.GetLineSegment(ta.Caret.Line);
var curline = doc.GetText(seg);
if (curline.Contains(":="))
{
var curlinenew = Regex.Replace(curline, @"(\s*)(\S+)(\s*):=(\s*)(.+)(;?)(\s*)", @"$1$2 := $5;");
doc.Replace(seg.Offset, curline.Length, curlinenew);
ta.Caret.Column = curlinenew.Length;
return false;
var curline = doc.GetText(seg).TrimEnd();
if (ta.Caret.Column >= curline.Length)
if (curline.Contains(":="))
{
var curlinenew = Regex.Replace(curline, @"(\s*)(\S+)(\s*):=(\s*)(.+)(;?)", @"$1$2 := $5;");
curlinenew = curlinenew.Replace(";;", ";");
doc.Replace(seg.Offset, curline.Length, curlinenew);
ta.Caret.Column = curlinenew.Length;
return false;
}
}
}
return false;
}

View file

@ -46,7 +46,7 @@ ExecHide.exe gacutil.exe /i ..\bin\Lib\PABCRtl.dll
@IF %ERRORLEVEL% NEQ 0 GOTO ERROR
cd ..\bin
TestRunner.exe
//TestRunner.exe
cd ..\ReleaseGenerators
call PascalABCNET_ALL.bat

View file

@ -1228,8 +1228,8 @@ function ExpandFileName(fname: string): string;
// -----------------------------------------------------
//>> Математические подпрограммы # Math subroutines
// -----------------------------------------------------
///-function Sign(x: число): число;
/// Возвращает знак числа x
///-function Sign(x: число): integer;
/// Возвращает -1, 0 или +1 в зависимости от знака числа x
function Sign(x: shortint): integer;
///--
function Sign(x: smallint): integer;