mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
Make previous-word stop at BOL.
This commit is contained in:
parent
9043fe891a
commit
09a4f6a62d
@ -1,4 +1,4 @@
|
|||||||
/* $Id: window-copy.c,v 1.24 2008-06-25 07:30:08 nicm Exp $ */
|
/* $Id: window-copy.c,v 1.25 2008-06-27 17:41:48 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -717,9 +717,9 @@ window_copy_cursor_previous_word(struct window *w)
|
|||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = w->modedata;
|
struct window_copy_mode_data *data = w->modedata;
|
||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
u_int px, py, skip;
|
u_int ox, px, py, skip;
|
||||||
|
|
||||||
px = data->ox + data->cx;
|
ox = px = data->ox + data->cx;
|
||||||
py = screen_y(&w->base, data->cy) - data->oy;
|
py = screen_y(&w->base, data->cy) - data->oy;
|
||||||
|
|
||||||
skip = 1;
|
skip = 1;
|
||||||
@ -729,19 +729,21 @@ window_copy_cursor_previous_word(struct window *w)
|
|||||||
skip = 0;
|
skip = 0;
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
while (px == 0) {
|
if (px == 0) {
|
||||||
if (data->cy == 0) {
|
if (ox != 0)
|
||||||
if (w->base.hsize == 0 ||
|
break;
|
||||||
data->oy >= w->base.hsize - 1)
|
|
||||||
|
while (px == 0) {
|
||||||
|
if (data->cy == 0 && (w->base.hsize == 0 ||
|
||||||
|
data->oy >= w->base.hsize - 1))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
window_copy_cursor_up(w);
|
||||||
|
|
||||||
|
py = screen_y(&w->base, data->cy) - data->oy;
|
||||||
|
px = window_copy_find_length(w, py);
|
||||||
}
|
}
|
||||||
|
goto out;
|
||||||
window_copy_cursor_up(w);
|
|
||||||
|
|
||||||
py = screen_y(&w->base, data->cy) - data->oy;
|
|
||||||
px = window_copy_find_length(w, py);
|
|
||||||
if (px != 0)
|
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skip) {
|
if (skip) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user