updated for version 7.0228
diff --git a/src/auto/configure b/src/auto/configure
index 3dfa1b6..20668eb 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -7837,6 +7837,18 @@
       GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
       GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
       GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
+
+                  echo "$as_me:$LINENO: checking for FreeBSD" >&5
+echo $ECHO_N "checking for FreeBSD... $ECHO_C" >&6
+      if test "`(uname) 2>/dev/null`" = FreeBSD; then
+	echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+        GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
+	GNOME_LIBS="$GNOME_LIBS -pthread"
+      else
+	echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+      fi
       have_gnome=yes
     else
       echo "$as_me:$LINENO: result: not found" >&5
diff --git a/src/charset.c b/src/charset.c
index 7c820d2..df86852 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1722,9 +1722,10 @@
  * If "len" is not NULL, the length of the number in characters is returned.
  * If "nptr" is not NULL, the signed result is returned in it.
  * If "unptr" is not NULL, the unsigned result is returned in it.
+ * If "unptr" is not NULL, the unsigned result is returned in it.
  * If "dooct" is non-zero recognize octal numbers, when > 1 always assume
  * octal number.
- * If "dohext" is non-zero recognize hex numbers, when > 1 always assume
+ * If "dohex" is non-zero recognize hex numbers, when > 1 always assume
  * hex number.
  */
     void
diff --git a/src/configure.in b/src/configure.in
index 3412b95..90eb33b 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1478,6 +1478,17 @@
       GNOME_LIBS=`$PKG_CONFIG --libs-only-l libgnomeui-2.0`
       GNOME_LIBDIR=`$PKG_CONFIG --libs-only-L libgnomeui-2.0`
       GNOME_INCLUDEDIR=`$PKG_CONFIG --cflags libgnomeui-2.0`
+     
+      dnl On FreeBSD we need -pthread but pkg-config doesn't include it.
+      dnl This might not be the right way but it works for me...
+      AC_MSG_CHECKING(for FreeBSD)
+      if test "`(uname) 2>/dev/null`" = FreeBSD; then
+	AC_MSG_RESULT(yes, adding -pthread)
+        GNOME_INCLUDEDIR="$GNOME_INCLUDEDIR -D_THREAD_SAFE"
+	GNOME_LIBS="$GNOME_LIBS -pthread"
+      else
+	AC_MSG_RESULT(no)
+      fi
       $1
     else
       AC_MSG_RESULT(not found)
diff --git a/src/dosinst.c b/src/dosinst.c
index 41a8267..1b572a0 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -751,7 +751,6 @@
     char	*exename = targets[choices[idx].arg].exenamearg;
     char	*vimarg = targets[choices[idx].arg].exearg;
     FILE	*fd;
-    char	buf[BUFSIZE];
 
     if (*batpath != NUL)
     {
@@ -763,23 +762,29 @@
 	    need_uninstall_entry = 1;
 
 	    fprintf(fd, "@echo off\n");
-	    fprintf(fd, "rem -- Run Vim --\n\n");
+	    fprintf(fd, "rem -- Run Vim --\n");
+	    fprintf(fd, "\n");
 
-	    strcpy(buf, installdir);
-	    buf[runtimeidx - 1] = NUL;
-	    /* Don't use double quotes for the value here, also when buf
+	    /* Don't use double quotes for the "set" argument, also when it
 	     * contains a space.  The quotes would be included in the value
-	     * for MSDOS and NT. */
-	    fprintf(fd, "set VIM=%s\n\n", buf);
-
-	    strcpy(buf, installdir + runtimeidx);
-	    add_pathsep(buf);
-	    strcat(buf, exename);
+	     * for MSDOS and NT.
+	     * The order of preference is:
+	     * 1. $VIMRUNTIME/vim.exe	    (user preference)
+	     * 2. $VIM/vim70/vim.exe	    (hard coded version)
+	     * 3. installdir/vim.exe	    (hard coded install directory)
+	     */
+	    fprintf(fd, "set VIM_EXE_DIR=%s\n", installdir);
+	    fprintf(fd, "if exist \"%%VIM%%\\%s\\%s\" set VIM_EXE_DIR=%%VIM%%\\%s\n",
+			       VIM_VERSION_NODOT, exename, VIM_VERSION_NODOT);
+	    fprintf(fd, "if exist \"%%VIMRUNTIME%%\\%s\" set VIM_EXE_DIR=%%VIMRUNTIME%%\n", exename);
+	    fprintf(fd, "\n");
 
 	    /* Give an error message when the executable could not be found. */
-	    fprintf(fd, "if exist \"%%VIM%%\\%s\" goto havevim\n", buf);
-	    fprintf(fd, "echo \"%%VIM%%\\%s\" not found\n", buf);
-	    fprintf(fd, "goto eof\n\n");
+	    fprintf(fd, "if exist \"%%VIM_EXE_DIR%%\\%s\" goto havevim\n",
+								     exename);
+	    fprintf(fd, "echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename);
+	    fprintf(fd, "goto eof\n");
+	    fprintf(fd, "\n");
 	    fprintf(fd, ":havevim\n");
 
 	    fprintf(fd, "rem collect the arguments in VIMARGS for Win95\n");
@@ -796,10 +801,12 @@
 	    }
 	    fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n");
 	    fprintf(fd, "shift\n");
-	    fprintf(fd, "goto loopstart\n\n");
+	    fprintf(fd, "goto loopstart\n");
 	    fprintf(fd, ":loopend\n");
+	    fprintf(fd, "\n");
 
-	    fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n\n");
+	    fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n");
+	    fprintf(fd, "\n");
 
 	    /* For gvim.exe use "start" to avoid that the console window stays
 	     * open. */
@@ -809,24 +816,21 @@
 		fprintf(fd, "start ");
 	    }
 
