拆分代码5

This commit is contained in:
2026-02-04 20:42:11 +08:00
parent 3cc6d2c92a
commit 73530c6ba3
3 changed files with 54 additions and 30 deletions

View File

@@ -437,40 +437,12 @@ namespace CMLeonOS
public void EditFile(string fileName)
{
if (string.IsNullOrEmpty(fileName))
{
ShowError("Please specify a file name");
return;
}
try
{
var editor = new Editor(fileName, fileSystem);
editor.Run();
}
catch (Exception ex)
{
ShowError($"Error starting editor: {ex.Message}");
}
Commands.Editor.EditCommand.EditFile(fileName, fileSystem, ShowError);
}
public void NanoFile(string fileName)
{
if (string.IsNullOrEmpty(fileName))
{
ShowError("Please specify a file name");
return;
}
try
{
var nano = new Nano(fileName, true, fileSystem, userSystem, this);
nano.Start();
}
catch (Exception ex)
{
ShowError($"Error starting nano: {ex.Message}");
}
Commands.Editor.NanoCommand.NanoFile(fileName, fileSystem, userSystem, this, ShowError);
}
public void DiffFiles(string args)