diff -up less-418/funcs.h less418j/funcs.h
--- less-418/funcs.h	2008-01-01 10:51:18.000000000 +1000
+++ less418j/funcs.h	2008-08-17 19:48:00.000000000 +1000
@@ -160,6 +160,7 @@
 	public int is_ascii_char ();
 	public void prewind ();
 	public void plinenum ();
+	public void pshift ();
 	public void pshift_all ();
 	public int is_ansi_end ();
 	public int is_ansi_middle ();
diff -up less-418/input.c less418j/input.c
--- less-418/input.c	2007-12-11 02:35:54.000000000 +1000
+++ less418j/input.c	2008-08-18 23:06:48.000000000 +1000
@@ -23,6 +23,9 @@
 
 extern int squeeze;
 extern int chopline;
+extern int wordwrap;
+extern int curr;
+extern int column;
 extern int hshift;
 extern int quit_if_one_screen;
 extern int sigs;
@@ -52,6 +55,10 @@ forw_line(curr_pos)
 	int blankline;
 	int endline;
 	int backchars;
+	POSITION wrap_pos;
+	int wrap_idx;
+	int wrap_col;
+	int skipped_leading;
 
 	if (curr_pos == NULL_POSITION)
 	{
@@ -111,6 +118,15 @@ forw_line(curr_pos)
 		if (backchars > 0)
 		{
 			pshift_all();
+			if (wordwrap && (c == ' ' || c == '\t'))
+			{
+				do
+				{
+					base_pos++;
+					c = ch_forw_get();
+				} while (c == ' ' || c == '\t');
+				backchars = 1;
+			}
 			base_pos -= backchars;
 			while (--backchars >= 0)
 				(void) ch_back_get();
@@ -127,6 +143,9 @@ forw_line(curr_pos)
 	}
 	blankline = (c == '\n' || c == '\r');
 
+	wrap_pos = NULL_POSITION;
+	skipped_leading = FALSE;
+
 	for (;;)
 	{
 		if (ABORT_SIGS())
@@ -174,10 +193,46 @@ forw_line(curr_pos)
 				quit_if_one_screen = FALSE;
 			} else
 			{
-				new_pos = ch_tell() - backchars;
+				if (!wordwrap)
+					new_pos = ch_tell() - backchars;
+				else
+				{
+					/*
+					 * We're word-wrapping, so go back to the last space.
+					 * However, if it's the space itself that couldn't fit,
+					 * simply ignore it and any subsequent spaces.
+					 */
+					if (c == ' ' || c == '\t')
+					{
+						do
+						{
+							new_pos = ch_tell();
+							c = ch_forw_get();
+						} while (c == ' ' || c == '\t');
+					} else if (wrap_pos == NULL_POSITION)
+						new_pos = ch_tell() - backchars;
+					else
+					{
+						new_pos = wrap_pos;
+						curr = wrap_idx;
+						column = wrap_col;
+					}
+				}
 				endline = FALSE;
 			}
 			break;
+		} else if (wordwrap)
+		{
+			if (c == ' ' || c == '\t')
+			{
+				if (skipped_leading)
+				{
+					wrap_pos = ch_tell();
+					wrap_idx = curr;
+					wrap_col = column;
+				}
+			} else
+				skipped_leading = TRUE;
 		}
 		c = ch_forw_get();
 	}
@@ -219,6 +274,9 @@ back_line(curr_pos)
 	int c;
 	int endline;
 	int backchars;
+	POSITION wrap_pos;
+	int wrap_col;
+	int skipped_leading;
 
 	if (curr_pos == NULL_POSITION || curr_pos <= ch_zero())
 	{
@@ -318,6 +376,8 @@ back_line(curr_pos)
 	prewind();
 	plinenum(new_pos);
     loop:
+	wrap_pos = NULL_POSITION;
+	skipped_leading = FALSE;
 	begin_new_pos = new_pos;
 	(void) ch_seek(new_pos);
 
@@ -356,13 +416,49 @@ back_line(curr_pos)
 				break;
 			}
 		shift:
-			pshift_all();
-			while (backchars-- > 0)
+			if (!wordwrap)
 			{
-				(void) ch_back_get();
-				new_pos--;
+				pshift_all();
+				new_pos -= backchars;
+			} else
+			{
+				if (c == ' ' || c == '\t')
+				{
+					for (;;)
+					{
+						c = ch_forw_get();
+						if (c == ' ' || c == '\t')
+							new_pos++;
+						else
+							break;
+					}
+					if (new_pos >= curr_pos)
+						break;
+					pshift_all();
+				} else if (wrap_pos == NULL_POSITION)
+				{
+					pshift_all();
+					new_pos -= backchars;
+				} else
+				{
+					pshift(wrap_col);
+					begin_new_pos = wrap_pos;
+					backchars = pappend(c, ch_tell()-1);
+					continue;
+				}
 			}
 			goto loop;
+		} else if (wordwrap)
+		{
+			if (c == ' ' || c == '\t')
+			{
+				if (skipped_leading)
+				{
+					wrap_pos = new_pos;
+					wrap_col = column;
+				}
+			} else
+				skipped_leading = TRUE;
 		}
 	} while (new_pos < curr_pos);
 
