*** org\option.c	Tue Apr 14 01:38:04 2009
--- src\option.c	Wed Apr 15 09:23:17 2009
***************
*** 227,232 ****
--- 227,233 ----
  #ifdef FEAT_SYN_HL
  # define PV_CUC		OPT_WIN(WV_CUC)
  # define PV_CUL		OPT_WIN(WV_CUL)
+ # define PV_GUC		OPT_WIN(WV_GUC)
  #endif
  #ifdef FEAT_STL_OPT
  # define PV_STL		OPT_BOTH(OPT_WIN(WV_STL))
***************
*** 446,452 ****
  #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
  	|| defined(FEAT_VERTSPLIT) || defined(FEAT_CLIPBOARD) \
  	|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL)
! # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine"
  #else
  # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
  #endif
--- 447,453 ----
  #if defined(FEAT_DIFF) || defined(FEAT_FOLDING) || defined(FEAT_SPELL) \
  	|| defined(FEAT_VERTSPLIT) || defined(FEAT_CLIPBOARD) \
  	|| defined(FEAT_INS_EXPAND) || defined(FEAT_SYN_HL)
! # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,G:GuideColumn"
  #else
  # define HIGHLIGHT_INIT "8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,t:Title,v:Visual,w:WarningMsg,W:WildMenu,>:SignColumn,*:TabLine,#:TabLineSel,_:TabLineFill"
  #endif
***************
*** 1209,1214 ****
--- 1210,1222 ----
  			    {(char_u *)NULL, (char_u *)0L}
  #endif
  				    },
+     {"guidecolumn", "guc",  P_NUM|P_VI_DEF|P_RWIN,
+ #ifdef FEAT_SYN_HL
+ 			    (char_u *)VAR_WIN, PV_GUC,
+ #else
+ 			    (char_u *)NULL, PV_NONE,
+ #endif
+ 			    {(char_u *)0L, (char_u *)0L}},
      {"guifont",	    "gfn",  P_STRING|P_VI_DEF|P_RCLR|P_COMMA|P_NODUP,
  #ifdef FEAT_GUI
  			    (char_u *)&p_guifont, PV_NONE,
***************
*** 7955,7960 ****
--- 7963,7978 ----
      }
  #endif
  
+     /* 'guidecolumn' must be >= 0 */
+     else if (pp == &curwin->w_p_guc)
+     {
+         if (curwin->w_p_guc < 0)
+         {
+             errmsg = e_positive;
+             curwin->w_p_guc = 0;
+         }
+     }
+ 
      /*
       * Check the bounds for numeric options here
       */
***************
*** 9095,9100 ****
--- 9113,9119 ----
  #ifdef FEAT_SYN_HL
  	case PV_CUC:	return (char_u *)&(curwin->w_p_cuc);
  	case PV_CUL:	return (char_u *)&(curwin->w_p_cul);
+ 	case PV_GUC:	return (char_u *)&(curwin->w_p_guc);
  #endif
  #ifdef FEAT_DIFF
  	case PV_DIFF:	return (char_u *)&(curwin->w_p_diff);
*** org\option.h	Tue Apr 14 01:38:05 2009
--- src\option.h	Sun Apr 12 10:19:21 2009
***************
*** 1059,1064 ****
--- 1059,1065 ----
  #ifdef FEAT_SYN_HL
      , WV_CUC
      , WV_CUL
+     , WV_GUC
  #endif
  #ifdef FEAT_STL_OPT
      , WV_STL
*** org\screen.c	Tue Apr 14 01:38:06 2009
--- src\screen.c	Wed Apr 15 09:48:56 2009
***************
*** 2614,2619 ****
--- 2614,2621 ----
      int		has_syntax = FALSE;	/* this buffer has syntax highl. */
      int		save_did_emsg;
      int		eol_hl_off = 0;		/* 1 if highlighted char after EOL */
+     int         guide_vcol;             /* 'guidecolumn' - 1 to start at 0 */
+     int         rightmost_vcol;         /* rightmost vcol that needs to draw */
  #endif
  #ifdef FEAT_SPELL
      int		has_spell = FALSE;	/* this buffer has spell checking */
