pascalabcnet/VisualPascalABCNETLinux/IB/Debugger/Immediate.cs
Mikhalkovich Stanislav 3072383106 Для Linux-версии исправлен DockContent, редактор (показ всплывающего окна)
Сделан новый проект VisualPABCLinux
И пришлось склонировать PluginsSupport, поскольку он вносит зависимость по редактору
Компоненты WeifenLuo для Linux надо после перекомпиляции скопировать в Libraries - подшить их к основному проекту просто не получилось
2022-06-30 09:47:11 +03:00

37 lines
1.1 KiB
C#

// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using PascalABCCompiler.SyntaxTree;
using System.Text;
using Debugger;
namespace VisualPascalABC
{
public class ImmediateEvaluateAction : ICSharpCode.TextEditor.Actions.AbstractEditAction
{
public override void Execute(ICSharpCode.TextEditor.TextArea textArea)
{
if (WorkbenchServiceFactory.DebuggerManager.IsRunning)
{
int line = textArea.Caret.Line;
string val = WorkbenchServiceFactory.DebuggerManager.ExecuteImmediate
(textArea.Document.GetText(textArea.Document.GetLineSegment(textArea.Caret.Line)));
if (val != null)
{
textArea.Document.TextContent += Environment.NewLine+val+Environment.NewLine;
textArea.Caret.Line = line + 2;
textArea.Caret.Column = 0;
}
}
else
{
int line = textArea.Caret.Line;
textArea.Document.TextContent += Environment.NewLine;
textArea.Caret.Line = line + 1;
textArea.Caret.Column = 0;
}
}
}
}