diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-11-08 12:58:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2014-11-08 12:58:32 +0000 |
commit | 2d5356f022c88f87afad9d9fa9cc1be49bb7f118 (patch) | |
tree | 8e9cfe9e8d4d411037bc97901e84ca6dca8b6aeb /usr.bin/tmux | |
parent | cf47ee8d3f848c8d9d0b77238126bf7f7fb74093 (diff) |
Two improvements to reflow from Balazs Kezes:
- Don't extend the line to full width on insert/delete character which
means leaves extra spaces when reflowing.
- Only mark a line wrapped when the cursor actually goes off the end,
not on newlines which can be used for positioning.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/grid-view.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/screen-write.c | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/tmux/grid-view.c b/usr.bin/tmux/grid-view.c index 340e41993fd..3318fb28fec 100644 --- a/usr.bin/tmux/grid-view.c +++ b/usr.bin/tmux/grid-view.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid-view.c,v 1.16 2014/04/17 14:45:49 nicm Exp $ */ +/* $OpenBSD: grid-view.c,v 1.17 2014/11/08 12:58:31 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -184,7 +184,7 @@ grid_view_insert_cells(struct grid *gd, u_int px, u_int py, u_int nx) px = grid_view_x(gd, px); py = grid_view_y(gd, py); - sx = grid_view_x(gd, gd->sx); + sx = grid_view_x(gd, gd->linedata[py].cellsize); if (px == sx - 1) grid_clear(gd, px, py, 1, 1); @@ -201,7 +201,7 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx) px = grid_view_x(gd, px); py = grid_view_y(gd, py); - sx = grid_view_x(gd, gd->sx); + sx = grid_view_x(gd, gd->linedata[py].cellsize); grid_move_cells(gd, px, px + nx, py, sx - px - nx); grid_clear(gd, sx - nx, py, px + nx - (sx - nx), 1); diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c index b103508a4d8..bd6f36c77ab 100644 --- a/usr.bin/tmux/screen-write.c +++ b/usr.bin/tmux/screen-write.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen-write.c,v 1.71 2014/10/20 23:57:14 nicm Exp $ */ +/* $OpenBSD: screen-write.c,v 1.72 2014/11/08 12:58:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -795,8 +795,6 @@ screen_write_linefeed(struct screen_write_ctx *ctx, int wrapped) gl = &s->grid->linedata[s->grid->hsize + s->cy]; if (wrapped) gl->flags |= GRID_LINE_WRAPPED; - else - gl->flags &= ~GRID_LINE_WRAPPED; if (s->cy == s->rlower) grid_view_scroll_region_up(s->grid, s->rupper, s->rlower); |