Sfoglia il codice sorgente

Add some more potential commands

Luna Stadler 4 anni fa
parent
commit
7cb19ce6a8
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      zig/sdl/hello_sdl.zig

+ 4 - 1
zig/sdl/hello_sdl.zig

233
        }
233
        }
234
        while (line != null and i * glyph_height < window_height) {
234
        while (line != null and i * glyph_height < window_height) {
235
            const line_c = try gpa.dupeZ(u8, line.?);
235
            const line_c = try gpa.dupeZ(u8, line.?);
236
            // TODO: render tabs at correct width (or some width at least)
236
            const result_text = c.TTF_RenderUTF8_Shaded(font, line_c, white, black);
237
            const result_text = c.TTF_RenderUTF8_Shaded(font, line_c, white, black);
237
            gpa.free(line_c);
238
            gpa.free(line_c);
238
            const result_texture = c.SDL_CreateTextureFromSurface(renderer, result_text);
239
            const result_texture = c.SDL_CreateTextureFromSurface(renderer, result_text);
262
    else if (std.mem.startsWith(u8, cmd, "man "))
263
    else if (std.mem.startsWith(u8, cmd, "man "))
263
        // TODO: handle `man 5 sway`
264
        // TODO: handle `man 5 sway`
264
        &[_][]const u8{ "man", cmd["man ".len..] }
265
        &[_][]const u8{ "man", cmd["man ".len..] }
266
    else if (std.mem.startsWith(u8, cmd, "s "))
267
        &[_][]const u8{ "ag", cmd["s ".len..], "/home/luna/t/raylib/src", "/home/luna/k/the-thing/resources/ode-build/include" }
265
    else if (cmd.len > 0 and std.ascii.isDigit(cmd[0]))
268
    else if (cmd.len > 0 and std.ascii.isDigit(cmd[0]))
266
        &[_][]const u8{ "/usr/bin/qalc", "-terse", cmd }
269
        &[_][]const u8{ "qalc", "-terse", cmd }
267
    else
270
    else
268
        &[_][]const u8{ "bash", "-c", cmd };
271
        &[_][]const u8{ "bash", "-c", cmd };
269
    for (argv) |arg| {
272
    for (argv) |arg| {