***************
*** 4467,4472 ****
--- 4469,4475 ----
  	if (c == NUL)
  	{
  #ifdef FEAT_SYN_HL
+             guide_vcol = wp->w_p_guc - 1;
  	    if (eol_hl_off > 0 && vcol - eol_hl_off == (long)wp->w_virtcol
  		    && lnum == wp->w_cursor.lnum)
  	    {
***************
*** 4476,4500 ****
  		--vcol;
  	    }
  
! 	    /* Highlight 'cursorcolumn' past end of the line. */
  	    if (wp->w_p_wrap)
  		v = wp->w_skipcol;
  	    else
  		v = wp->w_leftcol;
! 	    /* check if line ends before left margin */
  	    if (vcol < v + col - win_col_off(wp))
- 
  		vcol = v + col - win_col_off(wp);
! 	    if (wp->w_p_cuc
  		    && (int)wp->w_virtcol >= vcol - eol_hl_off
  		    && (int)wp->w_virtcol < W_WIDTH(wp) * (row - startrow + 1)
  									   + v
! 		    && lnum != wp->w_cursor.lnum
  # ifdef FEAT_RIGHTLEFT
  		    && !wp->w_p_rl
  # endif
  		    )
  	    {
  		while (col < W_WIDTH(wp))
  		{
  		    ScreenLines[off] = ' ';
--- 4479,4510 ----
  		--vcol;
  	    }
  
! 	    /* Highlight 'cursorcolumn' & 'guidecolumn' past end of line. */
  	    if (wp->w_p_wrap)
  		v = wp->w_skipcol;
  	    else
  		v = wp->w_leftcol;
! 	    
!             /* check if line ends before left margin */
  	    if (vcol < v + col - win_col_off(wp))
  		vcol = v + col - win_col_off(wp);
! 
! 	    if (((wp->w_p_cuc
  		    && (int)wp->w_virtcol >= vcol - eol_hl_off
  		    && (int)wp->w_virtcol < W_WIDTH(wp) * (row - startrow + 1)
  									   + v
! 		    && lnum != wp->w_cursor.lnum)
!                     || (wp->w_p_guc
! 		            && guide_vcol >= vcol - eol_hl_off
! 		            && guide_vcol < W_WIDTH(wp) * (row - startrow + 1)
!                                                                           + v))
  # ifdef FEAT_RIGHTLEFT
  		    && !wp->w_p_rl
  # endif
  		    )
  	    {
+                 rightmost_vcol = (guide_vcol > (long)wp->w_virtcol) ?
+                                                     guide_vcol : wp->w_virtcol;
  		while (col < W_WIDTH(wp))
  		{
  		    ScreenLines[off] = ' ';
***************
*** 4503,4514 ****
  			ScreenLinesUC[off] = 0;
  #endif
  		    ++col;
! 		    if (vcol == (long)wp->w_virtcol)
  		    {
! 			ScreenAttrs[off] = hl_attr(HLF_CUC);
! 			break;
  		    }
! 		    ScreenAttrs[off++] = 0;
  		    ++vcol;
  		}
  	    }
--- 4513,4534 ----
  			ScreenLinesUC[off] = 0;
  #endif
  		    ++col;
! 		    if (wp->w_p_cuc && vcol == (long)wp->w_virtcol)
  		    {
! 			ScreenAttrs[off++] = hl_attr(HLF_CUC);
  		    }
!                     else if (wp->w_p_guc && vcol == guide_vcol)
!                     {
! 			ScreenAttrs[off++] = hl_attr(HLF_GUC);
!                     }
!                     else
!                     {
! 		        ScreenAttrs[off++] = 0;
!                     }
! 
!                     if (vcol >= rightmost_vcol)
!                         break;
! 
  		    ++vcol;
  		}
  	    }
***************
*** 4566,4583 ****
  	}
  
  #ifdef FEAT_SYN_HL
  	/* Highlight the cursor column if 'cursorcolumn' is set.  But don't
! 	 * highlight the cursor position itself. */
  	if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
  		&& lnum != wp->w_cursor.lnum
  		&& draw_state == WL_LINE
  		&& !lnum_in_visual_area)
  	{
! 	    vcol_save_attr = char_attr;
  	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
  	}
! 	else
! 	    vcol_save_attr = -1;
  #endif
  
  	/*
--- 4586,4613 ----
  	}
  
  #ifdef FEAT_SYN_HL
+         guide_vcol = wp->w_p_guc - 1;
+ 	vcol_save_attr = -1;
  	/* Highlight the cursor column if 'cursorcolumn' is set.  But don't
! 	 * highlight the cursor position itself. 
!          * Also highlight the 'guidecolumn' if it is different than
!          * 'cursorcolumn' */
  	if (wp->w_p_cuc && vcol == (long)wp->w_virtcol
  		&& lnum != wp->w_cursor.lnum
  		&& draw_state == WL_LINE
  		&& !lnum_in_visual_area)
  	{
!             vcol_save_attr = char_attr;
  	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_CUC));
  	}
