diff options
| author | user <user@clank> | 2026-08-17 14:22:38 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-17 14:22:38 +0200 |
| commit | ec91ccffe631ae34b111bf6161fd0e3c487f684c (patch) | |
| tree | 4a9fdbb720d9bf03edd5f538d1d87afd2bf51bfb /src/input.h | |
| parent | sl0ppty: clang-format, and a hook that runs it on what you staged (diff) | |
| download | slosh-ec91ccffe631ae34b111bf6161fd0e3c487f684c.tar.gz slosh-ec91ccffe631ae34b111bf6161fd0e3c487f684c.tar.xz slosh-ec91ccffe631ae34b111bf6161fd0e3c487f684c.zip | |
sl0ppty: clang-format the tree
The bumpy one. `make fmt` over every `.c` and `.h` outside `vendor/`: 32 files,
1,843 lines rewritten, no behaviour changed. Nothing here is worth reading -- the
next commit adds it to `.git-blame-ignore-revs` so `git blame` walks past it.
Two thirds of it is alignment the formatter now owns: trailing comments in a
struct, continuation lines under a signature. The rest is the hand-packed tables
opening up to one entry per line -- `ACTIONS`, `NAMED_KEYS`, `ACTION_HELP`. That
is a real loss of density and a real gain in diffs: adding an action was a reflow
of the block and is now one line. Anything worth keeping packed can be fenced with
`// clang-format off`; nothing was, on the grounds that a table is the thing a
formatter is for.
**One change is not formatting.** `src/config.h` had three trailing comments glued
onto one field:
uint16_t hover_delay_ms; /* how long the pointer must rest to arm a guide */
/* how long an announcement stays up */ /* rows per wheel notch */
-- `toast_ms`'s and `scroll_lines`' comments, landed on their neighbour by an
earlier edit, documenting the wrong things ever since. It is in this commit
because it is what caught it: clang-format could not settle on that line, wrapping
it one way and then re-indenting the wrap on a second pass, so `make fmt` was not
idempotent. The comments are back where they belong and it is.
Verified after the reformat, not before: `make clean && make all` is
warning-free, `make retest` is 1801 checks green, and `make fmt` twice in a row
changes nothing the second time. A formatter that alters behaviour would be worse
than none, so the gate was the whole suite rather than a reading of the diff.
Diffstat (limited to 'src/input.h')
| -rw-r--r-- | src/input.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/input.h b/src/input.h index e2fd7fe..4329f78 100644 --- a/src/input.h +++ b/src/input.h @@ -29,23 +29,33 @@ enum { KEY_RELEASE = 0, KEY_PRESS = 1, KEY_REPEAT = 2 }; enum { MOUSE_PRESS = 0, MOUSE_RELEASE = 1, MOUSE_MOTION = 2 }; /* mirrors GhosttyMouseButton */ enum { - MBTN_UNKNOWN = 0, MBTN_LEFT = 1, MBTN_RIGHT = 2, MBTN_MIDDLE = 3, - MBTN_FOUR = 4, MBTN_FIVE = 5, MBTN_SIX = 6, MBTN_SEVEN = 7, + MBTN_UNKNOWN = 0, + MBTN_LEFT = 1, + MBTN_RIGHT = 2, + MBTN_MIDDLE = 3, + MBTN_FOUR = 4, + MBTN_FIVE = 5, + MBTN_SIX = 6, + MBTN_SEVEN = 7, }; /* mirrors GHOSTTY_MODS_* */ enum { - MOD_SHIFT = 1 << 0, MOD_CTRL = 1 << 1, MOD_ALT = 1 << 2, MOD_SUPER = 1 << 3, - MOD_CAPS = 1 << 4, MOD_NUM = 1 << 5, + MOD_SHIFT = 1 << 0, + MOD_CTRL = 1 << 1, + MOD_ALT = 1 << 2, + MOD_SUPER = 1 << 3, + MOD_CAPS = 1 << 4, + MOD_NUM = 1 << 5, }; typedef struct { ev_kind_t kind; /* EV_KEY */ - int key; /* GhosttyKey */ - uint16_t mods; /* MOD_* */ - uint8_t action; /* KEY_* */ - char text[16]; /* UTF-8 the key produced, if any */ + int key; /* GhosttyKey */ + uint16_t mods; /* MOD_* */ + uint8_t action; /* KEY_* */ + char text[16]; /* UTF-8 the key produced, if any */ uint8_t text_len; uint32_t unshifted; /* unshifted codepoint, 0 if unknown */ |