-	    /* Do use quotes here if the path includes a space. */
-	    if (strchr(installdir, ' ') != NULL)
-		fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf, vimarg);
-	    else
-		fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg);
-	    fprintf(fd, "goto eof\n\n");
+	    /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */
+	    fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n",
+							     exename, vimarg);
+	    fprintf(fd, "goto eof\n");
+	    fprintf(fd, "\n");
 
 	    if (*exename == 'g')
 	    {
 		fprintf(fd, ":nofork\n");
 		fprintf(fd, "start /w ");
-		/* Do use quotes here if the path includes a space. */
-		if (strchr(installdir, ' ') != NULL)
-		    fprintf(fd, "\"%%VIM%%\\%s\" %s %%VIMARGS%%\n", buf,
-								      vimarg);
-		else
-		    fprintf(fd, "%%VIM%%\\%s %s %%VIMARGS%%\n", buf, vimarg);
-		fprintf(fd, "goto eof\n\n");
+		/* Always use quotes, $VIM or $VIMRUNTIME might have a space. */
+		fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n",
+							     exename, vimarg);
+		fprintf(fd, "goto eof\n");
+		fprintf(fd, "\n");
 	    }
 
 	    fprintf(fd, ":ntaction\n");
@@ -840,22 +844,18 @@
 		fprintf(fd, "start \"dummy\" /b ");
 	    }
 
-	    /* Do use quotes here if the path includes a space. */
-	    if (strchr(installdir, ' ') != NULL)
-		fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg);
-	    else
-		fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg);
-	    fprintf(fd, "goto eof\n\n");
+	    /* Always use quotes, $VIM or $VIMRUNTIME might have a space. */
+	    fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg);
+	    fprintf(fd, "goto eof\n");
+	    fprintf(fd, "\n");
 
 	    if (*exename == 'g')
 	    {
 		fprintf(fd, ":noforknt\n");
 		fprintf(fd, "start \"dummy\" /b /wait ");
-		/* Do use quotes here if the path includes a space. */
-		if (strchr(installdir, ' ') != NULL)
-		    fprintf(fd, "\"%%VIM%%\\%s\" %s %%*\n", buf, vimarg);
-		else
-		    fprintf(fd, "%%VIM%%\\%s %s %%*\n", buf, vimarg);
+		/* Always use quotes, $VIM or $VIMRUNTIME might have a space. */
+		fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n",
+							     exename, vimarg);
 	    }
 
 	    fprintf(fd, "\n:eof\n");
diff --git a/src/dosinst.h b/src/dosinst.h
index 7b53e50..485e7cd 100644
--- a/src/dosinst.h
+++ b/src/dosinst.h
@@ -350,7 +350,7 @@
  * List of targets.  The first one (index zero) is used for the default path
  * for the batch files.
  */
-#define TARGET_COUNT  8
+#define TARGET_COUNT  9
 
 struct
 {
@@ -381,6 +381,8 @@
 					"vimdiff.exe","vim.exe",  "-d"},
     {"gvimdiff","gvimdiff.bat",	"gVim Diff.lnk",
 					"gvimdiff.exe","gvim.exe", "-d"},
+    {"vimtutor","vimtutor.bat", "Vim tutor.lnk",
+					"vimtutor.bat",  "vimtutor.bat", ""},
 };
 
 #define ICON_COUNT 3
