authorgravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2023-05-24 10:15:47+01:00
committergravatar for mail@linusgroh.deLinus Groh <mail@linusgroh.de> 2023-05-24 10:15:47+01:00
log93d9c9bf319e78045c70d1e6260b15e3319c82b9
tree343ccc205e62fb8c3e81226d6cf5e170debf583e
parent5d3f3cae64759091ad6dc7b1e2e7f15728c8b05a

std.io.tty: Remove unused Config.writeDEC() function

For reference: https://github.com/ziglang/zig/pull/15806#discussion_r1203377118

1 files changed, 0 insertions(+), 30 deletions(-)

lib/std/io/tty.zig-30
......@@ -123,34 +123,4 @@ pub const Config = union(enum) {
123123 },
124124 };
125125 }
126
127 pub fn writeDEC(conf: Config, writer: anytype, codepoint: u8) !void {
128 const bytes = switch (conf) {
129 .no_color, .windows_api => switch (codepoint) {
130 0x50...0x5e => @as(*const [1]u8, &codepoint),
131 0x6a => "+", // ┘
132 0x6b => "+", // ┐
133 0x6c => "+", // ┌
134 0x6d => "+", // └
135 0x6e => "+", // ┼
136 0x71 => "-", // ─
137 0x74 => "+", // ├
138 0x75 => "+", // ┤
139 0x76 => "+", // ┴
140 0x77 => "+", // ┬
141 0x78 => "|", // │
142 else => " ", // TODO
143 },
144 .escape_codes => switch (codepoint) {
145 // Here we avoid writing the DEC beginning sequence and
146 // ending sequence in separate syscalls by putting the
147 // beginning and ending sequence into the same string
148 // literals, to prevent terminals ending up in bad states
149 // in case a crash happens between syscalls.
150 inline 0x50...0x7f => |x| "\x1B\x28\x30" ++ [1]u8{x} ++ "\x1B\x28\x42",
151 else => unreachable,
152 },
153 };
154 return writer.writeAll(bytes);
155 }
156126};