mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Make previous-word stop at BOL.
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: window-copy.c,v 1.24 2008-06-25 07:30:08 nicm Exp $ */
 | 
			
		||||
/* $Id: window-copy.c,v 1.25 2008-06-27 17:41:48 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -717,9 +717,9 @@ window_copy_cursor_previous_word(struct window *w)
 | 
			
		||||
{
 | 
			
		||||
	struct window_copy_mode_data	*data = w->modedata;
 | 
			
		||||
	struct screen			*s = &data->screen;
 | 
			
		||||
	u_int				 px, py, skip;
 | 
			
		||||
	u_int				 ox, px, py, skip;
 | 
			
		||||
 | 
			
		||||
	px = data->ox + data->cx;
 | 
			
		||||
	ox = px = data->ox + data->cx;
 | 
			
		||||
	py = screen_y(&w->base, data->cy) - data->oy;
 | 
			
		||||
 | 
			
		||||
	skip = 1;
 | 
			
		||||
@@ -729,19 +729,21 @@ window_copy_cursor_previous_word(struct window *w)
 | 
			
		||||
			skip = 0;
 | 
			
		||||
	}
 | 
			
		||||
	for (;;) {
 | 
			
		||||
		while (px == 0) {
 | 
			
		||||
			if (data->cy == 0) {
 | 
			
		||||
				if (w->base.hsize == 0 ||
 | 
			
		||||
				    data->oy >= w->base.hsize - 1)
 | 
			
		||||
					goto out;
 | 
			
		||||
			}
 | 
			
		||||
		if (px == 0) {
 | 
			
		||||
			if (ox != 0)
 | 
			
		||||
				break;
 | 
			
		||||
 | 
			
		||||
			window_copy_cursor_up(w);
 | 
			
		||||
			
 | 
			
		||||
			py = screen_y(&w->base, data->cy) - data->oy;
 | 
			
		||||
			px = window_copy_find_length(w, py);
 | 
			
		||||
			if (px != 0)
 | 
			
		||||
				goto out;
 | 
			
		||||
			while (px == 0) {
 | 
			
		||||
				if (data->cy == 0 && (w->base.hsize == 0 ||
 | 
			
		||||
				    data->oy >= w->base.hsize - 1))
 | 
			
		||||
					goto out;
 | 
			
		||||
				
 | 
			
		||||
				window_copy_cursor_up(w);
 | 
			
		||||
				
 | 
			
		||||
				py = screen_y(&w->base, data->cy) - data->oy;
 | 
			
		||||
				px = window_copy_find_length(w, py);
 | 
			
		||||
			}
 | 
			
		||||
			goto out;
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		if (skip) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user