diff --git a/src/edit.c b/src/edit.c
index e8396d1..0cac945 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -7251,7 +7251,7 @@
     static void
 ins_ctrl_hat()
 {
-    if (map_to_exists_mode((char_u *)"", LANGMAP))
+    if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE))
     {
 	/* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */
 	if (State & LANGMAP)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 2af0e7c..58cfec8 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -985,7 +985,7 @@
 		goto cmdline_not_changed;
 
 	case Ctrl_HAT:
-		if (map_to_exists_mode((char_u *)"", LANGMAP))
+		if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE))
 		{
 		    /* ":lmap" mappings exists, toggle use of mappings. */
 		    State ^= LANGMAP;
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 058e90c..964fcf6 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2884,7 +2884,8 @@
     width += get_item_dimensions(gui.toolbar, GTK_ORIENTATION_VERTICAL);
 # endif
 # ifdef FEAT_GUI_TABLINE
-    width += get_item_dimensions(gui.tabline, GTK_ORIENTATION_VERTICAL);
+    if (gui.tabline != NULL)
+	width += get_item_dimensions(gui.tabline, GTK_ORIENTATION_VERTICAL);
 # endif
 #endif
 
@@ -2903,7 +2904,8 @@
     height += get_item_dimensions(gui.toolbar, GTK_ORIENTATION_HORIZONTAL);
 #endif
 #ifdef FEAT_GUI_TABLINE
-    height += get_item_dimensions(gui.tabline, GTK_ORIENTATION_HORIZONTAL);
+    if (gui.tabline != NULL)
+	height += get_item_dimensions(gui.tabline, GTK_ORIENTATION_HORIZONTAL);
 #endif
 
     return height;
@@ -3578,32 +3580,38 @@
 #endif /* FEAT_TOOLBAR */
 
 #ifdef FEAT_GUI_TABLINE
-    /* Use a Notebook for the tab pages labels.  The labels are hidden by
-     * default. */
-    gui.tabline = gtk_notebook_new();
-    gtk_widget_show(gui.tabline);
-    gtk_box_pack_start(GTK_BOX(vbox), gui.tabline, FALSE, FALSE, 0);
-    gtk_notebook_set_show_border(GTK_NOTEBOOK(gui.tabline), FALSE);
-    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gui.tabline), FALSE);
-
+    /*
+     * Use a Notebook for the tab pages labels.  The labels are hidden by
+     * default.
+     * TODO: currently doesn't work for Gnome.
+     */
+    if (!using_gnome)
     {
-	GtkWidget *page, *label;
+	gui.tabline = gtk_notebook_new();
+	gtk_widget_show(gui.tabline);
+	gtk_box_pack_start(GTK_BOX(vbox), gui.tabline, FALSE, FALSE, 0);
+	gtk_notebook_set_show_border(GTK_NOTEBOOK(gui.tabline), FALSE);
+	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gui.tabline), FALSE);
 
-	/* Add the first tab. */
-	page = gtk_vbox_new(FALSE, 0);
-	gtk_widget_show(page);
-	gtk_container_add(GTK_CONTAINER(gui.tabline), page);
-	label = gtk_label_new("-Empty-");
-	gtk_widget_show(label);
-	gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, label);
-    }
-    gtk_signal_connect(GTK_OBJECT(gui.tabline), "switch_page",
-		       GTK_SIGNAL_FUNC(on_select_tab), NULL);
+	{
+	    GtkWidget *page, *label;
 
-    /* Create a popup menu for the tab line and connect it. */
-    tabline_menu = create_tabline_menu();
-    gtk_signal_connect_object(GTK_OBJECT(gui.tabline), "button_press_event",
+	    /* Add the first tab. */
+	    page = gtk_vbox_new(FALSE, 0);
+	    gtk_widget_show(page);
+	    gtk_container_add(GTK_CONTAINER(gui.tabline), page);
+	    label = gtk_label_new("-Empty-");
+	    gtk_widget_show(label);
+	    gtk_notebook_set_tab_label(GTK_NOTEBOOK(gui.tabline), page, label);
+	}
+	gtk_signal_connect(GTK_OBJECT(gui.tabline), "switch_page",
+			   GTK_SIGNAL_FUNC(on_select_tab), NULL);
+
+	/* Create a popup menu for the tab line and connect it. */
+	tabline_menu = create_tabline_menu();
+	gtk_signal_connect_object(GTK_OBJECT(gui.tabline), "button_press_event",
 		  GTK_SIGNAL_FUNC(on_tabline_menu), GTK_OBJECT(tabline_menu));
+    }
 #endif
 
     gui.formwin = gtk_form_new();
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 6e36080..3c3d994 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -2063,7 +2063,7 @@
 	int		cw;	/* width of current cell */
 	int		c;
 
