Steps to reproduce:
1. Create a vertical split.
2. Assuming we are running bash in the left pane, enter this:
   echo -e 'xy\e[D\e[@'
   # or
   echo -e 'xyz\e[2D\e[P'
3. Make the left pane smaller:
   tmux resize-pane -L 5
4. Observe the extra newline. This is ugly.

This happens because whenever insert/delete characters in a line, we
extend that line to full width with blanks at the end. This patch will
use the real length instead.

This is especially annoying if you use readline's insert-comment a lot
which uses this facility to insert the comment at the beginning of the
line.
---
 grid-view.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/grid-view.c b/grid-view.c
index e75b604..45737e3 100644
--- a/grid-view.c
+++ b/grid-view.c
@@ -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);
-- 
2.1.3


------------------------------------------------------------------------------
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to