mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
Split SCREEN_BACKGROUND flag into BACKGROUND/NOCURSOR in preparation for copy mode.
This commit is contained in:
parent
e2438dc96e
commit
df7be0ddab
3
TODO
3
TODO
@ -70,7 +70,8 @@
|
|||||||
- stuff like rename would be nice to be able to do in-client like screen, if
|
- stuff like rename would be nice to be able to do in-client like screen, if
|
||||||
it could be implemented in a non-icky way
|
it could be implemented in a non-icky way
|
||||||
- there is to much redrawing. use flags?
|
- there is to much redrawing. use flags?
|
||||||
- use modes for help etc
|
- command mode (! + type tmux command)
|
||||||
|
- copy mode
|
||||||
|
|
||||||
-- For 0.2 --------------------------------------------------------------------
|
-- For 0.2 --------------------------------------------------------------------
|
||||||
- copy and paste
|
- copy and paste
|
||||||
|
4
screen.c
4
screen.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: screen.c,v 1.35 2007-11-21 22:20:44 nicm Exp $ */
|
/* $Id: screen.c,v 1.36 2007-11-22 09:11:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -297,7 +297,7 @@ screen_draw_stop(struct screen_draw_ctx *ctx)
|
|||||||
if (ctx->attr != s->attr || ctx->colr != s->colr)
|
if (ctx->attr != s->attr || ctx->colr != s->colr)
|
||||||
input_store_two(b, CODE_ATTRIBUTES, s->attr, s->colr);
|
input_store_two(b, CODE_ATTRIBUTES, s->attr, s->colr);
|
||||||
|
|
||||||
if (!(s->mode & MODE_BACKGROUND) && s->mode & MODE_CURSOR)
|
if (!(s->mode & MODE_NOCURSOR) && s->mode & MODE_CURSOR)
|
||||||
input_store_zero(b, CODE_CURSORON);
|
input_store_zero(b, CODE_CURSORON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server-fn.c,v 1.29 2007-11-21 20:04:37 nicm Exp $ */
|
/* $Id: server-fn.c,v 1.30 2007-11-22 09:11:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -175,7 +175,7 @@ server_clear_client(struct client *c)
|
|||||||
input_store_zero(c->out, CODE_CLEARLINE);
|
input_store_zero(c->out, CODE_CLEARLINE);
|
||||||
}
|
}
|
||||||
input_store_two(c->out, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
|
input_store_two(c->out, CODE_CURSORMOVE, s->cy + 1, s->cx + 1);
|
||||||
if (!(s->mode & MODE_BACKGROUND) && s->mode & MODE_CURSOR)
|
if (!(s->mode & MODE_NOCURSOR) && s->mode & MODE_CURSOR)
|
||||||
input_store_zero(c->out, CODE_CURSORON);
|
input_store_zero(c->out, CODE_CURSORON);
|
||||||
|
|
||||||
size = BUFFER_USED(c->out) - size;
|
size = BUFFER_USED(c->out) - size;
|
||||||
|
3
tmux.h
3
tmux.h
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.h,v 1.92 2007-11-21 22:20:44 nicm Exp $ */
|
/* $Id: tmux.h,v 1.93 2007-11-22 09:11:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -341,6 +341,7 @@ struct msg_resize_data {
|
|||||||
#define MODE_SAVED 0x10
|
#define MODE_SAVED 0x10
|
||||||
#define MODE_HIDDEN 0x20
|
#define MODE_HIDDEN 0x20
|
||||||
#define MODE_BACKGROUND 0x40
|
#define MODE_BACKGROUND 0x40
|
||||||
|
#define MODE_NOCURSOR 0x80
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Virtual screen. This is stored as three blocks of 8-bit values, one for
|
* Virtual screen. This is stored as three blocks of 8-bit values, one for
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: window-more.c,v 1.2 2007-11-21 19:53:56 nicm Exp $ */
|
/* $Id: window-more.c,v 1.3 2007-11-22 09:11:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -74,7 +74,7 @@ window_more_init(struct window *w)
|
|||||||
ARRAY_INIT(&data->list);
|
ARRAY_INIT(&data->list);
|
||||||
data->top = 0;
|
data->top = 0;
|
||||||
|
|
||||||
w->screen.mode |= MODE_BACKGROUND;
|
w->screen.mode |= (MODE_BACKGROUND|MODE_NOCURSOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -91,6 +91,7 @@ window_more_draw_position(struct window *w, struct screen_draw_ctx *ctx)
|
|||||||
char *line;
|
char *line;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
|
|
||||||
len = xsnprintf(
|
len = xsnprintf(
|
||||||
buf, sizeof buf, "[%u/%u]", data->top, ARRAY_LENGTH(&data->list));
|
buf, sizeof buf, "[%u/%u]", data->top, ARRAY_LENGTH(&data->list));
|
||||||
if (len <= screen_size_x(ctx->s))
|
if (len <= screen_size_x(ctx->s))
|
||||||
@ -185,7 +186,7 @@ window_more_key(struct window *w, int key)
|
|||||||
w->mode = NULL;
|
w->mode = NULL;
|
||||||
xfree(w->modedata);
|
xfree(w->modedata);
|
||||||
|
|
||||||
w->screen.mode &= ~MODE_BACKGROUND;
|
w->screen.mode &= ~(MODE_BACKGROUND|MODE_NOCURSOR);
|
||||||
|
|
||||||
recalculate_sizes();
|
recalculate_sizes();
|
||||||
server_redraw_window_all(w);
|
server_redraw_window_all(w);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: window-scroll.c,v 1.10 2007-11-21 21:28:58 nicm Exp $ */
|
/* $Id: window-scroll.c,v 1.11 2007-11-22 09:11:20 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -56,7 +56,7 @@ window_scroll_init(struct window *w)
|
|||||||
data->ox = data->oy = 0;
|
data->ox = data->oy = 0;
|
||||||
data->size = w->screen.hsize;
|
data->size = w->screen.hsize;
|
||||||
|
|
||||||
w->screen.mode |= MODE_BACKGROUND;
|
w->screen.mode |= (MODE_BACKGROUND|MODE_NOCURSOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -130,7 +130,7 @@ window_scroll_key(struct window *w, int key)
|
|||||||
w->mode = NULL;
|
w->mode = NULL;
|
||||||
xfree(w->modedata);
|
xfree(w->modedata);
|
||||||
|
|
||||||
w->screen.mode &= ~MODE_BACKGROUND;
|
w->screen.mode &= ~(MODE_BACKGROUND|MODE_NOCURSOR);
|
||||||
|
|
||||||
recalculate_sizes();
|
recalculate_sizes();
|
||||||
server_redraw_window_all(w);
|
server_redraw_window_all(w);
|
||||||
|
Loading…
Reference in New Issue
Block a user