Skip to content

Commit 757bea1

Browse files
committed
Fixed some bugs
1 parent 2b29518 commit 757bea1

File tree

5 files changed

+26
-18
lines changed

5 files changed

+26
-18
lines changed

ActionCodexEditor.EditingFeatures.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,32 @@ public partial class ActionCodexEditor
66
{
77
private void HandleKeyDown(View.KeyEventEventArgs e, TabContext ctx)
88
{
9-
if ((e.KeyEvent.IsCtrl && e.KeyEvent.Key == Key.S))
9+
//fix: check if the Ctrl modifier is set AND the key is S
10+
if ((e.KeyEvent.Key & Key.CtrlMask) != 0 && (e.KeyEvent.Key & Key.S) == Key.S)
1011
{
1112
SaveFile();
1213
e.Handled = true;
1314
}
14-
else if ((e.KeyEvent.IsCtrl && e.KeyEvent.Key == Key.N))
15+
else if ((e.KeyEvent.Key & Key.CtrlMask) != 0 && (e.KeyEvent.Key & Key.N) == Key.N)
1516
{
1617
NewFile();
1718
e.Handled = true;
1819
}
19-
else if ((e.KeyEvent.IsCtrl && e.KeyEvent.Key == Key.O))
20+
else if ((e.KeyEvent.Key & Key.CtrlMask) != 0 && (e.KeyEvent.Key & Key.O) == Key.O)
2021
{
2122
OpenFile();
2223
e.Handled = true;
2324
}
24-
else if ((e.KeyEvent.IsCtrl && e.KeyEvent.Key == Key.W))
25+
else if ((e.KeyEvent.Key & Key.CtrlMask) != 0 && (e.KeyEvent.Key & Key.W) == Key.W)
2526
{
2627
CloseFile();
2728
e.Handled = true;
2829
}
30+
else if ((e.KeyEvent.Key & Key.CtrlMask) != 0 && (e.KeyEvent.Key & Key.Q) == Key.Q)
31+
{
32+
Quit();
33+
e.Handled = true;
34+
}
2935
}
3036

3137
private void ToggleWordWrap()

ActionCodexEditor.Initialization.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ private void InitializeStatusBar()
160160
Visible = true,
161161
Items =
162162
new StatusItem[] {
163-
new StatusItem(Key.CtrlMask | Key.N,
163+
new(Key.CtrlMask | Key.N,
164164
GetLocalizedString("StatusNew"), NewFile),
165-
new StatusItem(Key.CtrlMask | Key.O,
165+
new(Key.CtrlMask | Key.O,
166166
GetLocalizedString("StatusOpen"), OpenFile),
167-
new StatusItem(Key.CtrlMask | Key.S,
167+
new(Key.CtrlMask | Key.S,
168168
GetLocalizedString("StatusSave"), SaveFile),
169-
new StatusItem(Key.F1, GetLocalizedString("StatusHelp"),
169+
new(Key.F1, GetLocalizedString("StatusHelp"),
170170
ShowShortcuts),
171-
new StatusItem(Key.CtrlMask | Key.Q,
171+
new(Key.CtrlMask | Key.Q,
172172
GetLocalizedString("StatusQuit"), Quit),
173173
}
174174
};

ActionCodexEditor.Language.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private string GetEnglishString(string key)
104104
"MsgOK" => "OK",
105105

106106
"AboutTitle" => "About",
107-
"AboutVersion" => "Action Codex v1.0",
107+
"AboutVersion" => "Action Codex v1.0.1",
108108
"AboutGithub" => "Github: Github.com/MagerCode",
109109
"AboutCopyright" => "© 2026 All Rights Reserved",
110110

@@ -191,7 +191,7 @@ private string GetIndonesianString(string key)
191191
"MsgOK" => "OK",
192192

193193
"AboutTitle" => "Tentang",
194-
"AboutVersion" => "Action Codex v1.0",
194+
"AboutVersion" => "Action Codex v1.0.1",
195195
"AboutGithub" => "Github: Github.com/MagerCode",
196196
"AboutCopyright" => "© 2026 Hak Cipta Dilindungi",
197197

@@ -267,7 +267,7 @@ private string GetRussianString(string key)
267267
"MsgOK" => "OK",
268268

269269
"AboutTitle" => "О программе",
270-
"AboutVersion" => "Action Codex v1.0",
270+
"AboutVersion" => "Action Codex v1.0.1",
271271
"AboutGithub" => "Github: Github.com/MagerCode",
272272
"AboutCopyright" => "© 2026 Все права защищены",
273273

@@ -343,7 +343,7 @@ private string GetGermanString(string key)
343343
"MsgOK" => "OK",
344344

345345
"AboutTitle" => "Über",
346-
"AboutVersion" => "Action Codex v1.0",
346+
"AboutVersion" => "Action Codex v1.0.1",
347347
"AboutGithub" => "Github: Github.com/MagerCode",
348348
"AboutCopyright" => "© 2026 Alle Rechte vorbehalten",
349349

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22

33
# Action Codex
4-
CLI Text Editor v1.0
4+
CLI Text Editor v1.0.1
55

66
![ssan](ss.png)
77

TabContext.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ namespace ActionCodex
44
{
55
public class TabContext
66
{
7-
public TabView.Tab Tab { get; set; } = null!;
8-
public TextView Editor { get; set; } = null!;
9-
public TextView LineNumbers { get; set; } = null!;
10-
public string FilePath { get; set; } = "";
7+
public required TabView.Tab Tab { get; set; }
8+
public required TextView Editor { get; set; }
9+
public required TextView LineNumbers { get; set; }
10+
public required string FilePath { get; set; }
1111
public bool IsModified { get; set; }
12+
public bool WaitingForCommand { get; set; }
13+
public char? PendingCommand { get; set; }
1214
}
1315
}

0 commit comments

Comments
 (0)