Fix for PascalABC.NET for Linux

This commit is contained in:
Ivan Bondarev 2022-10-23 14:57:07 +02:00
parent da05b63470
commit 1e1e9f009c
2 changed files with 31 additions and 25 deletions

View file

@ -88,14 +88,8 @@ namespace VisualPascalABC
}
}
void MainForm_Activated(object sender, EventArgs e)
void showChangedFileMessage()
{
try
{
if (wasChangedExternally)
{
wasChangedExternally = false;
string mes = null;
if (!File.Exists(fileName))
{
@ -121,6 +115,18 @@ namespace VisualPascalABC
WorkbenchServiceFactory.FileService.SetFileAsChanged(fileName);
}
}
void MainForm_Activated(object sender, EventArgs e)
{
try
{
if (wasChangedExternally)
{
wasChangedExternally = false;
WorkbenchServiceFactory.Workbench.MainForm.BeginInvoke((Action)showChangedFileMessage);
}
}
catch (Exception ex)
{

View file

@ -103,7 +103,7 @@ namespace VisualPascalABC
return findSuccess;
}
if (cbSearchUp.Checked)
Match = Regex.Match(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, 0, startOffset);
Match = Regex.Match(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, 0, Math.Max(startOffset, 0));
else
Match = Regex.Match(Form1.CurrentSyntaxEditor.TextEditor.Document.TextContent, startOffset);