mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
terminal: improve REPL prompt, completion, and highlighting
- Cache environment variable names to improve completion performance. - Refactor terminal styles into constants. - Move `isAllUpper` to `string.zig` and `meta_names` to `SlashCommand.zig`. - Align quoted string scanning logic with the slash command parser.
This commit is contained in:
@@ -311,6 +311,14 @@ pub fn isAllWhitespace(text: []const u8) bool {
|
||||
} else true;
|
||||
}
|
||||
|
||||
pub fn isAllUpper(s: []const u8) bool {
|
||||
if (s.len == 0) return false;
|
||||
for (s) |ch| {
|
||||
if (!std.ascii.isUpper(ch) and !std.ascii.isDigit(ch) and ch != '_') return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Discriminatory type that signals the bridge to use arena instead of call_arena
|
||||
// Use this for strings that need to persist beyond the current call
|
||||
// The caller can unwrap and store just the underlying .str field
|
||||
|
||||
Reference in New Issue
Block a user