mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-04-21 19:24:00 +00:00
Nano更新
This commit is contained in:
@@ -1 +1 @@
|
|||||||
2026-03-14 03:27:01
|
2026-03-14 15:24:06
|
||||||
@@ -1 +1 @@
|
|||||||
b507c57
|
b3fff31
|
||||||
@@ -535,7 +535,7 @@ namespace CMLeonOS
|
|||||||
{
|
{
|
||||||
string line = lines[currentLine];
|
string line = lines[currentLine];
|
||||||
|
|
||||||
if (IsLuaFile() && settings.EnableSmartIndent)
|
if (settings.EnableSmartIndent)
|
||||||
{
|
{
|
||||||
string currentIndent = GetLineIndent(line);
|
string currentIndent = GetLineIndent(line);
|
||||||
|
|
||||||
@@ -549,9 +549,12 @@ namespace CMLeonOS
|
|||||||
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
lines[currentLine] = line.Remove(linePos, line.Length - linePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line.TrimEnd().EndsWith("then") || line.TrimEnd().EndsWith("do") || line.TrimEnd().EndsWith("else") || line.TrimEnd().EndsWith("elseif") || line.TrimEnd().EndsWith("repeat"))
|
if (IsLuaFile())
|
||||||
{
|
{
|
||||||
lines[currentLine + 1] = lines[currentLine + 1] + " ";
|
if (line.TrimEnd().EndsWith("then") || line.TrimEnd().EndsWith("do") || line.TrimEnd().EndsWith("else") || line.TrimEnd().EndsWith("elseif") || line.TrimEnd().EndsWith("repeat"))
|
||||||
|
{
|
||||||
|
lines[currentLine + 1] = lines[currentLine + 1] + " ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -604,10 +607,7 @@ namespace CMLeonOS
|
|||||||
{
|
{
|
||||||
char c = text[i];
|
char c = text[i];
|
||||||
|
|
||||||
if (IsLuaFile())
|
c = HandleAutoComplete(c);
|
||||||
{
|
|
||||||
c = HandleLuaAutoComplete(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
lines[currentLine] = lines[currentLine].Insert(linePos, c.ToString());
|
lines[currentLine] = lines[currentLine].Insert(linePos, c.ToString());
|
||||||
linePos++;
|
linePos++;
|
||||||
@@ -618,7 +618,7 @@ namespace CMLeonOS
|
|||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private char HandleLuaAutoComplete(char c)
|
private char HandleAutoComplete(char c)
|
||||||
{
|
{
|
||||||
string line = lines[currentLine];
|
string line = lines[currentLine];
|
||||||
|
|
||||||
@@ -688,7 +688,7 @@ namespace CMLeonOS
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (IsLuaFile() && settings.EnableSmartDelete)
|
if (settings.EnableSmartDelete)
|
||||||
{
|
{
|
||||||
string line = lines[currentLine];
|
string line = lines[currentLine];
|
||||||
char charToDelete = line[linePos - 1];
|
char charToDelete = line[linePos - 1];
|
||||||
@@ -1361,11 +1361,11 @@ namespace CMLeonOS
|
|||||||
string title = " Nano Settings";
|
string title = " Nano Settings";
|
||||||
string[] options = new string[]
|
string[] options = new string[]
|
||||||
{
|
{
|
||||||
"1. Smart Indent",
|
"1. Smart Indent (All Files)",
|
||||||
"2. Auto Complete Brackets",
|
"2. Auto Complete Brackets (All Files)",
|
||||||
"3. Auto Complete Quotes",
|
"3. Auto Complete Quotes (All Files)",
|
||||||
"4. Smart Delete",
|
"4. Smart Delete (All Files)",
|
||||||
"5. Syntax Highlight",
|
"5. Syntax Highlight (Lua Only)",
|
||||||
"6. Save and Exit"
|
"6. Save and Exit"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user