Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="ktsu.Semantics.Strings" Version="5.8.3" />
<PackageVersion Include="ktsu.Semantics.Strings" Version="5.11.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.12" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.12" />
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="1.7.2" />
Expand Down
7 changes: 4 additions & 3 deletions Keybinding.Demo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

// Clear all profiles except default
IReadOnlyCollection<Profile> profiles = _manager!.Profiles.GetAllProfiles();
foreach (Profile profile in profiles.Where(p => p.Id != "default"))

Check warning on line 128 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'default' 4 times.

Check warning on line 128 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'default' 4 times.
{
_manager.Profiles.DeleteProfile(profile.Id);
}
Expand Down Expand Up @@ -156,12 +156,12 @@
Command[] demoCommands = [
new Command("file.new", "New File", "Create a new file", "File"),
new Command("file.open", "Open File", "Open an existing file", "File"),
new Command("file.save", "Save File", "Save the current file", "File"),

Check warning on line 159 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'file.save' 4 times.

Check warning on line 159 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'file.save' 4 times.
new Command("file.save_as", "Save As", "Save the current file with a new name", "File"),
new Command("edit.copy", "Copy", "Copy selected text to clipboard", "Edit"),

Check warning on line 161 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.copy' 4 times.

Check warning on line 161 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.copy' 4 times.
new Command("edit.cut", "Cut", "Cut selected text to clipboard", "Edit"),
new Command("edit.paste", "Paste", "Paste text from clipboard", "Edit"),

Check warning on line 163 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.paste' 4 times.

Check warning on line 163 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.paste' 4 times.
new Command("edit.undo", "Undo", "Undo the last action", "Edit"),

Check warning on line 164 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.undo' 4 times.

Check warning on line 164 in Keybinding.Demo/Program.cs

View workflow job for this annotation

GitHub Actions / ci / .NET / Analyze & Release

Define a constant instead of using this literal 'edit.undo' 4 times.
new Command("edit.redo", "Redo", "Redo the last undone action", "Edit"),
new Command("view.zoom_in", "Zoom In", "Increase the zoom level", "View"),
new Command("view.zoom_out", "Zoom Out", "Decrease the zoom level", "View"),
Expand Down Expand Up @@ -342,9 +342,10 @@

AnsiConsole.WriteLine($"⌨️ Keybindings for '{profile.Name}' profile:");

if (profile.Chords.Count != 0)
IReadOnlyDictionary<string, Chord> chords = profile.GetAllChords();
if (chords.Count != 0)
{
foreach (KeyValuePair<string, Chord> kvp in profile.Chords.OrderBy(k => k.Key))
foreach (KeyValuePair<string, Chord> kvp in chords.OrderBy(k => k.Key))
{
Command? command = _manager.Commands.GetCommand(kvp.Key);
AnsiConsole.WriteLine($" {kvp.Value} → {command?.Name ?? kvp.Key}");
Expand Down Expand Up @@ -496,7 +497,7 @@
string isActive = profile.Id == activeProfile?.Id ? " (active)" : "";
AnsiConsole.WriteLine($" {profile.Id}: {profile.Name}{isActive}");
AnsiConsole.WriteLine($" {profile.Description}");
AnsiConsole.WriteLine($" Chords: {profile.Chords.Count}");
AnsiConsole.WriteLine($" Chords: {profile.ChordCount}");
}
}

Expand Down
Loading