mirror of
https://github.com/tmux/tmux.git
synced 2024-12-14 10:58:48 +00:00
Merge branch 'obsd-master'
This commit is contained in:
commit
96538b489b
@ -83,7 +83,7 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq)
|
|||||||
window_copy_start_drag(c, &cmdq->item->mouse);
|
window_copy_start_drag(c, &cmdq->item->mouse);
|
||||||
}
|
}
|
||||||
if (wp->mode == &window_copy_mode && args_has(self->args, 'u'))
|
if (wp->mode == &window_copy_mode && args_has(self->args, 'u'))
|
||||||
window_copy_pageup(wp);
|
window_copy_pageup(wp, 0);
|
||||||
|
|
||||||
return (CMD_RETURN_NORMAL);
|
return (CMD_RETURN_NORMAL);
|
||||||
}
|
}
|
||||||
|
2
tmux.h
2
tmux.h
@ -2221,7 +2221,7 @@ void window_copy_init_from_pane(struct window_pane *, int);
|
|||||||
void window_copy_init_for_output(struct window_pane *);
|
void window_copy_init_for_output(struct window_pane *);
|
||||||
void printflike(2, 3) window_copy_add(struct window_pane *, const char *, ...);
|
void printflike(2, 3) window_copy_add(struct window_pane *, const char *, ...);
|
||||||
void window_copy_vadd(struct window_pane *, const char *, va_list);
|
void window_copy_vadd(struct window_pane *, const char *, va_list);
|
||||||
void window_copy_pageup(struct window_pane *);
|
void window_copy_pageup(struct window_pane *, int);
|
||||||
void window_copy_start_drag(struct client *, struct mouse_event *);
|
void window_copy_start_drag(struct client *, struct mouse_event *);
|
||||||
int window_copy_scroll_position(struct window_pane *);
|
int window_copy_scroll_position(struct window_pane *);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
struct screen *window_copy_init(struct window_pane *);
|
struct screen *window_copy_init(struct window_pane *);
|
||||||
void window_copy_free(struct window_pane *);
|
void window_copy_free(struct window_pane *);
|
||||||
void window_copy_pagedown(struct window_pane *);
|
void window_copy_pagedown(struct window_pane *, int);
|
||||||
void window_copy_next_paragraph(struct window_pane *);
|
void window_copy_next_paragraph(struct window_pane *);
|
||||||
void window_copy_previous_paragraph(struct window_pane *);
|
void window_copy_previous_paragraph(struct window_pane *);
|
||||||
void window_copy_resize(struct window_pane *, u_int, u_int);
|
void window_copy_resize(struct window_pane *, u_int, u_int);
|
||||||
@ -323,7 +323,7 @@ window_copy_vadd(struct window_pane *wp, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_copy_pageup(struct window_pane *wp)
|
window_copy_pageup(struct window_pane *wp, int half_page)
|
||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
@ -342,8 +342,12 @@ window_copy_pageup(struct window_pane *wp)
|
|||||||
data->cx = data->lastcx;
|
data->cx = data->lastcx;
|
||||||
|
|
||||||
n = 1;
|
n = 1;
|
||||||
if (screen_size_y(s) > 2)
|
if (screen_size_y(s) > 2) {
|
||||||
|
if (half_page)
|
||||||
|
n = screen_size_y(s) / 2;
|
||||||
|
else
|
||||||
n = screen_size_y(s) - 2;
|
n = screen_size_y(s) - 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->oy + n > screen_hsize(data->backing))
|
if (data->oy + n > screen_hsize(data->backing))
|
||||||
data->oy = screen_hsize(data->backing);
|
data->oy = screen_hsize(data->backing);
|
||||||
@ -362,7 +366,7 @@ window_copy_pageup(struct window_pane *wp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
window_copy_pagedown(struct window_pane *wp)
|
window_copy_pagedown(struct window_pane *wp, int half_page)
|
||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
@ -381,8 +385,12 @@ window_copy_pagedown(struct window_pane *wp)
|
|||||||
data->cx = data->lastcx;
|
data->cx = data->lastcx;
|
||||||
|
|
||||||
n = 1;
|
n = 1;
|
||||||
if (screen_size_y(s) > 2)
|
if (screen_size_y(s) > 2) {
|
||||||
|
if (half_page)
|
||||||
|
n = screen_size_y(s) / 2;
|
||||||
|
else
|
||||||
n = screen_size_y(s) - 2;
|
n = screen_size_y(s) - 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (data->oy < n)
|
if (data->oy < n)
|
||||||
data->oy = 0;
|
data->oy = 0;
|
||||||
@ -477,7 +485,7 @@ window_copy_key(struct window_pane *wp, struct client *c, struct session *sess,
|
|||||||
const char *word_separators;
|
const char *word_separators;
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
struct screen *s = &data->screen;
|
struct screen *s = &data->screen;
|
||||||
u_int n, np;
|
u_int np;
|
||||||
int keys;
|
int keys;
|
||||||
enum mode_key_cmd cmd;
|
enum mode_key_cmd cmd;
|
||||||
const char *arg, *ss;
|
const char *arg, *ss;
|
||||||
@ -582,11 +590,11 @@ window_copy_key(struct window_pane *wp, struct client *c, struct session *sess,
|
|||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_PREVIOUSPAGE:
|
case MODEKEYCOPY_PREVIOUSPAGE:
|
||||||
for (; np != 0; np--)
|
for (; np != 0; np--)
|
||||||
window_copy_pageup(wp);
|
window_copy_pageup(wp, 0);
|
||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_NEXTPAGE:
|
case MODEKEYCOPY_NEXTPAGE:
|
||||||
for (; np != 0; np--)
|
for (; np != 0; np--)
|
||||||
window_copy_pagedown(wp);
|
window_copy_pagedown(wp, 0);
|
||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_PREVIOUSPARAGRAPH:
|
case MODEKEYCOPY_PREVIOUSPARAGRAPH:
|
||||||
for (; np != 0; np--)
|
for (; np != 0; np--)
|
||||||
@ -597,30 +605,12 @@ window_copy_key(struct window_pane *wp, struct client *c, struct session *sess,
|
|||||||
window_copy_next_paragraph(wp);
|
window_copy_next_paragraph(wp);
|
||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_HALFPAGEUP:
|
case MODEKEYCOPY_HALFPAGEUP:
|
||||||
n = screen_size_y(s) / 2;
|
for (; np != 0; np--)
|
||||||
for (; np != 0; np--) {
|
window_copy_pageup(wp, 1);
|
||||||
if (data->oy + n > screen_hsize(data->backing))
|
|
||||||
data->oy = screen_hsize(data->backing);
|
|
||||||
else
|
|
||||||
data->oy += n;
|
|
||||||
}
|
|
||||||
window_copy_update_selection(wp, 1);
|
|
||||||
window_copy_redraw_screen(wp);
|
|
||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_HALFPAGEDOWN:
|
case MODEKEYCOPY_HALFPAGEDOWN:
|
||||||
n = screen_size_y(s) / 2;
|
for (; np != 0; np--)
|
||||||
for (; np != 0; np--) {
|
window_copy_pagedown(wp, 1);
|
||||||
if (data->oy < n)
|
|
||||||
data->oy = 0;
|
|
||||||
else
|
|
||||||
data->oy -= n;
|
|
||||||
}
|
|
||||||
if (data->scroll_exit && data->oy == 0) {
|
|
||||||
window_pane_reset_mode(wp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
window_copy_update_selection(wp, 1);
|
|
||||||
window_copy_redraw_screen(wp);
|
|
||||||
break;
|
break;
|
||||||
case MODEKEYCOPY_TOPLINE:
|
case MODEKEYCOPY_TOPLINE:
|
||||||
data->cx = 0;
|
data->cx = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user