mirror of
https://github.com/tmux/tmux.git
synced 2026-05-30 22:26:18 +00:00
When mode-keys is set to vi, do not allow the cursor to go into the
invisible extra cell to the right of the visible text. This is closer to what vi(1) does. From Max Vim in GitHub issue 5070.
This commit is contained in:
@@ -45,15 +45,20 @@ grid_reader_line_length(struct grid_reader *gr)
|
||||
|
||||
/* Move cursor forward one position. */
|
||||
void
|
||||
grid_reader_cursor_right(struct grid_reader *gr, int wrap, int all)
|
||||
grid_reader_cursor_right(struct grid_reader *gr, int wrap, int all, int onemore)
|
||||
{
|
||||
u_int px;
|
||||
struct grid_cell gc;
|
||||
|
||||
if (all)
|
||||
px = gr->gd->sx;
|
||||
else
|
||||
else if (onemore)
|
||||
px = grid_reader_line_length(gr);
|
||||
else {
|
||||
px = grid_reader_line_length(gr);
|
||||
if (px != 0)
|
||||
px--;
|
||||
}
|
||||
|
||||
if (wrap && gr->cx >= px && gr->cy < gr->gd->hsize + gr->gd->sy - 1) {
|
||||
grid_reader_cursor_start_of_line(gr, 0);
|
||||
|
||||
Reference in New Issue
Block a user