!         else if (wp->w_p_guc
!                     && vcol == guide_vcol
! 		    && draw_state == WL_LINE
! 		    && !lnum_in_visual_area)
! 	{
!             vcol_save_attr = char_attr;
! 	    char_attr = hl_combine_attr(char_attr, hl_attr(HLF_GUC));
! 	}
  #endif
  
  	/*
*** org\structs.h	Tue Apr 14 01:38:07 2009
--- src\structs.h	Sun Apr 12 10:09:34 2009
***************
*** 200,205 ****
--- 200,207 ----
  # define w_p_cuc w_onebuf_opt.wo_cuc	/* 'cursorcolumn' */
      int		wo_cul;
  # define w_p_cul w_onebuf_opt.wo_cul	/* 'cursorline' */
+     int         wo_guc;
+ # define w_p_guc w_onebuf_opt.wo_guc	/* 'guidecolumn' */
  #endif
  #ifdef FEAT_STL_OPT
      char_u	*wo_stl;
*** org\syntax.c	Tue Apr 14 01:38:08 2009
--- src\syntax.c	Tue Apr 14 00:03:52 2009
***************
*** 6324,6329 ****
--- 6324,6331 ----
  	     "CursorColumn term=reverse ctermbg=LightGrey guibg=Grey90"),
  	CENT("CursorLine term=underline cterm=underline",
  	     "CursorLine term=underline cterm=underline guibg=Grey90"),
+ 	CENT("GuideColumn term=reverse ctermbg=Red",
+ 	     "GuideColumn term=reverse ctermbg=Red guibg=Red"),
  #endif
  #ifdef FEAT_AUTOCMD
  	CENT("MatchParen term=reverse ctermbg=Cyan",
***************
*** 6404,6409 ****
--- 6406,6413 ----
  	     "CursorColumn term=reverse ctermbg=DarkGrey guibg=Grey40"),
  	CENT("CursorLine term=underline cterm=underline",
  	     "CursorLine term=underline cterm=underline guibg=Grey40"),
+ 	CENT("GuideColumn term=reverse ctermbg=DarkRed",
+ 	     "GuideColumn term=reverse ctermbg=DarkRed guibg=DarkRed"),
  #endif
  #ifdef FEAT_AUTOCMD
  	CENT("MatchParen term=reverse ctermbg=DarkCyan",
*** org\vim.h	Tue Apr 14 01:38:09 2009
--- src\vim.h	Tue Apr 14 00:00:21 2009
***************
*** 1246,1251 ****
--- 1246,1252 ----
      , HLF_TPF	    /* tabpage line filler */
      , HLF_CUC	    /* 'cursurcolumn' */
      , HLF_CUL	    /* 'cursurline' */
+     , HLF_GUC	    /* 'guidecolumn' */
      , HLF_COUNT	    /* MUST be the last one */
  } hlf_T;
  
***************
*** 1255,1261 ****
  		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  		  'f', 'F', 'A', 'C', 'D', 'T', '>', \
  		  'B', 'P', 'R', 'L', \
! 		  '+', '=', 'x', 'X', '*', '#', '_', '!', '.'}
  
  /*
   * Boolean constants
--- 1256,1262 ----
  		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  		  'f', 'F', 'A', 'C', 'D', 'T', '>', \
  		  'B', 'P', 'R', 'L', \
! 		  '+', '=', 'x', 'X', '*', '#', '_', '!', '.','G'}
  
  /*
   * Boolean constants
*** org\options.txt	Sat Feb 21 12:28:33 2009
--- runtime\doc\options.txt	Wed Apr 15 10:06:36 2009
***************
*** 3197,3202 ****
--- 3197,3218 ----
  	    :highlight Cursor gui=reverse guifg=NONE guibg=NONE
  	    :highlight Cursor gui=NONE guifg=bg guibg=fg
  <
+ 
+ 			*'guidecolumn'* *'guc'*
+ 'guidecolumn' 'guc'	number	(default 0)
+ 			local to window
+ 			{not in Vi}
+ 			{not available when compiled without the  |+syntax|
+ 			feature}
+ 	Highlight a particular screen column with GuideColumn
+ 	|hl-GuideColumn|.  Useful to align text.  Will make screen redrawing
+ 	slower.
+ 	If you only want the highlighting in the current window you can use
+ 	these autocommands: >
+ 		au WinLeave * set guc=0
+ 		au WinEnter * set guc=81
+ <
+ 
  					*'guifont'* *'gfn'*
  						   *E235* *E596* *E610* *E611*
  'guifont' 'gfn'		string	(default "")