-	wlen = 0
+	wlen = 0;
 	clen = 0;
 	cells = 0;
 	for (i = 0; i < len; )
diff --git a/src/misc2.c b/src/misc2.c
index 9c84786..2a0d7cd 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -157,7 +157,7 @@
 		    || (VIsual_active && *p_sel != 'o')
 #endif
 #ifdef FEAT_VIRTUALEDIT
-		    || (ve_flags & VE_ONEMORE)
+		    || ((ve_flags & VE_ONEMORE) && wcol < MAXCOL)
 #endif
 		    ;
     line = ml_get_curline();
diff --git a/src/option.c b/src/option.c
index 0686b85..8b3d8c6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -231,6 +231,9 @@
 #ifdef FEAT_WINDOWS
 # define PV_WFH		OPT_WIN(WV_WFH)
 #endif
+#ifdef FEAT_VERTSPLIT
+# define PV_WFW		OPT_WIN(WV_WFW)
+#endif
 #define PV_WRAP		OPT_WIN(WV_WRAP)
 
 
@@ -2640,6 +2643,13 @@
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)FALSE, (char_u *)0L}},
+    {"winfixwidth", "wfw", P_BOOL|P_VI_DEF|P_RSTAT,
+#ifdef FEAT_VERTSPLIT
+			    (char_u *)VAR_WIN, PV_WFW,
+#else
+			    (char_u *)NULL, PV_NONE,
+#endif
+			    {(char_u *)FALSE, (char_u *)0L}},
     {"winminheight", "wmh", P_NUM|P_VI_DEF,
 #ifdef FEAT_WINDOWS
 			    (char_u *)&p_wmh, PV_NONE,
@@ -8869,6 +8879,9 @@
 #ifdef FEAT_WINDOWS
 	case PV_WFH:	return (char_u *)&(curwin->w_p_wfh);
 #endif
+#ifdef FEAT_VERTSPLIT
+	case PV_WFW:	return (char_u *)&(curwin->w_p_wfw);
+#endif
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
 	case PV_PVW:	return (char_u *)&(curwin->w_p_pvw);
 #endif
diff --git a/src/option.h b/src/option.h
index b4782ab..b1e6f82 100644
--- a/src/option.h
+++ b/src/option.h
@@ -1044,6 +1044,9 @@
 #ifdef FEAT_WINDOWS
     , WV_WFH
 #endif
+#ifdef FEAT_VERTSPLIT
+    , WV_WFW
+#endif
     , WV_WRAP
     , WV_COUNT	    /* must be the last one */
 };
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index e38f380..9212342 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -49,15 +49,15 @@
 int get_map_mode __ARGS((char_u **cmdp, int forceit));
 void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
 void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
-int map_to_exists __ARGS((char_u *str, char_u *modechars));
-int map_to_exists_mode __ARGS((char_u *rhs, int mode));
+int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
+int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
 char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
 int ExpandMappings __ARGS((regmatch_T *regmatch, int *num_file, char_u ***file));
 int check_abbr __ARGS((int c, char_u *ptr, int col, int mincol));
 int makemap __ARGS((FILE *fd, buf_T *buf));
 int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
 void check_map_keycodes __ARGS((void));
-char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod));
+char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
 void init_mappings __ARGS((void));
 void add_map __ARGS((char_u *map, int mode));
 /* vim: set ft=c : */
diff --git a/src/structs.h b/src/structs.h
index 1e66e6f..6abdc41 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -176,6 +176,8 @@
 #if defined(FEAT_WINDOWS)
     int		wo_wfh;
 # define w_p_wfh w_onebuf_opt.wo_wfh	/* 'winfixheight' */
+    int		wo_wfw;
+# define w_p_wfw w_onebuf_opt.wo_wfw	/* 'winfixwidth' */
 #endif
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
     int		wo_pvw;
@@ -1656,6 +1658,7 @@
     char	fr_layout;	/* FR_LEAF, FR_COL or FR_ROW */
 #ifdef FEAT_VERTSPLIT
     int		fr_width;
+    int		fr_newwidth;	/* new width used in win_equal_rec() */
 #endif
     int		fr_height;
     int		fr_newheight;	/* new height used in win_equal_rec() */
diff --git a/src/version.h b/src/version.h
index 92f7411..6e8bfdc 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 17)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 17, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 18)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2006 Mar 18, compiled "