summaryrefslogtreecommitdiffstats
path: root/mode-tree.c
diff options
context:
space:
mode:
authornicm <nicm>2021-11-15 10:58:13 +0000
committernicm <nicm>2021-11-15 10:58:13 +0000
commitb55f0ac6b94449b3372f0d1737fcf967f4fa13a2 (patch)
tree7990e52a80163eeaa327068efa9411de02a148f8 /mode-tree.c
parentcb8a0d83fbaa2ae49c06105cb94d247ef20ed91e (diff)
Leave the hardware cursor at the position of the selected line in choose
modes and current editing position and at the command prompt. It is invisible but this is helpful for people using screen readers. GitHub issue 2970.
Diffstat (limited to 'mode-tree.c')
-rw-r--r--mode-tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mode-tree.c b/mode-tree.c
index 85027caf..21a73ef2 100644
--- a/mode-tree.c
+++ b/mode-tree.c
@@ -736,10 +736,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
}
sy = screen_size_y(s);
- if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4) {
- screen_write_stop(&ctx);
- return;
- }
+ if (!mtd->preview || sy <= 4 || h <= 4 || sy - h <= 4 || w <= 4)
+ goto done;
line = &mtd->line_list[mtd->current];
mti = line->item;
@@ -783,6 +781,8 @@ mode_tree_draw(struct mode_tree_data *mtd)
mtd->drawcb(mtd->modedata, mti->itemdata, &ctx, box_x, box_y);
}
+done:
+ screen_write_cursormove(&ctx, 0, mtd->current - mtd->offset, 0);
screen_write_stop(&ctx);
}