Files less-418/less.exe and less418j/less.exe differ
diff -up less-418/less.hlp less418j/less.hlp
--- less-418/less.hlp	2008-01-03 11:56:26.000000000 +1000
+++ less418j/less.hlp	2008-08-18 23:17:30.000000000 +1000
@@ -111,6 +111,8 @@
                   Display help (from command line).
   -a  ........  --search-skip-screen
                   Forward search skips current screen.
+  -A  ........  --edge-wrap
+                  Fold lines at the edge of the screen.
   -b [_N]  ....  --buffers=[_N]
                   Number of buffers.
   -B  ........  --auto-buffers
diff -up less-418/less.man less418j/less.man
--- less-418/less.man	2008-01-03 11:56:36.000000000 +1000
+++ less418j/less.man	2008-08-18 23:22:10.000000000 +1000
@@ -439,6 +439,11 @@ LESS(1)                                 
               default,  searches  start  at  the second line on the screen (or
               after the last found line; see the -j option).
 
+       -A or --edge-wrap
+              If  lines  are  being folded (see the \-S option), the fold will
+              occur at the edge of the screen, rather than the previous  (non-
+              leading) space.
+
        -b[4mn[24m or --buffers=[4mn[0m
               Specifies the amount of buffer space  [4mless[24m  will  use  for  each
               file,  in  units  of  kilobytes (1024 bytes).  By default 64K of
diff -up less-418/less.nro less418j/less.nro
--- less-418/less.nro	2008-08-18 23:05:24.000000000 +1000
+++ less418j/less.nro	2008-08-18 23:23:22.000000000 +1000
@@ -10,7 +10,7 @@ less \- opposite of more
 .br
 .B "less \-\-version"
 .br
-.B "less [\-[+]aBcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]"
+.B "less [\-[+]aABcCdeEfFgGiIJKLmMnNqQrRsSuUVwWX~]"
 .br
 .B "     [\-b \fIspace\fP] [\-h \fIlines\fP] [\-j \fIline\fP] [\-k \fIkeyfile\fP]"
 .br
@@ -453,6 +453,9 @@ displayed on the screen, 
 thus skipping all lines displayed on the screen.
 By default, searches start at the second line on the screen
 (or after the last found line; see the \-j option).
+.IP "\-A or \-\-edge-wrap"
+If lines are being folded (see the \-S option), the fold will occur at
+the edge of the screen, rather than the previous (non-leading) space.
 .IP "\-b\fIn\fP or \-\-buffers=\fIn\fP"
 Specifies the amount of buffer space
 .I less
diff -up less-418/line.c less418j/line.c
--- less-418/line.c	2007-12-11 02:35:54.000000000 +1000
+++ less418j/line.c	2008-08-18 22:48:06.000000000 +1000
@@ -28,8 +28,8 @@ public int tabstops[TABSTOP_MAX] = { 0 }
 public int ntabstops = 1;	/* Number of tabstops */
 public int tabdefault = 8;	/* Default repeated tabstops */
 
-static int curr;		/* Index into linebuf */
-static int column;		/* Printable length, accounting for
+public int curr;		/* Index into linebuf */
+public int column;		/* Printable length, accounting for
 				   backspaces, etc. */
 static int overstrike;		/* Next char should overstrike previous char */
 static int last_overstrike = AT_NORMAL;
@@ -241,7 +241,7 @@ plinenum(pos)
  * Shift the input line left.
  * This means discarding N printable chars at the start of the buffer.
  */
-	static void
+	public void
 pshift(shift)
 	int shift;
 {
diff -up less-418/opttbl.c less418j/opttbl.c
--- less-418/opttbl.c	2007-12-11 02:35:54.000000000 +1000
+++ less418j/opttbl.c	2008-08-18 23:26:16.000000000 +1000
@@ -42,6 +42,7 @@ public int swindow;		/* Size of scrollin
 public int jump_sline;		/* Screen line of "jump target" */
 public long jump_sline_fraction = -1;
 public int chopline;		/* Truncate displayed lines at screen width */
+public int wordwrap;		/* Fold lines at word boundaries */
 public int no_init;		/* Disable sending ti/te termcap strings */
 public int no_keypad;		/* Disable sending ks/ke termcap strings */
 public int twiddle;             /* Show tildes after EOF */
@@ -62,6 +63,7 @@ public int less_is_more = 0;	/* Make com
  * Long option names.
  */
 static struct optname a_optname      = { "search-skip-screen",   NULL };
+static struct optname A__optname     = { "edge-wrap",            NULL };
 static struct optname b_optname      = { "buffers",              NULL };
 static struct optname B__optname     = { "auto-buffers",         NULL };
 static struct optname c_optname      = { "clear-screen",         NULL };
@@ -139,7 +141,14 @@ static struct loption option[] =
 			NULL
 		}
 	},
-
+	{ 'A', &A__optname,
+		BOOL|REPAINT, OPT_ON, &wordwrap, NULL,
+		{
+			"Fold lines at screen edge",
+			"Fold lines at start of word",
+			NULL
+		}
+	},
 	{ 'b', &b_optname,
 		NUMBER|INIT_HANDLER, 64, &bufspace, opt_b, 
 		{
