mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +03:00
inspector: termio filter also checks metadata values
This commit is contained in:
@ -85,7 +85,31 @@ pub const VTEvent = struct {
|
|||||||
self: *const VTEvent,
|
self: *const VTEvent,
|
||||||
filter: *cimgui.c.ImGuiTextFilter,
|
filter: *cimgui.c.ImGuiTextFilter,
|
||||||
) bool {
|
) bool {
|
||||||
return cimgui.c.ImGuiTextFilter_PassFilter(filter, self.str.ptr, null);
|
// Check our main string
|
||||||
|
if (cimgui.c.ImGuiTextFilter_PassFilter(
|
||||||
|
filter,
|
||||||
|
self.str.ptr,
|
||||||
|
null,
|
||||||
|
)) return true;
|
||||||
|
|
||||||
|
// We also check all metadata keys and values
|
||||||
|
var it = self.metadata.iterator();
|
||||||
|
while (it.next()) |entry| {
|
||||||
|
var buf: [256]u8 = undefined;
|
||||||
|
const key = std.fmt.bufPrintZ(&buf, "{s}", .{entry.key_ptr.*}) catch continue;
|
||||||
|
if (cimgui.c.ImGuiTextFilter_PassFilter(
|
||||||
|
filter,
|
||||||
|
key.ptr,
|
||||||
|
null,
|
||||||
|
)) return true;
|
||||||
|
if (cimgui.c.ImGuiTextFilter_PassFilter(
|
||||||
|
filter,
|
||||||
|
entry.value_ptr.ptr,
|
||||||
|
null,
|
||||||
|
)) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Encode a parser action as a string that we show in the logs.
|
/// Encode a parser action as a string that we show in the logs.
|
||||||
|
Reference in New Issue
Block a user