mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Fix select-word when not on a word, from Anindya Mukherjee.
This commit is contained in:
parent
1a4e64ba69
commit
9a55f65702
@ -1590,13 +1590,12 @@ window_copy_cmd_select_word(struct window_copy_cmd_state *cs)
|
|||||||
data->dx = data->cx;
|
data->dx = data->cx;
|
||||||
data->dy = screen_hsize(data->backing) + data->cy - data->oy;
|
data->dy = screen_hsize(data->backing) + data->cy - data->oy;
|
||||||
|
|
||||||
px = data->cx;
|
|
||||||
py = screen_hsize(data->backing) + data->cy - data->oy;
|
|
||||||
|
|
||||||
data->ws = options_get_string(s->options, "word-separators");
|
data->ws = options_get_string(s->options, "word-separators");
|
||||||
window_copy_cursor_previous_word(wme, data->ws, 0);
|
window_copy_cursor_previous_word(wme, data->ws, 0);
|
||||||
data->selrx = data->cx;
|
px = data->cx;
|
||||||
data->selry = screen_hsize(data->backing) + data->cy - data->oy;
|
py = screen_hsize(data->backing) + data->cy - data->oy;
|
||||||
|
data->selrx = px;
|
||||||
|
data->selry = py;
|
||||||
window_copy_start_selection(wme);
|
window_copy_start_selection(wme);
|
||||||
|
|
||||||
if (px >= window_copy_find_length(wme, py) ||
|
if (px >= window_copy_find_length(wme, py) ||
|
||||||
@ -1609,6 +1608,8 @@ window_copy_cmd_select_word(struct window_copy_cmd_state *cs)
|
|||||||
}
|
}
|
||||||
data->endselrx = data->cx;
|
data->endselrx = data->cx;
|
||||||
data->endselry = screen_hsize(data->backing) + data->cy - data->oy;
|
data->endselry = screen_hsize(data->backing) + data->cy - data->oy;
|
||||||
|
if (data->dx > data->endselrx)
|
||||||
|
data->dx = data->endselrx;
|
||||||
|
|
||||||
return (WINDOW_COPY_CMD_REDRAW);
|
return (WINDOW_COPY_CMD_REDRAW);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user