+ if (shift) {
+ int pre_r = r, pre_c = c, do_pre, do_post;
+ cell = state->grid[idx(r, c, state->params.w)];
+ do_pre = (cell == EMPTY);
+
+ if (out_of_bounds(ui->r + dr[i], ui->c + dc[i], w, h)) {
+ if (do_pre)
+ return nfmtstr(40, "W,%d,%d", pre_r, pre_c);
+ else
+ return NULL;
+ }
+
+ ui->r += dr[i];
+ ui->c += dc[i];
+
+ cell = state->grid[idx(ui->r, ui->c, state->params.w)];
+ do_post = (cell == EMPTY);
+
+ /* (do_pre ? "..." : "") concat (do_post ? "..." : "") */
+ if (do_pre && do_post)
+ return nfmtstr(80, "W,%d,%dW,%d,%d",
+ pre_r, pre_c, ui->r, ui->c);
+ else if (do_pre)
+ return nfmtstr(40, "W,%d,%d", pre_r, pre_c);
+ else if (do_post)
+ return nfmtstr(40, "W,%d,%d", ui->r, ui->c);
+ else
+ return "";
+
+ } else if (!out_of_bounds(ui->r + dr[i], ui->c + dc[i], w, h)) {