aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-12 18:22:47 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-12 18:22:47 +0000
commit7cd3cf0eada8513907cd1cc78d7669752235f419 (patch)
tree387f8f8c1a2976775cd6718812010130d9e27676 /server.c
parent440a84b2aa0457f9d94903f04055c1b662d41fbc (diff)
downloadrtmux-7cd3cf0eada8513907cd1cc78d7669752235f419.tar.gz
rtmux-7cd3cf0eada8513907cd1cc78d7669752235f419.tar.bz2
rtmux-7cd3cf0eada8513907cd1cc78d7669752235f419.zip
Make the window pane code handle panes of different sizes, and add a -l and -p arguments to split-window to specify the new window size in lines or as a percentage.
Diffstat (limited to 'server.c')
-rw-r--r--server.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/server.c b/server.c
index c9139ba9..dfc71588 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.95 2009-01-11 23:31:46 nicm Exp $ */
+/* $Id: server.c,v 1.96 2009-01-12 18:22:47 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -565,8 +565,7 @@ server_handle_client(struct client *c)
{
struct winlink *wl = c->session->curw;
struct window_pane *wp = wl->window->active;
- int key, prefix;
- u_int oy;
+ int key, prefix, status;
/* Process keys. */
prefix = options_get_number(&c->session->options, "prefix");
@@ -592,14 +591,12 @@ server_handle_client(struct client *c)
}
/* Ensure the cursor is in the right place and correctly on or off. */
+ status = options_get_number(&c->session->options, "status");
if (c->prompt_string == NULL && c->message_string == NULL &&
- !server_locked && wp->screen->mode & MODE_CURSOR) {
- oy = 0;
- if (wp == wl->window->panes[1])
- oy = wp->window->sy / 2;
-
+ !server_locked && wp->screen->mode & MODE_CURSOR &&
+ wp->yoff + wp->screen->cy < c->sy - status) {
tty_write(&c->tty, wp->screen, 0, TTY_CURSORMODE, 1);
- tty_cursor(&c->tty, wp->screen->cx, wp->screen->cy, oy);
+ tty_cursor(&c->tty, wp->screen->cx, wp->screen->cy, wp->yoff);
} else
tty_write(&c->tty, wp->screen, 0, TTY_CURSORMODE, 0);
}