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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v1.6.3.0 - 2026-07-11
### Added
- Comments: any line that starts with `#` is now a note to yourself. It is left out when the alias runs and shown in its own color (which you can change in the settings), so you can label your aliases or jot down reminders.
- `# meow ♥`

## v1.6.2.0 - 2026-07-11
### Added
- Blank lines and indentation in the multiline editor are now kept when you save, so you can space out and indent longer aliases to make them easier to read
Expand Down
1 change: 1 addition & 0 deletions Silkstring/Models/ThemeColors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ public class ThemeColors
public Vector4 Flag = new(0.85f, 0.55f, 0.85f, 1.0f);
public Vector4 String = new(0.6f, 0.8f, 0.5f, 1.0f);
public Vector4 Text = new(0.9f, 0.9f, 0.9f, 1.0f);
public Vector4 Comment = new(0.45f, 0.55f, 0.45f, 1.0f);
}
2 changes: 1 addition & 1 deletion Silkstring/Services/ChatInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void ProcessChatInputDetour(ShellCommandModule* shellCommandModule, Utf8
{
var args = ArgumentParser.Parse(inputString[splitString[0].Length..].TrimStart());
var commands = alias.Output
.Where(c => !string.IsNullOrWhiteSpace(c.Command))
.Where(c => !string.IsNullOrWhiteSpace(c.Command) && !c.Command.TrimStart().StartsWith('#'))
.Select(c => c.Command.Trim())
.ToList();
var names = alias.Name.Split('|', StringSplitOptions.RemoveEmptyEntries |
Expand Down
4 changes: 3 additions & 1 deletion Silkstring/Services/Conditions/BlockInterpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ internal enum BlockKind
EndIf,
Set,
Wait,
Until
Until,
Comment
}

internal sealed class BlockInterpreter
Expand All @@ -22,6 +23,7 @@ internal sealed class BlockInterpreter

public static (BlockKind Kind, string Expression) Classify(string line)
{
if (line.StartsWith("#")) return (BlockKind.Comment, line);
if (line.StartsWith(":if ", StringComparison.OrdinalIgnoreCase)) return (BlockKind.If, line[4..]);
if (line.Equals(":else", StringComparison.OrdinalIgnoreCase)) return (BlockKind.Else, "");
if (line.Equals(":endif", StringComparison.OrdinalIgnoreCase)) return (BlockKind.EndIf, "");
Expand Down
2 changes: 2 additions & 0 deletions Silkstring/UI/Palette.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static class Palette
public static Vector4 Success;
public static Vector4 LineNumber;
public static Vector4 Flag;
public static Vector4 Comment;

public static void Apply(ThemeColors t)
{
Expand All @@ -34,5 +35,6 @@ public static void Apply(ThemeColors t)
Success = t.Success;
LineNumber = t.LineNumber;
Flag = t.Flag;
Comment = t.Comment;
}
}
5 changes: 5 additions & 0 deletions Silkstring/UI/SilkstringHighlighter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public object Colorize(Span<Glyph> line, object? state)
else Paint(line, exprStart, text.Length, Error);
break;

case BlockKind.Comment:
Paint(line, indent, text.Length, PaletteIndex.Comment);
break;

default:
if (body.Length > 1 && body[0] == ':' && char.IsLetter(body[1]))
{
Expand Down Expand Up @@ -162,6 +166,7 @@ public static void ApplyPalette(TextEditor editor)
r.SetColor(PaletteIndex.CharLiteral, U32(Palette.Error));
r.SetColor(PaletteIndex.LineNumber, U32(Palette.LineNumber));
r.SetColor(PaletteIndex.Preprocessor, U32(Palette.Flag));
r.SetColor(PaletteIndex.Comment, U32(Palette.Comment));
}

private static uint U32(Vector4 c) => ImGui.ColorConvertFloat4ToU32(c);
Expand Down
1 change: 1 addition & 0 deletions Silkstring/Windows/HelpWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ private void DrawEditorHelp()
DrawColorRow(Palette.String, "Quoted text", "\"Jane Doe\"", "A quoted value kept as one piece");
DrawColorRow(Palette.Flag, "Flag", "-unsafe", "An option that changes how a line behaves");
DrawColorRow(Palette.Error, "Problem", ":wait abc", "Something malformed that will not work as written");
DrawColorRow(Palette.Comment, "Comment", "# my note", "A note to yourself, ignored when the alias runs");
ImGui.EndTable();
}
ImGui.Spacing();
Expand Down
Loading