From e33437efb201d2fb7fc94a462512959f71eb9cb1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 13:20:39 +0200
Subject: [PATCH 001/473] updated for version 7.4.384 Problem:    Test 102
 fails when compiled with small features. Solution:   Source small.vim. (Jacob
 Niehus)

---
 src/testdir/test102.in | 1 +
 src/version.c          | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/testdir/test102.in b/src/testdir/test102.in
index 35e9f6c2cf..33b401948f 100644
--- a/src/testdir/test102.in
+++ b/src/testdir/test102.in
@@ -1,6 +1,7 @@
 Test if fnameescape is correct for special chars like !
 
 STARTTEST
+:so small.vim
 :%d
 :let fname = 'Xspa ce'
 :try | exe "w! " . fnameescape(fname) | put='Space' | endtry 
diff --git a/src/version.c b/src/version.c
index 663bdfd12c..ab84a36040 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    384,
 /**/
     383,
 /**/

From 5a82950af2bf97e5b78a1a56346de20a71956ec0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 13:20:39 +0200
Subject: [PATCH 002/473] Added tag v7-4-384 for changeset 6f88e2dafbf6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3f26008c9e..a297e6e40e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3106,3 +3106,4 @@ c3bb76e5b2355c57d7f89997aa9e125e46afdea1 v7-4-376
 0a3d958e346ee051667d3e541273b78fb1dfed9a v7-4-381
 dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 2f02675bc4b051fff7be63f5107f659045a010e1 v7-4-383
+6f88e2dafbf637f573372bb7d8957fe4f2fd0843 v7-4-384

From 5a94db498aa79537d3c244143de56f18122d458a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 13:22:52 +0200
Subject: [PATCH 003/473] updated for version 7.4.385 Problem:    When building
 with tiny or small features building the .mo files 	    fails. Solution:  
 In autoconf do not setup for building the .mo files when it would 	   
 fail.

---
 src/auto/configure | 2 +-
 src/configure.in   | 2 +-
 src/version.c      | 2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/auto/configure b/src/auto/configure
index 4ece95ea80..30db8a022f 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -12966,7 +12966,7 @@ rm -f core conftest.err conftest.$ac_objext \
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5
 $as_echo "msgfmt not found - disabled" >&6; };
     fi
-    if test $have_gettext = "yes"; then
+    if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
       $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
 
       MAKEMO=yes
diff --git a/src/configure.in b/src/configure.in
index fc6d405fe7..1cee1e61d1 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -3818,7 +3818,7 @@ if test "$enable_nls" = "yes"; then
     else
       AC_MSG_RESULT([msgfmt not found - disabled]);
     fi
-    if test $have_gettext = "yes"; then
+    if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then
       AC_DEFINE(HAVE_GETTEXT)
       MAKEMO=yes
       AC_SUBST(MAKEMO)
diff --git a/src/version.c b/src/version.c
index ab84a36040..87b1942df9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    385,
 /**/
     384,
 /**/

From dab4debb31ce8d6ea6b218edafd032e467a41602 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 13:22:52 +0200
Subject: [PATCH 004/473] Added tag v7-4-385 for changeset 6e24b97dde69

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a297e6e40e..bd728924ba 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3107,3 +3107,4 @@ c3bb76e5b2355c57d7f89997aa9e125e46afdea1 v7-4-376
 dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 2f02675bc4b051fff7be63f5107f659045a010e1 v7-4-383
 6f88e2dafbf637f573372bb7d8957fe4f2fd0843 v7-4-384
+6e24b97dde6930a62ade6bee725babf4a39bb0a4 v7-4-385

From c42debb5b146f4ead4a73a370867816aca2ee0e0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 14:05:00 +0200
Subject: [PATCH 005/473] updated for version 7.4.386 Problem:    When
 splitting a window the changelist position is wrong. Solution:   Copy the
 changelist position. (Jacob Niehus)

---
 src/testdir/Make_amiga.mak     |  2 ++
 src/testdir/Make_dos.mak       |  1 +
 src/testdir/Make_ming.mak      |  1 +
 src/testdir/Make_os2.mak       |  1 +
 src/testdir/Make_vms.mms       |  3 ++-
 src/testdir/Makefile           |  1 +
 src/testdir/test_changelist.in | 22 ++++++++++++++++++++++
 src/testdir/test_changelist.ok |  1 +
 src/version.c                  |  2 ++
 src/window.c                   |  5 +++++
 10 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 src/testdir/test_changelist.in
 create mode 100644 src/testdir/test_changelist.ok

diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 46cd6a90de..b4d829da03 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -41,6 +41,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_qf_title.out \
+		test_changelist.out \
 		test_eval.out \
 		test_options.out
 
@@ -171,5 +172,6 @@ test_breakindent.out: test_breakindent.in
 test_listlbr.out: test_listlbr.in
 test_listlbr_utf8.out: test_listlbr_utf8.in
 test_qf_title.out: test_qf_title.in
+test_changelist.out: test_changelist.in
 test_eval.out: test_eval.in
 test_options.out: test_options.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 86176ae481..bd727b8ebd 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -40,6 +40,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_qf_title.out \
+		test_changelist.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index cf10301b22..0664a95983 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -60,6 +60,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_qf_title.out \
+		test_changelist.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index a7f3989f8e..c66489c14a 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -38,6 +38,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
 		test_autoformat_join.out \
+		test_changelist.out \
 		test_eval.out \
 		test_breakindent.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 9bf395be37..1a45e35b79 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Jul 23
+# Last change:  2014 Jul 30
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -101,6 +101,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_listlbr.out \
 	 test_listlbr_utf8.out \
 	 test_qf_title.out \
+	 test_changelist.out \
 	 test_eval.out \
 	 test_options.out
 
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index b5f5d18030..4e4671d9bd 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -38,6 +38,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_qf_title.out \
+		test_changelist.out \
 		test_eval.out \
 		test_options.out
 
diff --git a/src/testdir/test_changelist.in b/src/testdir/test_changelist.in
new file mode 100644
index 0000000000..6c7c4306c3
--- /dev/null
+++ b/src/testdir/test_changelist.in
@@ -0,0 +1,22 @@
+Test changelist position after splitting window
+Set 'undolevels' to make changelist for sourced file
+
+STARTTEST
+:so small.vim
+Gkylp:set ul=100
+Gylp:set ul=100
+gg
+:vsplit
+:try
+:  normal g;
+:  normal ggVGcpass
+:catch
+:  normal ggVGcfail
+:finally
+:  %w! test.out
+:endtry
+:qa!
+ENDTEST
+
+1
+2
diff --git a/src/testdir/test_changelist.ok b/src/testdir/test_changelist.ok
new file mode 100644
index 0000000000..2ae28399f5
--- /dev/null
+++ b/src/testdir/test_changelist.ok
@@ -0,0 +1 @@
+pass
diff --git a/src/version.c b/src/version.c
index 87b1942df9..3967da2c11 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    386,
 /**/
     385,
 /**/
diff --git a/src/window.c b/src/window.c
index 1cf861b476..5012427fae 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1178,6 +1178,11 @@ win_split_ins(size, flags, new_wp, dir)
 	    p_wh = size;
     }
 
+#ifdef FEAT_JUMPLIST
+    /* Keep same changelist position in new window. */
+    wp->w_changelistidx = oldwin->w_changelistidx;
+#endif
+
     /*
      * make the new window the current window
      */

From 55fa02078b0fe01577e387f74118f42211a8ae42 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 14:05:01 +0200
Subject: [PATCH 006/473] Added tag v7-4-386 for changeset 09af7cb358f0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bd728924ba..c06a5ca7b6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3108,3 +3108,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 2f02675bc4b051fff7be63f5107f659045a010e1 v7-4-383
 6f88e2dafbf637f573372bb7d8957fe4f2fd0843 v7-4-384
 6e24b97dde6930a62ade6bee725babf4a39bb0a4 v7-4-385
+09af7cb358f0bafd4b7437ff580f4cd7e15b74a1 v7-4-386

From 828bc11da59685aba117256acddd53cea4da673c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 16:00:58 +0200
Subject: [PATCH 007/473] updated for version 7.4.387 Problem:    "4gro"
 replaces one character then executes "ooo". (Urtica Dioica) Solution:   Write
 the ESC in the second stuff buffer.

---
 src/edit.c                      |  2 +-
 src/getchar.c                   | 11 +++++++++++
 src/proto/getchar.pro           |  1 +
 src/testdir/Make_amiga.mak      |  2 ++
 src/testdir/Make_dos.mak        |  1 +
 src/testdir/Make_ming.mak       |  1 +
 src/testdir/Make_os2.mak        |  1 +
 src/testdir/Make_vms.mms        |  1 +
 src/testdir/Makefile            |  1 +
 src/testdir/test_insertcount.in | 14 ++++++++++++++
 src/testdir/test_insertcount.ok |  3 +++
 src/version.c                   |  2 ++
 12 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 src/testdir/test_insertcount.in
 create mode 100644 src/testdir/test_insertcount.ok

diff --git a/src/edit.c b/src/edit.c
index 6bc517e2fb..6f30d81f60 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -8389,7 +8389,7 @@ ins_esc(count, cmdchar, nomove)
 
 	    (void)start_redo_ins();
 	    if (cmdchar == 'r' || cmdchar == 'v')
-		stuffReadbuff(ESC_STR);	/* no ESC in redo buffer */
+		stuffRedoReadbuff(ESC_STR);	/* no ESC in redo buffer */
 	    ++RedrawingDisabled;
 	    disabled_redraw = TRUE;
 	    return FALSE;	/* repeat the insert */
diff --git a/src/getchar.c b/src/getchar.c
index 9c1ab0f4bd..d646dc4c15 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -678,6 +678,17 @@ stuffReadbuff(s)
     add_buff(&readbuf1, s, -1L);
 }
 
+/*
+ * Append string "s" to the redo stuff buffer.
+ * CSI and K_SPECIAL must already have been escaped.
+ */
+    void
+stuffRedoReadbuff(s)
+    char_u	*s;
+{
+    add_buff(&readbuf2, s, -1L);
+}
+
     void
 stuffReadbuffLen(s, len)
     char_u	*s;
diff --git a/src/proto/getchar.pro b/src/proto/getchar.pro
index 897cad37fc..e90b50527b 100644
--- a/src/proto/getchar.pro
+++ b/src/proto/getchar.pro
@@ -15,6 +15,7 @@ void AppendToRedobuffLit __ARGS((char_u *str, int len));
 void AppendCharToRedobuff __ARGS((int c));
 void AppendNumberToRedobuff __ARGS((long n));
 void stuffReadbuff __ARGS((char_u *s));
+void stuffRedoReadbuff __ARGS((char_u *s));
 void stuffReadbuffLen __ARGS((char_u *s, long len));
 void stuffReadbuffSpec __ARGS((char_u *s));
 void stuffcharReadbuff __ARGS((int c));
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index b4d829da03..030542430c 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -43,6 +43,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
+		test_insertcount.out \
 		test_options.out
 
 .SUFFIXES: .in .out
@@ -174,4 +175,5 @@ test_listlbr_utf8.out: test_listlbr_utf8.in
 test_qf_title.out: test_qf_title.in
 test_changelist.out: test_changelist.in
 test_eval.out: test_eval.in
+test_insertcount.out: test_insertcount.in
 test_options.out: test_options.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index bd727b8ebd..232e8809d3 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -42,6 +42,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
+		test_insertcount.out \
 		test_options.out
 
 SCRIPTS32 =	test50.out test70.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 0664a95983..eb533c9d0b 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -62,6 +62,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
+		test_insertcount.out \
 		test_options.out
 
 SCRIPTS32 =	test50.out test70.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index c66489c14a..0bd0096061 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_autoformat_join.out \
 		test_changelist.out \
 		test_eval.out \
+		test_insertcount.out \
 		test_breakindent.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 1a45e35b79..7ccdf24e72 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -103,6 +103,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_qf_title.out \
 	 test_changelist.out \
 	 test_eval.out \
+	 test_insertcount.out \
 	 test_options.out
 
 # Known problems:
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 4e4671d9bd..f2b2216378 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
+		test_insertcount.out \
 		test_options.out
 
 SCRIPTS_GUI = test16.out
diff --git a/src/testdir/test_insertcount.in b/src/testdir/test_insertcount.in
new file mode 100644
index 0000000000..c7595b1ce9
--- /dev/null
+++ b/src/testdir/test_insertcount.in
@@ -0,0 +1,14 @@
+Tests for repeating insert and replace.
+
+STARTTEST
+:so small.vim
+:/Second
+4gro
+:/^First/,$wq! test.out
+:" get here when failed and in Insert mode
+:.wq! test.out
+ENDTEST
+
+First line
+Second line
+Last line
diff --git a/src/testdir/test_insertcount.ok b/src/testdir/test_insertcount.ok
new file mode 100644
index 0000000000..57afab00ff
--- /dev/null
+++ b/src/testdir/test_insertcount.ok
@@ -0,0 +1,3 @@
+First line
+ooooecond line
+Last line
diff --git a/src/version.c b/src/version.c
index 3967da2c11..33bcfbabd5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    387,
 /**/
     386,
 /**/

From cc791befa3f2fbf952bb57b1038f6dceb8d6bae2 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 16:00:59 +0200
Subject: [PATCH 008/473] Added tag v7-4-387 for changeset 975d96776111

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c06a5ca7b6..9a993b16ed 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3109,3 +3109,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 6f88e2dafbf637f573372bb7d8957fe4f2fd0843 v7-4-384
 6e24b97dde6930a62ade6bee725babf4a39bb0a4 v7-4-385
 09af7cb358f0bafd4b7437ff580f4cd7e15b74a1 v7-4-386
+975d96776111914f69c8a0b98ef7db3bbb83cd10 v7-4-387

From b6bd9449f5ea4078cb4e70843a6d17ea69326f0e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 16:44:22 +0200
Subject: [PATCH 009/473] updated for version 7.4.388 Problem:    With
 'linebreak' set and 'list' unset a Tab is not counted 	    properly. (Kent
 Sibilev) Solution:   Check the 'list' option. (Christian Brabandt)

---
 src/screen.c                     |  2 +-
 src/testdir/test_listlbr_utf8.in | 11 +++++++++++
 src/testdir/test_listlbr_utf8.ok |  7 +++++++
 src/version.c                    |  2 ++
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/screen.c b/src/screen.c
index abbd9112d3..188b36f9c0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4494,7 +4494,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		    tab_len = (int)wp->w_buffer->b_p_ts
 					- vcol % (int)wp->w_buffer->b_p_ts - 1;
 #ifdef FEAT_LINEBREAK
-		    if (!wp->w_p_lbr)
+		    if (!wp->w_p_lbr || !wp->w_p_list)
 #endif
 		    /* tab amount depends on current column */
 			n_extra = tab_len;
diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
index f8888d5332..ba12adae05 100644
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -30,11 +30,22 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
+:"
 :let g:test ="Test 2: set nolinebreak list"
 :set list nolinebreak
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
+:"
+:let g:test ="Test 3: set linebreak nolist"
+:$put =\"\t*mask = nil;\"
+:$
+:norm! zt
+:set nolist linebreak
+:redraw!
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
+:"
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok
index 576ccfb401..634cf3906d 100644
--- a/src/testdir/test_listlbr_utf8.ok
+++ b/src/testdir/test_listlbr_utf8.ok
@@ -12,3 +12,10 @@ Test 2: set nolinebreak list
 +pqrstuvwxyz␣1060ABC
 +DEFGHIJKLMNOPˑ¶    
 ¶                   
+	*mask = nil;
+
+Test 3: set linebreak nolist
+    *mask = nil;    
+~                   
+~                   
+~                   
diff --git a/src/version.c b/src/version.c
index 33bcfbabd5..d80a08aa65 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    388,
 /**/
     387,
 /**/

From e0841d39d256401938e78d158c3cddd7a7b9f98b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 16:44:22 +0200
Subject: [PATCH 010/473] Added tag v7-4-388 for changeset 76e7fb736c0e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9a993b16ed..5819a6514b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3110,3 +3110,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 6e24b97dde6930a62ade6bee725babf4a39bb0a4 v7-4-385
 09af7cb358f0bafd4b7437ff580f4cd7e15b74a1 v7-4-386
 975d96776111914f69c8a0b98ef7db3bbb83cd10 v7-4-387
+76e7fb736c0e9d06b97ff95ee8baad1fb09d420b v7-4-388

From ecb269aa3aef5cffa7e6568c7ba97ad0031fa5a9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 17:21:58 +0200
Subject: [PATCH 011/473] updated for version 7.4.389 Problem:    Still
 sometimes Vim enters Replace mode when starting up. Solution:   Use a
 different solution in detecting the termresponse and 	    location response.
 (Hayaki Saito)

---
 src/globals.h      |   3 -
 src/os_unix.c      |  26 ++-------
 src/proto/term.pro |   2 -
 src/term.c         | 136 ++++++++++++++++++---------------------------
 src/version.c      |   2 +
 5 files changed, 61 insertions(+), 108 deletions(-)

diff --git a/src/globals.h b/src/globals.h
index b3310b3680..77528c7b58 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1336,9 +1336,6 @@ EXTERN HWND	clientWindow INIT(= 0);
 #if defined(UNIX) || defined(VMS)
 EXTERN int	term_is_xterm INIT(= FALSE);	/* xterm-like 'term' */
 #endif
-#if defined(UNIX)
-EXTERN int	xterm_conflict_mouse INIT(= FALSE);
-#endif
 
 #ifdef BACKSLASH_IN_FILENAME
 EXTERN char	psepc INIT(= '\\');	/* normal path separator character */
diff --git a/src/os_unix.c b/src/os_unix.c
index 033ce3cc3b..124c2693bc 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3667,8 +3667,6 @@ mch_setmouse(on)
     void
 check_mouse_termcode()
 {
-    xterm_conflict_mouse = FALSE;
-
 # ifdef FEAT_MOUSE_XTERM
     if (use_xterm_mouse()
 # ifdef FEAT_MOUSE_URXVT
@@ -3713,7 +3711,7 @@ check_mouse_termcode()
 # endif
 
 # ifdef FEAT_MOUSE_JSB
-    /* There is no conflict, but it was disabled for xterm before. */
+    /* Conflicts with xterm mouse: "\033[" and "\033[M" ??? */
     if (!use_xterm_mouse()
 #  ifdef FEAT_GUI
 	    && !gui.in_use
@@ -3740,45 +3738,31 @@ check_mouse_termcode()
 # endif
 
 # ifdef FEAT_MOUSE_DEC
-    /* Conflicts with xterm mouse: "\033[" and "\033[M".
-     * Also conflicts with the xterm termresponse, skip this if it was
-     * requested already. */
+    /* Conflicts with xterm mouse: "\033[" and "\033[M" */
     if (!use_xterm_mouse()
-#  ifdef FEAT_TERMRESPONSE
-	    && !did_request_esc_sequence()
-#  endif
 #  ifdef FEAT_GUI
 	    && !gui.in_use
 #  endif
 	    )
-    {
 	set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME)
 		     ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "[")));
-	xterm_conflict_mouse = TRUE;
-    }
     else
 	del_mouse_termcode(KS_DEC_MOUSE);
 # endif
 # ifdef FEAT_MOUSE_PTERM
-    /* same as the dec mouse */
+    /* same conflict as the dec mouse */
     if (!use_xterm_mouse()
-#  ifdef FEAT_TERMRESPONSE
-	    && !did_request_esc_sequence()
-#  endif
 #  ifdef FEAT_GUI
 	    && !gui.in_use
 #  endif
 	    )
-    {
 	set_mouse_termcode(KS_PTERM_MOUSE,
 				      (char_u *) IF_EB("\033[", ESC_STR "["));
-	xterm_conflict_mouse = TRUE;
-    }
     else
 	del_mouse_termcode(KS_PTERM_MOUSE);
 # endif
 # ifdef FEAT_MOUSE_URXVT
-    /* same as the dec mouse */
+    /* same conflict as the dec mouse */
     if (use_xterm_mouse() == 3
 #  ifdef FEAT_GUI
 	    && !gui.in_use
@@ -3794,8 +3778,6 @@ check_mouse_termcode()
 	    mch_setmouse(FALSE);
 	    setmouse();
 	}
-	/* It's OK to request the xterm version for uxterm. */
-	resume_get_esc_sequence();
     }
     else
 	del_mouse_termcode(KS_URXVT_MOUSE);
diff --git a/src/proto/term.pro b/src/proto/term.pro
index 89d58a0d0f..b3d0df39d8 100644
--- a/src/proto/term.pro
+++ b/src/proto/term.pro
@@ -34,8 +34,6 @@ void set_shellsize __ARGS((int width, int height, int mustset));
 void settmode __ARGS((int tmode));
 void starttermcap __ARGS((void));
 void stoptermcap __ARGS((void));
-int did_request_esc_sequence __ARGS((void));
-void resume_get_esc_sequence __ARGS((void));
 void may_req_termresponse __ARGS((void));
 void may_req_ambiguous_char_width __ARGS((void));
 int swapping_screen __ARGS((void));
diff --git a/src/term.c b/src/term.c
index 95c29ccf48..a1ab537295 100644
--- a/src/term.c
+++ b/src/term.c
@@ -153,11 +153,6 @@ char *UP, *BC, PC;
 static char_u *vim_tgetstr __ARGS((char *s, char_u **pp));
 #endif /* HAVE_TGETENT */
 
-#if defined(FEAT_TERMRESPONSE)
-static int xt_index_in = 0;
-static int xt_index_out = 0;
-#endif
-
 static int  detected_8bit = FALSE;	/* detected 8-bit terminal */
 
 static struct builtin_term builtin_termcaps[] =
@@ -3312,40 +3307,6 @@ stoptermcap()
 }
 
 #if defined(FEAT_TERMRESPONSE) || defined(PROTO)
-# if defined(UNIX) || defined(PROTO)
-/*
- * Return TRUE when the xterm version was requested or anything else that
- * would send an ESC sequence back to Vim.
- * If not sent yet, prevent it from being sent soon.
- * Used to check whether it is OK to enable checking for DEC mouse codes,
- * which conflict with may xterm ESC sequences.
- */
-    int
-did_request_esc_sequence()
-{
-    if (crv_status == CRV_GET)
-	crv_status = 0;
-    if (u7_status == U7_GET)
-	u7_status = 0;
-    return crv_status == CRV_SENT || u7_status == U7_SENT
-						|| xt_index_out > xt_index_in;
-}
-
-/*
- * If requesting the version was disabled in did_request_esc_sequence(),
- * enable it again.
- */
-    void
-resume_get_esc_sequence()
-{
-    if (crv_status == 0)
-	crv_status = CRV_GET;
-    if (u7_status == 0)
-	u7_status = U7_GET;
-}
-# endif
-
-
 /*
  * Request version string (for xterm) when needed.
  * Only do this after switching to raw mode, otherwise the result will be
@@ -3358,8 +3319,6 @@ resume_get_esc_sequence()
  * Insert mode.
  * On Unix only do it when both output and input are a tty (avoid writing
  * request to terminal while reading from a file).
- * Do not do this when a mouse is being detected that starts with the same ESC
- * sequence as the termresponse.
  * The result is caught in check_termcode().
  */
     void
@@ -3373,7 +3332,6 @@ may_req_termresponse()
 # ifdef UNIX
 	    && isatty(1)
 	    && isatty(read_cmd_fd)
-	    && !xterm_conflict_mouse
 # endif
 	    && *T_CRV != NUL)
     {
@@ -3742,8 +3700,8 @@ add_termcode(name, string, flags)
 #if defined(WIN3264) && !defined(FEAT_GUI)
     if (s[0] == K_NUL)
     {
-        STRMOVE(s + 1, s);
-        s[1] = 3;
+	STRMOVE(s + 1, s);
+	s[1] = 3;
     }
 #endif
 
@@ -4212,24 +4170,31 @@ check_termcode(max_offset, buf, bufsize, buflen)
 
 #ifdef FEAT_TERMRESPONSE
 	if (key_name[0] == NUL
-	    /* URXVT mouse uses <ESC>[#;#;#M, but we are matching <ESC>[ */
+	    /* Mouse codes of DEC, pterm, and URXVT start with <ESC>[.  When
+	     * detecting the start of these mouse codes they might as well be
+	     * another key code or terminal response. */
+# ifdef FEAT_MOUSE_DEC
+	    || key_name[0] == KS_DEC_MOUSE
+# endif
+# ifdef FEAT_MOUSE_PTERM
+	    || key_name[0] == KS_PTERM_MOUSE
+# endif
+# ifdef FEAT_MOUSE_URXVT
 	    || key_name[0] == KS_URXVT_MOUSE
-# ifdef FEAT_MBYTE
-	    || u7_status == U7_SENT
 # endif
-            )
+	   )
 	{
-	    /* Check for some responses from terminal start with "<Esc>[" or
-	     * CSI.
+	    /* Check for some responses from the terminal starting with
+	     * "<Esc>[" or CSI:
 	     *
-	     * - xterm version string: <Esc>[>{x};{vers};{y}c
+	     * - Xterm version string: <Esc>[>{x};{vers};{y}c
 	     *   Also eat other possible responses to t_RV, rxvt returns
 	     *   "<Esc>[?1;2c". Also accept CSI instead of <Esc>[.
 	     *   mrxvt has been reported to have "+" in the version. Assume
 	     *   the escape sequence ends with a letter or one of "{|}~".
 	     *
-	     * - cursor position report: <Esc>[{row};{col}R
-	     *   The final byte is 'R'. now it is only used for checking for
+	     * - Cursor position report: <Esc>[{row};{col}R
+	     *   The final byte must be 'R'. It is used for checking the
 	     *   ambiguous-width character state.
 	     */
 	    p = tp[0] == CSI ? tp + 1 : tp + 2;
@@ -4269,36 +4234,42 @@ check_termcode(max_offset, buf, bufsize, buflen)
 		 * u7_status is not "sent", it may be from a previous Vim that
 		 * just exited.  But not for <S-F3>, it sends something
 		 * similar, check for row and column to make sense. */
-		if (j == 1 && tp[i] == 'R' && row_char == '2' && col >= 2)
+		if (j == 1 && tp[i] == 'R')
 		{
-		    char *aw = NULL;
+		    if (row_char == '2' && col >= 2)
+		    {
+			char *aw = NULL;
 
-		    LOG_TR("Received U7 status");
-		    u7_status = U7_GOT;
+			LOG_TR("Received U7 status");
+			u7_status = U7_GOT;
 # ifdef FEAT_AUTOCMD
-		    did_cursorhold = TRUE;
+			did_cursorhold = TRUE;
 # endif
-		    if (col == 2)
-			aw = "single";
-		    else if (col == 3)
-			aw = "double";
-		    if (aw != NULL && STRCMP(aw, p_ambw) != 0)
-		    {
-			/* Setting the option causes a screen redraw. Do that
-			 * right away if possible, keeping any messages. */
-			set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
-# ifdef DEBUG_TERMRESPONSE
+			if (col == 2)
+			    aw = "single";
+			else if (col == 3)
+			    aw = "double";
+			if (aw != NULL && STRCMP(aw, p_ambw) != 0)
 			{
-			    char buf[100];
-			    int  r = redraw_asap(CLEAR);
+			    /* Setting the option causes a screen redraw. Do
+			     * that right away if possible, keeping any
+			     * messages. */
+			    set_option_value((char_u *)"ambw", 0L,
+					     (char_u *)aw, 0);
+# ifdef DEBUG_TERMRESPONSE
+			    {
+				char buf[100];
+				int  r = redraw_asap(CLEAR);
 
-			    sprintf(buf, "set 'ambiwidth', redraw_asap(): %d",
-									   r);
-			    log_tr(buf);
-			}
+				sprintf(buf,
+					"set 'ambiwidth', redraw_asap(): %d",
+					r);
+				log_tr(buf);
+			    }
 # else
-			redraw_asap(CLEAR);
+			    redraw_asap(CLEAR);
 # endif
+			}
 		    }
 		    key_name[0] = (int)KS_EXTRA;
 		    key_name[1] = (int)KE_IGNORE;
@@ -4563,19 +4534,19 @@ check_termcode(max_offset, buf, bufsize, buflen)
 			return -1;
 
 		    /* when mouse reporting is SGR, add 32 to mouse code */
-                    if (key_name[0] == KS_SGR_MOUSE)
-                        mouse_code += 32;
+		    if (key_name[0] == KS_SGR_MOUSE)
+			mouse_code += 32;
 
 		    mouse_col = getdigits(&p) - 1;
 		    if (*p++ != ';')
 			return -1;
 
 		    mouse_row = getdigits(&p) - 1;
-                    if (key_name[0] == KS_SGR_MOUSE && *p == 'm')
+		    if (key_name[0] == KS_SGR_MOUSE && *p == 'm')
 			mouse_code |= MOUSE_RELEASE;
-                    else if (*p != 'M')
+		    else if (*p != 'M')
 			return -1;
-                    p++;
+		    p++;
 
 		    slen += (int)(p - (tp + slen));
 
@@ -4592,7 +4563,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
 			for (slen2 = slen; slen2 < len; slen2++)
 			{
 			    if (tp[slen2] == 'M'
-                                || (key_name[0] == KS_SGR_MOUSE
+				    || (key_name[0] == KS_SGR_MOUSE
 							 && tp[slen2] == 'm'))
 			    {
 				cmd_complete = 1;
@@ -5769,6 +5740,9 @@ show_one_termcode(name, code, printit)
  * termcap codes from the terminal itself.
  * We get them one by one to avoid a very long response string.
  */
+static int xt_index_in = 0;
+static int xt_index_out = 0;
+
     static void
 req_codes_from_term()
 {
diff --git a/src/version.c b/src/version.c
index d80a08aa65..d5aaa90500 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    389,
 /**/
     388,
 /**/

From d1b325f5fa09dceb8b1d730f4eb6f68acf29f714 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 30 Jul 2014 17:21:58 +0200
Subject: [PATCH 012/473] Added tag v7-4-389 for changeset 3d206df5c828

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5819a6514b..59c2c12b7a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3111,3 +3111,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 09af7cb358f0bafd4b7437ff580f4cd7e15b74a1 v7-4-386
 975d96776111914f69c8a0b98ef7db3bbb83cd10 v7-4-387
 76e7fb736c0e9d06b97ff95ee8baad1fb09d420b v7-4-388
+3d206df5c8284f7d5f4a987ae9c7a508f289f008 v7-4-389

From 8999809c95b7baffbd00c4945c3c554b70a5447b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 12:49:18 +0200
Subject: [PATCH 013/473] updated for version 7.4.390 Problem:    Advancing
 pointer over end of a string. Solution:   Init quote character to -1 instead
 of zero. (Dominique Pelle)

---
 src/misc1.c   | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/misc1.c b/src/misc1.c
index 3a834aa0cf..2c28aae84c 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -5503,7 +5503,7 @@ cin_has_js_key(text)
     char_u *text;
 {
     char_u *s = skipwhite(text);
-    int	    quote = 0;
+    int	    quote = -1;
 
     if (*s == '\'' || *s == '"')
     {
diff --git a/src/version.c b/src/version.c
index d5aaa90500..d2de43f7ac 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    390,
 /**/
     389,
 /**/

From 8b16a4dc33cfedb44c0154bbd5865432ccb6e838 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 12:49:18 +0200
Subject: [PATCH 014/473] Added tag v7-4-390 for changeset d3a674f6c737

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 59c2c12b7a..d76bdabe6f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3112,3 +3112,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 975d96776111914f69c8a0b98ef7db3bbb83cd10 v7-4-387
 76e7fb736c0e9d06b97ff95ee8baad1fb09d420b v7-4-388
 3d206df5c8284f7d5f4a987ae9c7a508f289f008 v7-4-389
+d3a674f6c7370f70d6b66dcefb9e36d22d73c7b7 v7-4-390

From f8b7c86a6a36031231e48a247945bf6efcdd1f3f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 13:20:56 +0200
Subject: [PATCH 015/473] updated for version 7.4.391 Problem:    No
 'cursorline' highlighting when the cursor is on a line with 	    diff
 highlighting. (Benjamin Fritz) Solution:   Combine the highlight attributes.
 (Christian Brabandt)

---
 src/screen.c  | 19 ++++++++++++++++---
 src/version.c |  2 ++
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 188b36f9c0..3ab53d9e27 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3702,7 +3702,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		    char_attr = 0; /* was: hl_attr(HLF_AT); */
 #ifdef FEAT_DIFF
 		    if (diff_hlf != (hlf_T)0)
+		    {
 			char_attr = hl_attr(diff_hlf);
+			if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+			    char_attr = hl_combine_attr(char_attr,
+							    hl_attr(HLF_CUL));
+		    }
 #endif
 		    p_extra = NULL;
 		    c_extra = ' ';
@@ -3753,7 +3758,8 @@ win_line(wp, lnum, startrow, endrow, nochange)
 #ifdef FEAT_SYN_HL
 		    /* combine 'showbreak' with 'cursorline' */
 		    if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
-			char_attr = hl_combine_attr(char_attr, HLF_CLN);
+			char_attr = hl_combine_attr(char_attr,
+							    hl_attr(HLF_CUL));
 #endif
 		}
 # endif
@@ -3931,6 +3937,8 @@ win_line(wp, lnum, startrow, endrow, nochange)
 							      && n_extra == 0)
 		    diff_hlf = HLF_CHD;		/* changed line */
 		line_attr = hl_attr(diff_hlf);
+		if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+		    line_attr = hl_combine_attr(line_attr, hl_attr(HLF_CUL));
 	    }
 #endif
 
@@ -4729,7 +4737,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		    {
 			diff_hlf = HLF_CHD;
 			if (attr == 0 || char_attr != attr)
+			{
 			    char_attr = hl_attr(diff_hlf);
+			    if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
+				char_attr = hl_combine_attr(char_attr,
+							    hl_attr(HLF_CUL));
+			}
 		    }
 # endif
 		}
@@ -10174,9 +10187,9 @@ draw_tabline()
 			break;
 		    screen_puts_len(NameBuff, len, 0, col,
 #if defined(FEAT_SYN_HL)
-					   hl_combine_attr(attr, hl_attr(HLF_T))
+					 hl_combine_attr(attr, hl_attr(HLF_T))
 #else
-					   attr
+					 attr
 #endif
 					       );
 		    col += len;
diff --git a/src/version.c b/src/version.c
index d2de43f7ac..fa2efdf4fd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    391,
 /**/
     390,
 /**/

From 85aca870d7e7b44d8b3f8d668a7a23cb176f9440 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 13:20:56 +0200
Subject: [PATCH 016/473] Added tag v7-4-391 for changeset f051e50a6a5f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d76bdabe6f..574438f1e4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3113,3 +3113,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 76e7fb736c0e9d06b97ff95ee8baad1fb09d420b v7-4-388
 3d206df5c8284f7d5f4a987ae9c7a508f289f008 v7-4-389
 d3a674f6c7370f70d6b66dcefb9e36d22d73c7b7 v7-4-390
+f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391

From b3a0c515d2d0dfc412189eca662b675c4e815d09 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 13:36:59 +0200
Subject: [PATCH 017/473] updated for version 7.4.392 Problem:    Not easy to
 detect type of command line window. Solution:   Add the getcmdwintype()
 function. (Jacob Niehus)

---
 src/eval.c    | 22 ++++++++++++++++++++++
 src/version.c |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/src/eval.c b/src/eval.c
index aedbaa4ce0..4e512af648 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -554,6 +554,7 @@ static void f_getcharmod __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getcmdline __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getcmdpos __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getcmdtype __ARGS((typval_T *argvars, typval_T *rettv));
+static void f_getcmdwintype __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getcwd __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getfontname __ARGS((typval_T *argvars, typval_T *rettv));
 static void f_getfperm __ARGS((typval_T *argvars, typval_T *rettv));
@@ -7984,6 +7985,7 @@ static struct fst
     {"getcmdline",	0, 0, f_getcmdline},
     {"getcmdpos",	0, 0, f_getcmdpos},
     {"getcmdtype",	0, 0, f_getcmdtype},
+    {"getcmdwintype",	0, 0, f_getcmdwintype},
     {"getcurpos",	0, 0, f_getcurpos},
     {"getcwd",		0, 0, f_getcwd},
     {"getfontname",	0, 1, f_getfontname},
@@ -11502,6 +11504,26 @@ f_getcmdtype(argvars, rettv)
     }
 }
 
+/*
+ * "getcmdwintype()" function
+ */
+    static void
+f_getcmdwintype(argvars, rettv)
+    typval_T	*argvars UNUSED;
+    typval_T	*rettv;
+{
+    rettv->v_type = VAR_STRING;
+    rettv->vval.v_string = NULL;
+#ifdef FEAT_CMDWIN
+    rettv->vval.v_string = alloc(2);
+    if (rettv->vval.v_string != NULL)
+    {
+	rettv->vval.v_string[0] = cmdwin_type;
+	rettv->vval.v_string[1] = NUL;
+    }
+#endif
+}
+
 /*
  * "getcwd()" function
  */
diff --git a/src/version.c b/src/version.c
index fa2efdf4fd..6610ba110e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    392,
 /**/
     391,
 /**/

From bed3296d3c57767d14db7f3bdf15d535cdc401fd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 13:36:59 +0200
Subject: [PATCH 018/473] Added tag v7-4-392 for changeset 589fd07888ab

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 574438f1e4..4326008a12 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3114,3 +3114,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 3d206df5c8284f7d5f4a987ae9c7a508f289f008 v7-4-389
 d3a674f6c7370f70d6b66dcefb9e36d22d73c7b7 v7-4-390
 f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
+589fd07888abc8a1208616c56b21898d3352fc5b v7-4-392

From 4acedfc63b960ea0d929882b416e519f22aa625a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 14:52:30 +0200
Subject: [PATCH 019/473] updated for version 7.4.393 Problem:    Text drawing
 on newer MS-Windows systems is suboptimal.  Some 	    multi-byte
 characters are not displayed, even though the same font 	    in Notepad
 can display them. (Srinath Avadhanula) Solution:   Add the 'renderoptions'
 option to enable Direct-X drawing. (Taro 	    Muraoka)

---
 runtime/doc/eval.txt    |   1 +
 runtime/doc/options.txt |  71 ++++
 runtime/doc/various.txt |   1 +
 src/Make_cyg.mak        |  32 +-
 src/Make_ming.mak       |  35 +-
 src/Make_mvc.mak        |  21 +
 src/eval.c              |   3 +
 src/gui_dwrite.cpp      | 901 ++++++++++++++++++++++++++++++++++++++++
 src/gui_dwrite.h        |  85 ++++
 src/gui_w32.c           | 204 ++++++++-
 src/gui_w48.c           |  21 +
 src/option.c            |  17 +
 src/option.h            |   3 +
 src/proto/gui_w32.pro   |   2 +
 src/version.c           |   9 +
 src/vim.h               |   7 +
 16 files changed, 1390 insertions(+), 23 deletions(-)
 create mode 100644 src/gui_dwrite.cpp
 create mode 100644 src/gui_dwrite.h

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index cbd995da3d..62aa167041 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -6622,6 +6622,7 @@ dialog_con		Compiled with console dialog support.
 dialog_gui		Compiled with GUI dialog support.
 diff			Compiled with |vimdiff| and 'diff' support.
 digraphs		Compiled with support for digraphs.
+directx			Compiled with support for Direct-X and 'renderoptions'.
 dnd			Compiled with support for the "~ register |quote_~|.
 dos16			16 bits DOS version of Vim.
 dos32			32 bits DOS (DJGPP) version of Vim.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 90d4ca7a70..5f4a06e7ef 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5650,6 +5650,77 @@ A jump table for the options with a short description can be found at |Q_op|.
 	this option at the default "on".  Only switch it off when working with
 	old Vi scripts.
 
+                                               *'renderoptions'* *'rop'*
+'renderoptions' 'rop'	string  (default: empty)
+			global
+			{not in Vi}
+			{only available when compiled with GUI and DIRECTX on
+			MS-Windows}
+	Select a text renderer and set its options.  The options depend on the
+	renderer.
+
+	Syntax: >
+		set rop=type:{renderer}(,{name}:{value})*
+<
+	Currently, only one optional renderer is available.
+
+	render	behavior    ~
+	directx	Vim will draw text using DirectX (DirectWrite).  It makes
+		drawn glyphs more beautiful than default GDI.
+		It requires 'encoding' is "utf-8", and only works on
+		MS-Windows Vista or newer version.
+
+		Options:
+		  name	    meaning		type	value       ~
+		  gamma	    gamma		float	1.0 - 2.2 (maybe)
+		  contrast  enhancedContrast	float	(unknown)
+		  level	    clearTypeLevel	float	(unknown)
+		  geom	    pixelGeometry	int	0 - 2 (see below)
+		  renmode   renderingMode	int	0 - 6 (see below)
+		  taamode   textAntialiasMode	int	0 - 3 (see below)
+
+		See this URL for detail:
+		  http://msdn.microsoft.com/en-us/library/dd368190.aspx
+
+		For geom: structure of a device pixel.
+		  0 - DWRITE_PIXEL_GEOMETRY_FLAT
+		  1 - DWRITE_PIXEL_GEOMETRY_RGB
+		  2 - DWRITE_PIXEL_GEOMETRY_BGR
+
+		See this URL for detail:
+		  http://msdn.microsoft.com/en-us/library/dd368114.aspx
+
+		For renmode: method of rendering glyphs.
+		  0 - DWRITE_RENDERING_MODE_DEFAULT
+		  1 - DWRITE_RENDERING_MODE_ALIASED
+		  2 - DWRITE_RENDERING_MODE_GDI_CLASSIC
+		  3 - DWRITE_RENDERING_MODE_GDI_NATURAL
+		  4 - DWRITE_RENDERING_MODE_NATURAL
+		  5 - DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
+		  6 - DWRITE_RENDERING_MODE_OUTLINE
+
+		See this URL for detail:
+		  http://msdn.microsoft.com/en-us/library/dd368118.aspx
+
+		For taamode: antialiasing mode used for drawing text.
+		  0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
+		  1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
+		  2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
+		  3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED
+
+		See this URL for detail:
+		  http://msdn.microsoft.com/en-us/library/dd368170.aspx
+
+		Example: >
+		  set encoding=utf-8
+		  set gfn=Ricty_Diminished:h12:cSHIFTJIS
+		  set rop=type:directx
+<
+		If select a raster font (Courier, Terminal or FixedSys) to
+		'guifont', it fallbacks to be drawn by GDI automatically.
+
+	Other render types are currently not supported.
+
 						*'report'*
 'report'		number	(default 2)
 			global
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index b264e5be8c..a03a0bd94a 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -337,6 +337,7 @@ N  *+dialog_con*	Support for |:confirm| with console dialog.
 N  *+dialog_con_gui*	Support for |:confirm| with GUI and console dialog.
 N  *+diff*		|vimdiff| and 'diff'
 N  *+digraphs*		|digraphs| *E196*
+m  *+directx*		Win32 GUI only: DirectX and |'renderoptions'|
    *+dnd*		Support for DnD into the "~ register |quote_~|.
 B  *+emacs_tags*	|emacs-tags| files
 N  *+eval*		expression evaluation |eval.txt|
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index f349798078..24f19c9f2a 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -8,6 +8,7 @@
 # Cygwin application use the Makefile (just like on Unix).
 #
 # GUI		no or yes: set to yes if you want the GUI version (yes)
+# DIRECTX	no or yes: set to yes if you want use DirectWrite (no)
 # PERL		define to path to Perl dir to get Perl support (not defined)
 #   PERL_VER	  define to version of Perl being used (56)
 #   DYNAMIC_PERL  no or yes: set to yes to load the Perl DLL dynamically (yes)
@@ -88,6 +89,10 @@ ifndef ARCH
 ARCH = i386
 endif
 
+ifndef DIRECTX
+DIRECTX = no
+endif
+
 ifndef WINVER
 WINVER = 0x0500
 endif
@@ -469,6 +474,15 @@ endif
 
 endif
 
+##############################
+ifeq (yes, $(DIRECTX))
+# Only allow DIRECTX for a GUI build.
+DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+EXTRA_OBJS += $(OUTDIR)/gui_dwrite.o
+EXTRA_LIBS += -ld2d1 -ldwrite
+USE_STDCPLUS = yes
+endif
+
 ##############################
 ifdef XPM
 # Only allow XPM for a GUI build.
@@ -495,11 +509,7 @@ ifeq (yes, $(OLE))
 DEFINES += -DFEAT_OLE
 EXTRA_OBJS += $(OUTDIR)/if_ole.o
 EXTRA_LIBS += -loleaut32
-ifeq (yes, $(STATIC_STDCPLUS))
-EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-EXTRA_LIBS += -lstdc++
-endif
+USE_STDCPLUS = yes
 endif
 
 ##############################
@@ -513,6 +523,15 @@ MKDIR = mkdir
 DIRSLASH = \\
 endif
 
+##############################
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+EXTRA_LIBS += -lstdc++
+endif
+endif
+
 #>>>>> end of choices
 ###########################################################################
 
@@ -643,6 +662,9 @@ $(OUTDIR)/ex_eval.o:	ex_eval.c $(INCL) ex_cmds.h
 $(OUTDIR)/gui_w32.o:	gui_w32.c gui_w48.c $(INCL)
 	$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
 
+$(OUTDIR)/gui_dwrite.o:	gui_dwrite.cpp $(INCL) gui_dwrite.h
+	$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+
 $(OUTDIR)/if_cscope.o:	if_cscope.c $(INCL) if_cscope.h
 	$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
 
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index f7088ad58e..de1d88fe4c 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -31,6 +31,8 @@ DEBUG=no
 OPTIMIZE=MAXSPEED
 # set to yes to make gvim, no for vim
 GUI=yes
+# set to yes if you want to use DirectWrite (DirectX)
+DIRECTX=no
 # FEATURES=[TINY | SMALL  | NORMAL | BIG | HUGE]
 # Set to TINY to make minimal version (few features).
 FEATURES=BIG
@@ -456,6 +458,14 @@ endif
 endif
 endif
 
+# DirectWrite (DirectX)
+ifeq ($(DIRECTX),yes)
+# Only allow DirectWrite for a GUI build.
+ifeq (yes, $(GUI))
+DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+endif
+endif
+
 # Only allow XPM for a GUI build.
 ifeq (yes, $(GUI))
 
@@ -593,6 +603,14 @@ OBJ += $(OUTDIR)/netbeans.o
 LIB += -lwsock32
 endif
 endif
+ifeq ($(DIRECTX),yes)
+# Only allow DIRECTX for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/gui_dwrite.o
+LIB += -ld2d1 -ldwrite
+USE_STDCPLUS = yes
+endif
+endif
 ifdef XPM
 # Only allow XPM for a GUI build.
 ifeq (yes, $(GUI))
@@ -650,11 +668,7 @@ endif
 ifeq (yes, $(OLE))
 LIB += -loleaut32
 OBJ += $(OUTDIR)/if_ole.o
-ifeq (yes, $(STATIC_STDCPLUS))
-LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-LIB += -lstdc++
-endif
+USE_STDCPLUS = yes
 endif
 
 ifeq (yes, $(MBYTE))
@@ -678,6 +692,14 @@ endif
 DEFINES+=-DDYNAMIC_ICONV
 endif
 
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+LIB += -lstdc++
+endif
+endif
+
 all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
 
 vimrun.exe: vimrun.c
@@ -751,6 +773,9 @@ $(OUTDIR)/ex_eval.o:	ex_eval.c $(INCL) ex_cmds.h
 $(OUTDIR)/gui_w32.o:	gui_w32.c gui_w48.c $(INCL)
 	$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
 
+$(OUTDIR)/gui_dwrite.o:	gui_dwrite.cpp $(INCL) gui_dwrite.h
+	$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+
 $(OUTDIR)/if_cscope.o:	if_cscope.c $(INCL) if_cscope.h
 	$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
 
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 4a979e419b..24069b24e9 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -24,6 +24,9 @@
 #
 #	GUI interface: GUI=yes (default is no)
 #
+#	GUI with DirectWrite(DirectX): DIRECTX=yes
+#	  (default is no, requires GUI=yes)
+#
 #	OLE interface: OLE=yes (usually with GUI=yes)
 #
 #	Multibyte support: MBYTE=yes (default is no)
@@ -168,6 +171,9 @@ OBJDIR = .\ObjG
 !else
 OBJDIR = .\ObjC
 !endif
+!if "$(DIRECTX)" == "yes"
+OBJDIR = $(OBJDIR)X
+!endif
 !if "$(OLE)" == "yes"
 OBJDIR = $(OBJDIR)O
 !endif
@@ -292,6 +298,13 @@ NBDEBUG_SRC	= nbdebug.c
 NETBEANS_LIB	= WSock32.lib
 !endif
 
+# DirectWrite(DirectX)
+!if "$(DIRECTX)" == "yes"
+DIRECTX_DEFS	= -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+DIRECTX_INCL	= gui_dwrite.h
+DIRECTX_OBJ	= $(OUTDIR)\gui_dwrite.obj
+!endif
+
 !ifndef XPM
 # XPM is not set, use the included xpm files, depending on the architecture.
 !if "$(CPU)" == "AMD64"
@@ -642,6 +655,12 @@ GUI_LIB = \
 SUBSYSTEM = console
 !endif
 
+!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
+CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
+GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
+GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
+!endif
+
 # iconv.dll library (dynamically loaded)
 !ifndef ICONV
 ICONV = yes
@@ -1107,6 +1126,8 @@ $(OUTDIR)/gui_beval.obj:	$(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
 
 $(OUTDIR)/gui_w32.obj:	$(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
 
+$(OUTDIR)/gui_dwrite.obj:	$(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
+
 $(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c  $(INCL)
 
 $(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c  $(INCL)
diff --git a/src/eval.c b/src/eval.c
index 4e512af648..ae8331d5aa 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -12464,6 +12464,9 @@ f_has(argvars, rettv)
 #ifdef FEAT_DIGRAPHS
 	"digraphs",
 #endif
+#ifdef FEAT_DIRECTX
+	"directx",
+#endif
 #ifdef FEAT_DND
 	"dnd",
 #endif
diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
new file mode 100644
index 0000000000..cf83c05044
--- /dev/null
+++ b/src/gui_dwrite.cpp
@@ -0,0 +1,901 @@
+/* vi:set ts=8 sts=4 sw=4 noet: */
+/*
+ * Author: MURAOKA Taro <koron.kaoriya@gmail.com>
+ *
+ * Contributors:
+ *  - Ken Takata
+ *
+ * Copyright (C) 2013 MURAOKA Taro <koron.kaoriya@gmail.com>
+ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
+ */
+
+#define WIN32_LEAN_AND_MEAN
+
+#ifndef DYNAMIC_DIRECTX
+# if WINVER < 0x0600
+#  error WINVER must be 0x0600 or above to use DirectWrite(DirectX)
+# endif
+#endif
+
+#include <windows.h>
+#include <crtdbg.h>
+#include <assert.h>
+#include <math.h>
+#include <d2d1.h>
+#include <d2d1helper.h>
+#include <dwrite.h>
+
+#include "gui_dwrite.h"
+
+#ifdef __MINGW32__
+# define __maybenull	SAL__maybenull
+# define __in		SAL__in
+# define __out		SAL__out
+#endif
+
+#ifdef DYNAMIC_DIRECTX
+extern "C" HINSTANCE vimLoadLib(char *name);
+
+typedef int (WINAPI *PGETUSERDEFAULTLOCALENAME)(LPWSTR, int);
+typedef HRESULT (WINAPI *PD2D1CREATEFACTORY)(D2D1_FACTORY_TYPE,
+	REFIID, const D2D1_FACTORY_OPTIONS *, void **);
+typedef HRESULT (WINAPI *PDWRITECREATEFACTORY)(DWRITE_FACTORY_TYPE,
+	REFIID, IUnknown **);
+
+static HINSTANCE hD2D1DLL = NULL;
+static HINSTANCE hDWriteDLL = NULL;
+
+static PGETUSERDEFAULTLOCALENAME pGetUserDefaultLocaleName = NULL;
+static PD2D1CREATEFACTORY pD2D1CreateFactory = NULL;
+static PDWRITECREATEFACTORY pDWriteCreateFactory = NULL;
+
+#define GetUserDefaultLocaleName	(*pGetUserDefaultLocaleName)
+#define D2D1CreateFactory		(*pD2D1CreateFactory)
+#define DWriteCreateFactory		(*pDWriteCreateFactory)
+
+    static void
+unload(HINSTANCE &hinst)
+{
+    if (hinst != NULL)
+    {
+	FreeLibrary(hinst);
+	hinst = NULL;
+    }
+}
+#endif // DYNAMIC_DIRECTX
+
+template <class T> inline void SafeRelease(T **ppT)
+{
+    if (*ppT)
+    {
+	(*ppT)->Release();
+	*ppT = NULL;
+    }
+}
+
+struct GdiTextRendererContext
+{
+    // const fields.
+    COLORREF color;
+    FLOAT cellWidth;
+
+    // working fields.
+    FLOAT offsetX;
+};
+
+    static DWRITE_PIXEL_GEOMETRY
+ToPixelGeometry(int value)
+{
+    switch (value)
+    {
+	default:
+	case 0:
+	    return DWRITE_PIXEL_GEOMETRY_FLAT;
+	case 1:
+	    return DWRITE_PIXEL_GEOMETRY_RGB;
+	case 2:
+	    return DWRITE_PIXEL_GEOMETRY_BGR;
+    }
+}
+
+    static int
+ToInt(DWRITE_PIXEL_GEOMETRY value)
+{
+    switch (value)
+    {
+	case DWRITE_PIXEL_GEOMETRY_FLAT:
+	    return 0;
+	case DWRITE_PIXEL_GEOMETRY_RGB:
+	    return 1;
+	case DWRITE_PIXEL_GEOMETRY_BGR:
+	    return 2;
+	default:
+	    return -1;
+    }
+}
+
+    static DWRITE_RENDERING_MODE
+ToRenderingMode(int value)
+{
+    switch (value)
+    {
+	default:
+	case 0:
+	    return DWRITE_RENDERING_MODE_DEFAULT;
+	case 1:
+	    return DWRITE_RENDERING_MODE_ALIASED;
+	case 2:
+	    return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC;
+	case 3:
+	    return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL;
+	case 4:
+	    return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL;
+	case 5:
+	    return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
+	case 6:
+	    return DWRITE_RENDERING_MODE_OUTLINE;
+    }
+}
+
+    static D2D1_TEXT_ANTIALIAS_MODE
+ToTextAntialiasMode(int value)
+{
+    switch (value)
+    {
+	default:
+	case 0:
+	    return D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
+	case 1:
+	    return D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE;
+	case 2:
+	    return D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE;
+	case 3:
+	    return D2D1_TEXT_ANTIALIAS_MODE_ALIASED;
+    }
+}
+
+    static int
+ToInt(DWRITE_RENDERING_MODE value)
+{
+    switch (value)
+    {
+	case DWRITE_RENDERING_MODE_DEFAULT:
+	    return 0;
+	case DWRITE_RENDERING_MODE_ALIASED:
+	    return 1;
+	case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC:
+	    return 2;
+	case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL:
+	    return 3;
+	case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL:
+	    return 4;
+	case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC:
+	    return 5;
+	case DWRITE_RENDERING_MODE_OUTLINE:
+	    return 6;
+	default:
+	    return -1;
+    }
+}
+
+class AdjustedGlyphRun : public DWRITE_GLYPH_RUN
+{
+private:
+    FLOAT mDelta;
+    FLOAT *mAdjustedAdvances;
+
+public:
+    AdjustedGlyphRun(
+	    const DWRITE_GLYPH_RUN *glyphRun,
+	    FLOAT cellWidth) :
+	DWRITE_GLYPH_RUN(*glyphRun),
+	mDelta(0.0f),
+	mAdjustedAdvances(new FLOAT[glyphRun->glyphCount])
+    {
+	assert(cellWidth != 0.0f);
+	for (UINT32 i = 0; i < glyphRun->glyphCount; ++i)
+	{
+	    FLOAT orig = glyphRun->glyphAdvances[i];
+	    FLOAT adjusted = adjustToCell(orig, cellWidth);
+	    mAdjustedAdvances[i] = adjusted;
+	    mDelta += adjusted - orig;
+	}
+	glyphAdvances = mAdjustedAdvances;
+    }
+
+    ~AdjustedGlyphRun(void)
+    {
+	delete[] mAdjustedAdvances;
+    }
+
+    FLOAT getDelta(void) const
+    {
+	return mDelta;
+    }
+
+    static FLOAT adjustToCell(FLOAT value, FLOAT cellWidth)
+    {
+	int cellCount = (int)floor(value / cellWidth + 0.5f);
+	if (cellCount < 1)
+	    cellCount = 1;
+	return cellCount * cellWidth;
+    }
+};
+
+class GdiTextRenderer : public IDWriteTextRenderer
+{
+public:
+    GdiTextRenderer(
+	    IDWriteBitmapRenderTarget* bitmapRenderTarget,
+	    IDWriteRenderingParams* renderingParams) :
+	cRefCount_(0),
+	pRenderTarget_(bitmapRenderTarget),
+	pRenderingParams_(renderingParams)
+    {
+	pRenderTarget_->AddRef();
+	pRenderingParams_->AddRef();
+	AddRef();
+    }
+
+    ~GdiTextRenderer()
+    {
+	SafeRelease(&pRenderTarget_);
+	SafeRelease(&pRenderingParams_);
+    }
+
+    IFACEMETHOD(IsPixelSnappingDisabled)(
+	__maybenull void* clientDrawingContext,
+	__out BOOL* isDisabled)
+    {
+	*isDisabled = FALSE;
+	return S_OK;
+    }
+
+    IFACEMETHOD(GetCurrentTransform)(
+	__maybenull void* clientDrawingContext,
+	__out DWRITE_MATRIX* transform)
+    {
+	//forward the render target's transform
+	pRenderTarget_->GetCurrentTransform(transform);
+	return S_OK;
+    }
+
+    IFACEMETHOD(GetPixelsPerDip)(
+	__maybenull void* clientDrawingContext,
+	__out FLOAT* pixelsPerDip)
+    {
+	*pixelsPerDip = pRenderTarget_->GetPixelsPerDip();
+	return S_OK;
+    }
+
+    IFACEMETHOD(DrawGlyphRun)(
+	__maybenull void* clientDrawingContext,
+	FLOAT baselineOriginX,
+	FLOAT baselineOriginY,
+	DWRITE_MEASURING_MODE measuringMode,
+	__in DWRITE_GLYPH_RUN const* glyphRun,
+	__in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
+	IUnknown* clientDrawingEffect)
+    {
+	HRESULT hr = S_OK;
+
+	GdiTextRendererContext *context =
+	    reinterpret_cast<GdiTextRendererContext*>(clientDrawingContext);
+
+	AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth);
+
+	// Pass on the drawing call to the render target to do the real work.
+	RECT dirtyRect = {0};
+
+	hr = pRenderTarget_->DrawGlyphRun(
+		baselineOriginX + context->offsetX,
+		baselineOriginY,
+		measuringMode,
+		&adjustedGlyphRun,
+		pRenderingParams_,
+		context->color,
+		&dirtyRect);
+
+	context->offsetX += adjustedGlyphRun.getDelta();
+
+	return hr;
+    }
+
+    IFACEMETHOD(DrawUnderline)(
+	__maybenull void* clientDrawingContext,
+	FLOAT baselineOriginX,
+	FLOAT baselineOriginY,
+	__in DWRITE_UNDERLINE const* underline,
+	IUnknown* clientDrawingEffect)
+    {
+	return E_NOTIMPL;
+    }
+
+    IFACEMETHOD(DrawStrikethrough)(
+	__maybenull void* clientDrawingContext,
+	FLOAT baselineOriginX,
+	FLOAT baselineOriginY,
+	__in DWRITE_STRIKETHROUGH const* strikethrough,
+	IUnknown* clientDrawingEffect)
+    {
+	return E_NOTIMPL;
+    }
+
+    IFACEMETHOD(DrawInlineObject)(
+	__maybenull void* clientDrawingContext,
+	FLOAT originX,
+	FLOAT originY,
+	IDWriteInlineObject* inlineObject,
+	BOOL isSideways,
+	BOOL isRightToLeft,
+	IUnknown* clientDrawingEffect)
+    {
+	return E_NOTIMPL;
+    }
+
+public:
+    IFACEMETHOD_(unsigned long, AddRef) ()
+    {
+	return InterlockedIncrement(&cRefCount_);
+    }
+
+    IFACEMETHOD_(unsigned long, Release) ()
+    {
+	long newCount = InterlockedDecrement(&cRefCount_);
+
+	if (newCount == 0)
+	{
+	    delete this;
+	    return 0;
+	}
+	return newCount;
+    }
+
+    IFACEMETHOD(QueryInterface)(
+	IID const& riid,
+	void** ppvObject)
+    {
+	if (__uuidof(IDWriteTextRenderer) == riid)
+	{
+	    *ppvObject = this;
+	}
+	else if (__uuidof(IDWritePixelSnapping) == riid)
+	{
+	    *ppvObject = this;
+	}
+	else if (__uuidof(IUnknown) == riid)
+	{
+	    *ppvObject = this;
+	}
+	else
+	{
+	    *ppvObject = NULL;
+	    return E_FAIL;
+	}
+
+	return S_OK;
+    }
+
+private:
+    unsigned long cRefCount_;
+    IDWriteBitmapRenderTarget* pRenderTarget_;
+    IDWriteRenderingParams* pRenderingParams_;
+};
+
+struct DWriteContext {
+    FLOAT mDpiScaleX;
+    FLOAT mDpiScaleY;
+    bool mDrawing;
+
+    ID2D1Factory *mD2D1Factory;
+
+    ID2D1DCRenderTarget *mRT;
+    ID2D1SolidColorBrush *mBrush;
+
+    IDWriteFactory *mDWriteFactory;
+    IDWriteGdiInterop *mGdiInterop;
+    IDWriteRenderingParams *mRenderingParams;
+    IDWriteTextFormat *mTextFormat;
+
+    HFONT mLastHFont;
+    DWRITE_FONT_WEIGHT mFontWeight;
+    DWRITE_FONT_STYLE mFontStyle;
+
+    D2D1_TEXT_ANTIALIAS_MODE mTextAntialiasMode;
+
+    // METHODS
+
+    DWriteContext();
+
+    virtual ~DWriteContext();
+
+    HRESULT SetLOGFONT(const LOGFONTW &logFont, float fontSize);
+
+    void SetFont(HFONT hFont);
+
+    void SetFont(const LOGFONTW &logFont);
+
+    void DrawText(HDC hdc, const WCHAR* text, int len,
+	int x, int y, int w, int h, int cellWidth, COLORREF color);
+
+    float PixelsToDipsX(int x);
+
+    float PixelsToDipsY(int y);
+
+    void SetRenderingParams(
+	    const DWriteRenderingParams *params);
+
+    DWriteRenderingParams *GetRenderingParams(
+	    DWriteRenderingParams *params);
+};
+
+DWriteContext::DWriteContext() :
+    mDpiScaleX(1.f),
+    mDpiScaleY(1.f),
+    mDrawing(false),
+    mD2D1Factory(NULL),
+    mRT(NULL),
+    mBrush(NULL),
+    mDWriteFactory(NULL),
+    mGdiInterop(NULL),
+    mRenderingParams(NULL),
+    mTextFormat(NULL),
+    mLastHFont(NULL),
+    mFontWeight(DWRITE_FONT_WEIGHT_NORMAL),
+    mFontStyle(DWRITE_FONT_STYLE_NORMAL),
+    mTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_DEFAULT)
+{
+    HRESULT hr;
+
+    HDC screen = ::GetDC(0);
+    mDpiScaleX = ::GetDeviceCaps(screen, LOGPIXELSX) / 96.0f;
+    mDpiScaleY = ::GetDeviceCaps(screen, LOGPIXELSY) / 96.0f;
+    ::ReleaseDC(0, screen);
+
+    hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,
+	    __uuidof(ID2D1Factory), NULL,
+	    reinterpret_cast<void**>(&mD2D1Factory));
+    _RPT2(_CRT_WARN, "D2D1CreateFactory: hr=%p p=%p\n", hr, mD2D1Factory);
+
+    if (SUCCEEDED(hr))
+    {
+	D2D1_RENDER_TARGET_PROPERTIES props = {
+	    D2D1_RENDER_TARGET_TYPE_DEFAULT,
+	    { DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE },
+	    0, 0,
+	    D2D1_RENDER_TARGET_USAGE_NONE,
+	    D2D1_FEATURE_LEVEL_DEFAULT
+	};
+	hr = mD2D1Factory->CreateDCRenderTarget(&props, &mRT);
+	_RPT2(_CRT_WARN, "CreateDCRenderTarget: hr=%p p=%p\n", hr, mRT);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	hr = mRT->CreateSolidColorBrush(
+		D2D1::ColorF(D2D1::ColorF::Black),
+		&mBrush);
+	_RPT2(_CRT_WARN, "CreateSolidColorBrush: hr=%p p=%p\n", hr, mBrush);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	hr = DWriteCreateFactory(
+		DWRITE_FACTORY_TYPE_SHARED,
+		__uuidof(IDWriteFactory),
+		reinterpret_cast<IUnknown**>(&mDWriteFactory));
+	_RPT2(_CRT_WARN, "DWriteCreateFactory: hr=%p p=%p\n", hr,
+		mDWriteFactory);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	hr = mDWriteFactory->GetGdiInterop(&mGdiInterop);
+	_RPT2(_CRT_WARN, "GetGdiInterop: hr=%p p=%p\n", hr, mGdiInterop);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	hr = mDWriteFactory->CreateRenderingParams(&mRenderingParams);
+	_RPT2(_CRT_WARN, "CreateRenderingParams: hr=%p p=%p\n", hr,
+		mRenderingParams);
+    }
+}
+
+DWriteContext::~DWriteContext()
+{
+    SafeRelease(&mTextFormat);
+    SafeRelease(&mRenderingParams);
+    SafeRelease(&mGdiInterop);
+    SafeRelease(&mDWriteFactory);
+    SafeRelease(&mBrush);
+    SafeRelease(&mRT);
+    SafeRelease(&mD2D1Factory);
+}
+
+    HRESULT
+DWriteContext::SetLOGFONT(const LOGFONTW &logFont, float fontSize)
+{
+    // Most of this function is copy from: http://msdn.microsoft.com/en-us/library/windows/desktop/dd941783(v=vs.85).aspx
+    HRESULT hr = S_OK;
+
+    IDWriteFont *font = NULL;
+    IDWriteFontFamily *fontFamily = NULL;
+    IDWriteLocalizedStrings *localizedFamilyNames = NULL;
+
+    if (SUCCEEDED(hr))
+    {
+	hr = mGdiInterop->CreateFontFromLOGFONT(&logFont, &font);
+    }
+
+    // Get the font family to which this font belongs.
+    if (SUCCEEDED(hr))
+    {
+	hr = font->GetFontFamily(&fontFamily);
+    }
+
+    // Get the family names. This returns an object that encapsulates one or
+    // more names with the same meaning but in different languages.
+    if (SUCCEEDED(hr))
+    {
+	hr = fontFamily->GetFamilyNames(&localizedFamilyNames);
+    }
+
+    // Get the family name at index zero. If we were going to display the name
+    // we'd want to try to find one that matched the use locale, but for
+    // purposes of creating a text format object any language will do.
+
+    wchar_t familyName[100];
+    if (SUCCEEDED(hr))
+    {
+	hr = localizedFamilyNames->GetString(0, familyName,
+		ARRAYSIZE(familyName));
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	// If no font size was passed in use the lfHeight of the LOGFONT.
+	if (fontSize == 0)
+	{
+	    // Convert from pixels to DIPs.
+	    fontSize = PixelsToDipsY(logFont.lfHeight);
+	    if (fontSize < 0)
+	    {
+		// Negative lfHeight represents the size of the em unit.
+		fontSize = -fontSize;
+	    }
+	    else
+	    {
+		// Positive lfHeight represents the cell height (ascent +
+		// descent).
+		DWRITE_FONT_METRICS fontMetrics;
+		font->GetMetrics(&fontMetrics);
+
+		// Convert the cell height (ascent + descent) from design units
+		// to ems.
+		float cellHeight = static_cast<float>(
+			fontMetrics.ascent + fontMetrics.descent)
+					       / fontMetrics.designUnitsPerEm;
+
+		// Divide the font size by the cell height to get the font em
+		// size.
+		fontSize /= cellHeight;
+	    }
+	}
+    }
+
+    // The text format includes a locale name. Ideally, this would be the
+    // language of the text, which may or may not be the same as the primary
+    // language of the user. However, for our purposes the user locale will do.
+    wchar_t localeName[LOCALE_NAME_MAX_LENGTH];
+    if (SUCCEEDED(hr))
+    {
+	if (GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH) == 0)
+	    hr = HRESULT_FROM_WIN32(GetLastError());
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	// Create the text format object.
+	hr = mDWriteFactory->CreateTextFormat(
+		familyName,
+		NULL, // no custom font collection
+		font->GetWeight(),
+		font->GetStyle(),
+		font->GetStretch(),
+		fontSize,
+		localeName,
+		&mTextFormat);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+	mFontWeight = static_cast<DWRITE_FONT_WEIGHT>(logFont.lfWeight);
+	mFontStyle = logFont.lfItalic ? DWRITE_FONT_STYLE_ITALIC
+	    : DWRITE_FONT_STYLE_NORMAL;
+    }
+
+    SafeRelease(&localizedFamilyNames);
+    SafeRelease(&fontFamily);
+    SafeRelease(&font);
+
+    return hr;
+}
+
+    void
+DWriteContext::SetFont(HFONT hFont)
+{
+    if (mLastHFont != hFont)
+    {
+	LOGFONTW lf;
+	if (GetObjectW(hFont, sizeof(lf), &lf))
+	{
+	    SetFont(lf);
+	    mLastHFont = hFont;
+	}
+    }
+}
+
+    void
+DWriteContext::SetFont(const LOGFONTW &logFont)
+{
+    SafeRelease(&mTextFormat);
+    mLastHFont = NULL;
+
+    HRESULT hr = SetLOGFONT(logFont, 0.f);
+
+    if (SUCCEEDED(hr))
+	hr = mTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
+
+    if (SUCCEEDED(hr))
+	hr = mTextFormat->SetParagraphAlignment(
+		DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+
+    if (SUCCEEDED(hr))
+	hr = mTextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+}
+
+    void
+DWriteContext::DrawText(HDC hdc, const WCHAR* text, int len,
+	int x, int y, int w, int h, int cellWidth, COLORREF color)
+{
+    HRESULT hr = S_OK;
+    IDWriteBitmapRenderTarget *bmpRT = NULL;
+
+    // Skip when any fonts are not set.
+    if (mTextFormat == NULL)
+	return;
+
+    // Check possibility of zero divided error.
+    if (cellWidth == 0 || mDpiScaleX == 0.0f || mDpiScaleY == 0.0f)
+	return;
+
+    if (SUCCEEDED(hr))
+	hr = mGdiInterop->CreateBitmapRenderTarget(hdc, w, h, &bmpRT);
+
+    if (SUCCEEDED(hr))
+    {
+	IDWriteTextLayout *textLayout = NULL;
+
+	HDC memdc = bmpRT->GetMemoryDC();
+	BitBlt(memdc, 0, 0, w, h, hdc, x, y, SRCCOPY);
+
+	hr = mDWriteFactory->CreateGdiCompatibleTextLayout(
+		text, len, mTextFormat, PixelsToDipsX(w),
+		PixelsToDipsY(h), mDpiScaleX, NULL, TRUE, &textLayout);
+
+	if (SUCCEEDED(hr))
+	{
+	    DWRITE_TEXT_RANGE textRange = { 0, len };
+	    textLayout->SetFontWeight(mFontWeight, textRange);
+	    textLayout->SetFontStyle(mFontStyle, textRange);
+	}
+
+	if (SUCCEEDED(hr))
+	{
+	    GdiTextRenderer *renderer = new GdiTextRenderer(bmpRT,
+		    mRenderingParams);
+	    GdiTextRendererContext data = {
+		color,
+		PixelsToDipsX(cellWidth),
+		0.0f
+	    };
+	    textLayout->Draw(&data, renderer, 0, 0);
+	    SafeRelease(&renderer);
+	}
+
+	BitBlt(hdc, x, y, w, h, memdc, 0, 0, SRCCOPY);
+
+	SafeRelease(&textLayout);
+    }
+
+    SafeRelease(&bmpRT);
+}
+
+    float
+DWriteContext::PixelsToDipsX(int x)
+{
+    return x / mDpiScaleX;
+}
+
+    float
+DWriteContext::PixelsToDipsY(int y)
+{
+    return y / mDpiScaleY;
+}
+
+    void
+DWriteContext::SetRenderingParams(
+	const DWriteRenderingParams *params)
+{
+    if (mDWriteFactory == NULL)
+	return;
+
+    IDWriteRenderingParams *renderingParams = NULL;
+    D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode =
+	D2D1_TEXT_ANTIALIAS_MODE_DEFAULT;
+    HRESULT hr;
+    if (params != NULL)
+    {
+	hr = mDWriteFactory->CreateCustomRenderingParams(params->gamma,
+		params->enhancedContrast, params->clearTypeLevel,
+		ToPixelGeometry(params->pixelGeometry),
+		ToRenderingMode(params->renderingMode), &renderingParams);
+	textAntialiasMode = ToTextAntialiasMode(params->textAntialiasMode);
+    }
+    else
+	hr = mDWriteFactory->CreateRenderingParams(&renderingParams);
+    if (SUCCEEDED(hr) && renderingParams != NULL)
+    {
+	SafeRelease(&mRenderingParams);
+	mRenderingParams = renderingParams;
+	mTextAntialiasMode = textAntialiasMode;
+    }
+}
+
+    DWriteRenderingParams *
+DWriteContext::GetRenderingParams(
+	DWriteRenderingParams *params)
+{
+    if (params != NULL && mRenderingParams != NULL)
+    {
+	params->gamma = mRenderingParams->GetGamma();
+	params->enhancedContrast = mRenderingParams->GetEnhancedContrast();
+	params->clearTypeLevel = mRenderingParams->GetClearTypeLevel();
+	params->pixelGeometry = ToInt(mRenderingParams->GetPixelGeometry());
+	params->renderingMode = ToInt(mRenderingParams->GetRenderingMode());
+	params->textAntialiasMode = mTextAntialiasMode;
+    }
+    return params;
+}
+
+////////////////////////////////////////////////////////////////////////////
+// PUBLIC C INTERFACES
+
+    void
+DWrite_Init(void)
+{
+#ifdef DYNAMIC_DIRECTX
+    // Load libraries.
+    hD2D1DLL = vimLoadLib(const_cast<char*>("d2d1.dll"));
+    hDWriteDLL = vimLoadLib(const_cast<char*>("dwrite.dll"));
+    if (hD2D1DLL == NULL || hDWriteDLL == NULL)
+    {
+	DWrite_Final();
+	return;
+    }
+    // Get address of procedures.
+    pGetUserDefaultLocaleName = (PGETUSERDEFAULTLOCALENAME)GetProcAddress(
+	    GetModuleHandle("kernel32.dll"), "GetUserDefaultLocaleName");
+    pD2D1CreateFactory = (PD2D1CREATEFACTORY)GetProcAddress(hD2D1DLL,
+	    "D2D1CreateFactory");
+    pDWriteCreateFactory = (PDWRITECREATEFACTORY)GetProcAddress(hDWriteDLL,
+	    "DWriteCreateFactory");
+#endif
+}
+
+    void
+DWrite_Final(void)
+{
+#ifdef DYNAMIC_DIRECTX
+    pGetUserDefaultLocaleName = NULL;
+    pD2D1CreateFactory = NULL;
+    pDWriteCreateFactory = NULL;
+    unload(hDWriteDLL);
+    unload(hD2D1DLL);
+#endif
+}
+
+    DWriteContext *
+DWriteContext_Open(void)
+{
+#ifdef DYNAMIC_DIRECTX
+    if (pGetUserDefaultLocaleName == NULL || pD2D1CreateFactory == NULL
+	    || pDWriteCreateFactory == NULL)
+	return NULL;
+#endif
+    return new DWriteContext();
+}
+
+    void
+DWriteContext_BeginDraw(DWriteContext *ctx)
+{
+    if (ctx != NULL && ctx->mRT != NULL)
+    {
+	ctx->mRT->BeginDraw();
+	ctx->mRT->SetTransform(D2D1::IdentityMatrix());
+	ctx->mDrawing = true;
+    }
+}
+
+    void
+DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect)
+{
+    if (ctx != NULL && ctx->mRT != NULL)
+    {
+	ctx->mRT->BindDC(hdc, rect);
+	ctx->mRT->SetTextAntialiasMode(ctx->mTextAntialiasMode);
+    }
+}
+
+    void
+DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont)
+{
+    if (ctx != NULL)
+    {
+	ctx->SetFont(hFont);
+    }
+}
+
+    void
+DWriteContext_DrawText(
+	DWriteContext *ctx,
+	HDC hdc,
+	const WCHAR* text,
+	int len,
+	int x,
+	int y,
+	int w,
+	int h,
+	int cellWidth,
+	COLORREF color)
+{
+    if (ctx != NULL)
+	ctx->DrawText(hdc, text, len, x, y, w, h, cellWidth, color);
+}
+
+    void
+DWriteContext_EndDraw(DWriteContext *ctx)
+{
+    if (ctx != NULL && ctx->mRT != NULL)
+    {
+	ctx->mRT->EndDraw();
+	ctx->mDrawing = false;
+    }
+}
+
+    void
+DWriteContext_Close(DWriteContext *ctx)
+{
+    delete ctx;
+}
+
+    void
+DWriteContext_SetRenderingParams(
+	DWriteContext *ctx,
+	const DWriteRenderingParams *params)
+{
+    if (ctx != NULL)
+	ctx->SetRenderingParams(params);
+}
+
+    DWriteRenderingParams *
+DWriteContext_GetRenderingParams(
+	DWriteContext *ctx,
+	DWriteRenderingParams *params)
+{
+    if (ctx != NULL)
+	return ctx->GetRenderingParams(params);
+    else
+	return NULL;
+}
diff --git a/src/gui_dwrite.h b/src/gui_dwrite.h
new file mode 100644
index 0000000000..647f479a6b
--- /dev/null
+++ b/src/gui_dwrite.h
@@ -0,0 +1,85 @@
+/* vi:set ts=8 sts=4 sw=4 noet: */
+/*
+ * Author: MURAOKA Taro <koron.kaoriya@gmail.com>
+ *
+ * Contributors:
+ *  - Ken Takata
+ *
+ * Copyright (C) 2013 MURAOKA Taro <koron.kaoriya@gmail.com>
+ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
+ */
+
+#ifndef GUI_DWRITE_H
+#define GUI_DWRITE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct DWriteContext DWriteContext;
+
+typedef struct DWriteRenderingParams {
+    float gamma;
+    float enhancedContrast;
+    float clearTypeLevel;
+    /*
+     * pixelGeometry:
+     *	0 - DWRITE_PIXEL_GEOMETRY_FLAT
+     *	1 - DWRITE_PIXEL_GEOMETRY_RGB
+     *	2 - DWRITE_PIXEL_GEOMETRY_BGR
+     */
+    int pixelGeometry;
+    /*
+     * renderingMode:
+     *	0 - DWRITE_RENDERING_MODE_DEFAULT
+     *	1 - DWRITE_RENDERING_MODE_ALIASED
+     *	2 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC
+     *	3 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL
+     *	4 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL
+     *	5 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC
+     *	6 - DWRITE_RENDERING_MODE_OUTLINE
+     */
+    int renderingMode;
+    /*
+     * antialiasMode:
+     *	0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
+     *	1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
+     *	2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
+     *	3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED
+     */
+    int textAntialiasMode;
+} DWriteRenderingParams;
+
+void DWrite_Init(void);
+void DWrite_Final(void);
+
+DWriteContext *DWriteContext_Open(void);
+void DWriteContext_BeginDraw(DWriteContext *ctx);
+void DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect);
+void DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont);
+void DWriteContext_DrawText(
+	DWriteContext *ctx,
+	HDC hdc,
+	const WCHAR* text,
+	int len,
+	int x,
+	int y,
+	int w,
+	int h,
+	int cellWidth,
+	COLORREF color);
+void DWriteContext_EndDraw(DWriteContext *ctx);
+void DWriteContext_Close(DWriteContext *ctx);
+
+void DWriteContext_SetRenderingParams(
+	DWriteContext *ctx,
+	const DWriteRenderingParams *params);
+
+DWriteRenderingParams *DWriteContext_GetRenderingParams(
+	DWriteContext *ctx,
+	DWriteRenderingParams *params);
+
+#ifdef __cplusplus
+}
+#endif
+#endif/*GUI_DWRITE_H*/
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 2d57fbb272..b42817271c 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -25,6 +25,145 @@
 
 #include "vim.h"
 
+#if defined(FEAT_DIRECTX)
+# include "gui_dwrite.h"
+#endif
+
+#if defined(FEAT_DIRECTX) || defined(PROTO)
+static DWriteContext *s_dwc = NULL;
+static int s_directx_enabled = 0;
+static int s_directx_load_attempted = 0;
+# define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL)
+
+    int
+directx_enabled(void)
+{
+    if (s_dwc != NULL)
+	return 1;
+    else if (s_directx_load_attempted)
+	return 0;
+    /* load DirectX */
+    DWrite_Init();
+    s_directx_load_attempted = 1;
+    s_dwc = DWriteContext_Open();
+    return s_dwc != NULL ? 1 : 0;
+}
+#endif
+
+#if defined(FEAT_RENDER_OPTIONS) || defined(PROTO)
+    int
+gui_mch_set_rendering_options(char_u *s)
+{
+#ifdef FEAT_DIRECTX
+    int	    retval = FAIL;
+    char_u  *p, *q;
+
+    int	    dx_enable = 0;
+    int	    dx_flags = 0;
+    float   dx_gamma = 0.0f;
+    float   dx_contrast = 0.0f;
+    float   dx_level = 0.0f;
+    int	    dx_geom = 0;
+    int	    dx_renmode = 0;
+    int	    dx_taamode = 0;
+
+    /* parse string as rendering options. */
+    for (p = s; p != NULL && *p != NUL; )
+    {
+	char_u  item[256];
+	char_u  name[128];
+	char_u  value[128];
+
+	copy_option_part(&p, item, sizeof(item), ","); 
+	if (p == NULL)
+	    break;
+	q = &item[0];
+	copy_option_part(&q, name, sizeof(name), ":");
+	if (q == NULL)
+	    return FAIL;
+	copy_option_part(&q, value, sizeof(value), ":");
+
+	if (STRCMP(name, "type") == 0)
+	{
+	    if (STRCMP(value, "directx") == 0)
+		dx_enable = 1;
+	    else
+		return FAIL;
+	}
+	else if (STRCMP(name, "gamma") == 0)
+	{
+	    dx_flags |= 1 << 0;
+	    dx_gamma = (float)atof(value);
+	}
+	else if (STRCMP(name, "contrast") == 0)
+	{
+	    dx_flags |= 1 << 1;
+	    dx_contrast = (float)atof(value);
+	}
+	else if (STRCMP(name, "level") == 0)
+	{
+	    dx_flags |= 1 << 2;
+	    dx_level = (float)atof(value);
+	}
+	else if (STRCMP(name, "geom") == 0)
+	{
+	    dx_flags |= 1 << 3;
+	    dx_geom = atoi(value);
+	    if (dx_geom < 0 || dx_geom > 2)
+		return FAIL;
+	}
+	else if (STRCMP(name, "renmode") == 0)
+	{
+	    dx_flags |= 1 << 4;
+	    dx_renmode = atoi(value);
+	    if (dx_renmode < 0 || dx_renmode > 6)
+		return FAIL;
+	}
+	else if (STRCMP(name, "taamode") == 0)
+	{
+	    dx_flags |= 1 << 5;
+	    dx_taamode = atoi(value);
+	    if (dx_taamode < 0 || dx_taamode > 3)
+		return FAIL;
+	}
+	else
+	    return FAIL;
+    }
+
+    /* Enable DirectX/DirectWrite */
+    if (dx_enable)
+    {
+	if (!directx_enabled())
+	    return FAIL;
+	DWriteContext_SetRenderingParams(s_dwc, NULL);
+	if (dx_flags)
+	{
+	    DWriteRenderingParams param;
+	    DWriteContext_GetRenderingParams(s_dwc, &param);
+	    if (dx_flags & (1 << 0))
+		param.gamma = dx_gamma;
+	    if (dx_flags & (1 << 1))
+		param.enhancedContrast = dx_contrast;
+	    if (dx_flags & (1 << 2))
+		param.clearTypeLevel = dx_level;
+	    if (dx_flags & (1 << 3))
+		param.pixelGeometry = dx_geom;
+	    if (dx_flags & (1 << 4))
+		param.renderingMode = dx_renmode;
+	    if (dx_flags & (1 << 5))
+		param.textAntialiasMode = dx_taamode;
+	    DWriteContext_SetRenderingParams(s_dwc, &param);
+	}
+    }
+    s_directx_enabled = dx_enable;
+
+    return OK;
+#else
+    return FAIL;
+#endif
+}
+#endif
+
 /*
  * These are new in Windows ME/XP, only defined in recent compilers.
  */
@@ -1624,6 +1763,11 @@ gui_mch_init(void)
     set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
 #endif
 
+#ifdef FEAT_RENDER_OPTIONS
+    if (p_rop)
+	(void)gui_mch_set_rendering_options(p_rop);
+#endif
+
 theend:
     /* Display any pending error messages */
     display_errors();
@@ -1695,9 +1839,9 @@ gui_mch_set_shellsize(int width, int height,
 
     /* compute the size of the outside of the window */
     win_width = width + (GetSystemMetrics(SM_CXFRAME) +
-                         GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+			 GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
     win_height = height + (GetSystemMetrics(SM_CYFRAME) +
-                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+			   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
 			+ GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
 			+ gui_mswin_get_menu_height(FALSE)
@@ -2239,6 +2383,9 @@ gui_mch_draw_string(
 #endif
     HPEN	hpen, old_pen;
     int		y;
+#ifdef FEAT_DIRECTX
+    int		font_is_ttf_or_vector = 0;
+#endif
 
 #ifndef MSWIN16_FASTTEXT
     /*
@@ -2326,6 +2473,20 @@ gui_mch_draw_string(
     SetTextColor(s_hdc, gui.currFgColor);
     SelectFont(s_hdc, gui.currFont);
 
+#ifdef FEAT_DIRECTX
+    if (IS_ENABLE_DIRECTX())
+    {
+	TEXTMETRIC tm;
+
+	GetTextMetrics(s_hdc, &tm);
+	if (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR))
+	{
+	    font_is_ttf_or_vector = 1;
+	    DWriteContext_SetFont(s_dwc, (HFONT)gui.currFont);
+	}
+    }
+#endif
+
     if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width)
     {
 	vim_free(padding);
@@ -2360,6 +2521,14 @@ gui_mch_draw_string(
 	    if (text[n] >= 0x80)
 		break;
 
+#if defined(FEAT_DIRECTX)
+    /* Quick hack to enable DirectWrite.  To use DirectWrite (antialias), it is
+     * required that unicode drawing routine, currently.  So this forces it
+     * enabled. */
+    if (enc_utf8 && IS_ENABLE_DIRECTX())
+	n = 0; /* Keep n < len, to enter block for unicode. */
+#endif
+
     /* Check if the Unicode buffer exists and is big enough.  Create it
      * with the same length as the multi-byte string, the number of wide
      * characters is always equal or smaller. */
@@ -2418,8 +2587,17 @@ gui_mch_draw_string(
 	    i += utfc_ptr2len_len(text + i, len - i);
 	    ++clen;
 	}
-	ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
-			   foptions, pcliprect, unicodebuf, wlen, unicodepdy);
+#if defined(FEAT_DIRECTX)
+	if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector)
+	{
+	    DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen,
+		    TEXT_X(col), TEXT_Y(row), FILL_X(cells), FILL_Y(1),
+		    gui.char_width, gui.currFgColor);
+	}
+	else
+#endif
+	    ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
+		    foptions, pcliprect, unicodebuf, wlen, unicodepdy);
 	len = cells;	/* used for underlining */
     }
     else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9)
@@ -2549,14 +2727,14 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
 
     *screen_w = workarea_rect.right - workarea_rect.left
 		- (GetSystemMetrics(SM_CXFRAME) +
-                   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+		   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
 
     /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
      * the menubar for MSwin, we subtract it from the screen height, so that
      * the window size can be made to fit on the screen. */
     *screen_h = workarea_rect.bottom - workarea_rect.top
 		- (GetSystemMetrics(SM_CYFRAME) +
-                   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+		   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
 		- GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
 		- gui_mswin_get_menu_height(FALSE)
@@ -3188,13 +3366,13 @@ gui_mch_dialog(
 	GetWindowRect(s_hwnd, &rect);
 	maxDialogWidth = rect.right - rect.left
 				   - (GetSystemMetrics(SM_CXFRAME) +
-                                      GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+				      GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
 	if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
 	    maxDialogWidth = DLG_MIN_MAX_WIDTH;
 
 	maxDialogHeight = rect.bottom - rect.top
 				   - (GetSystemMetrics(SM_CYFRAME) +
-                                      GetSystemMetrics(SM_CXPADDEDBORDER)) * 4
+				      GetSystemMetrics(SM_CXPADDEDBORDER)) * 4
 				   - GetSystemMetrics(SM_CYCAPTION);
 	if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
 	    maxDialogHeight = DLG_MIN_MAX_HEIGHT;
@@ -3351,11 +3529,11 @@ gui_mch_dialog(
     /* Restrict the size to a maximum.  Causes a scrollbar to show up. */
     if (dlgheight > maxDialogHeight)
     {
-        msgheight = msgheight - (dlgheight - maxDialogHeight);
-        dlgheight = maxDialogHeight;
-        scroll_flag = WS_VSCROLL;
-        /* Make sure scrollbar doesn't appear in the middle of the dialog */
-        messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX;
+	msgheight = msgheight - (dlgheight - maxDialogHeight);
+	dlgheight = maxDialogHeight;
+	scroll_flag = WS_VSCROLL;
+	/* Make sure scrollbar doesn't appear in the middle of the dialog */
+	messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX;
     }
 
     add_word(PixelToDialogY(dlgheight));
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 89b60908e5..ae4c921c0d 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -2785,6 +2785,10 @@ _OnPaint(
 
 	out_flush();	    /* make sure all output has been processed */
 	(void)BeginPaint(hwnd, &ps);
+#if defined(FEAT_DIRECTX)
+	if (IS_ENABLE_DIRECTX())
+	    DWriteContext_BeginDraw(s_dwc);
+#endif
 
 #ifdef FEAT_MBYTE
 	/* prevent multi-byte characters from misprinting on an invalid
@@ -2800,9 +2804,20 @@ _OnPaint(
 #endif
 
 	if (!IsRectEmpty(&ps.rcPaint))
+	{
+#if defined(FEAT_DIRECTX)
+	    if (IS_ENABLE_DIRECTX())
+		DWriteContext_BindDC(s_dwc, s_hdc, &ps.rcPaint);
+#endif
 	    gui_redraw(ps.rcPaint.left, ps.rcPaint.top,
 		    ps.rcPaint.right - ps.rcPaint.left + 1,
 		    ps.rcPaint.bottom - ps.rcPaint.top + 1);
+	}
+
+#if defined(FEAT_DIRECTX)
+	if (IS_ENABLE_DIRECTX())
+	    DWriteContext_EndDraw(s_dwc);
+#endif
 	EndPaint(hwnd, &ps);
     }
 }
@@ -3043,6 +3058,12 @@ gui_mch_insert_lines(
     void
 gui_mch_exit(int rc)
 {
+#if defined(FEAT_DIRECTX)
+    DWriteContext_Close(s_dwc);
+    DWrite_Final();
+    s_dwc = NULL;
+#endif
+
     ReleaseDC(s_textArea, s_hdc);
     DeleteObject(s_brush);
 
diff --git a/src/option.c b/src/option.c
index 05d8869eaa..3e6164e5a6 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2124,6 +2124,15 @@ static struct vimoption
     {"remap",	    NULL,   P_BOOL|P_VI_DEF,
 			    (char_u *)&p_remap, PV_NONE,
 			    {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT},
+    {"renderoptions", "rop", P_STRING|P_COMMA|P_RCLR|P_VI_DEF,
+#ifdef FEAT_RENDER_OPTIONS
+			    (char_u *)&p_rop, PV_NONE,
+			    {(char_u *)"", (char_u *)0L}
+#else
+			    (char_u *)NULL, PV_NONE,
+			    {(char_u *)NULL, (char_u *)0L}
+#endif
+			    SCRIPTID_INIT},
     {"report",	    NULL,   P_NUM|P_VI_DEF,
 			    (char_u *)&p_report, PV_NONE,
 			    {(char_u *)2L, (char_u *)0L} SCRIPTID_INIT},
@@ -6999,6 +7008,14 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
     }
 #endif
 
+#if defined(FEAT_RENDER_OPTIONS)
+    else if (varp == &p_rop && gui.in_use)
+    {
+	if (!gui_mch_set_rendering_options(p_rop))
+	    errmsg = e_invarg;
+    }
+#endif
+
     /* Options that are a list of flags. */
     else
     {
diff --git a/src/option.h b/src/option.h
index edf9058440..696d70d6a2 100644
--- a/src/option.h
+++ b/src/option.h
@@ -655,6 +655,9 @@ EXTERN long	p_rdt;		/* 'redrawtime' */
 #endif
 EXTERN int	p_remap;	/* 'remap' */
 EXTERN long	p_re;		/* 'regexpengine' */
+#ifdef FEAT_RENDER_OPTIONS
+EXTERN char_u	*p_rop;		/* 'renderoptions' */
+#endif
 EXTERN long	p_report;	/* 'report' */
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
 EXTERN long	p_pvh;		/* 'previewheight' */
diff --git a/src/proto/gui_w32.pro b/src/proto/gui_w32.pro
index a333233d78..88fbf67c62 100644
--- a/src/proto/gui_w32.pro
+++ b/src/proto/gui_w32.pro
@@ -1,4 +1,6 @@
 /* gui_w32.c */
+int directx_enabled __ARGS((void));
+int gui_mch_set_rendering_options __ARGS((char_u *s));
 void gui_mch_set_blinking __ARGS((long wait, long on, long off));
 void gui_mch_stop_blink __ARGS((void));
 void gui_mch_start_blink __ARGS((void));
diff --git a/src/version.c b/src/version.c
index 6610ba110e..fd9e275faa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -189,6 +189,13 @@ static char *(features[]) =
 #else
 	"-digraphs",
 #endif
+#ifdef FEAT_GUI_W32
+# ifdef FEAT_DIRECTX
+	"+directx",
+# else
+	"-directx",
+# endif
+#endif
 #ifdef FEAT_DND
 	"+dnd",
 #else
@@ -734,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    393,
 /**/
     392,
 /**/
diff --git a/src/vim.h b/src/vim.h
index 84e139c75a..887a76d1f4 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -134,6 +134,13 @@
 # endif
 #endif
 
+/* Check support for rendering options */
+#ifdef FEAT_GUI
+# if defined(FEAT_DIRECTX)
+#  define FEAT_RENDER_OPTIONS
+# endif
+#endif
+
 /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
 #if _MSC_VER >= 1400
 # define _CRT_SECURE_NO_DEPRECATE

From aa43b4ddf89a9fd979d60543eba595049531e2f4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 14:52:30 +0200
Subject: [PATCH 020/473] Added tag v7-4-393 for changeset 1bff71d20262

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 4326008a12..3d72b4c98f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3115,3 +3115,4 @@ dbd7dc1ea2e6bd0fc3c9ec7faec76382412d0129 v7-4-382
 d3a674f6c7370f70d6b66dcefb9e36d22d73c7b7 v7-4-390
 f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
 589fd07888abc8a1208616c56b21898d3352fc5b v7-4-392
+1bff71d202621d97acc4ef21ce9f47b78f68bda3 v7-4-393

From d176f0721ae6d14d86a5f4e10a24cc5bd4f13a17 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 16:49:55 +0200
Subject: [PATCH 021/473] updated for version 7.4.394 Problem:    When using
 DirectX last italic character is incomplete. Solution:   Add one to the
 number of cells. (Ken Takata)

---
 src/gui_w32.c | 3 ++-
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gui_w32.c b/src/gui_w32.c
index b42817271c..0368dda439 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -2590,8 +2590,9 @@ gui_mch_draw_string(
 #if defined(FEAT_DIRECTX)
 	if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector)
 	{
+	    /* Add one to "cells" for italics. */
 	    DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen,
-		    TEXT_X(col), TEXT_Y(row), FILL_X(cells), FILL_Y(1),
+		    TEXT_X(col), TEXT_Y(row), FILL_X(cells + 1), FILL_Y(1),
 		    gui.char_width, gui.currFgColor);
 	}
 	else
diff --git a/src/version.c b/src/version.c
index fd9e275faa..082c5fc446 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    394,
 /**/
     393,
 /**/

From 9996fecc2ba77104749e7b8cbe9d299d1f003d34 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 16:49:56 +0200
Subject: [PATCH 022/473] Added tag v7-4-394 for changeset d594c1552137

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3d72b4c98f..429902a8b4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3116,3 +3116,4 @@ d3a674f6c7370f70d6b66dcefb9e36d22d73c7b7 v7-4-390
 f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
 589fd07888abc8a1208616c56b21898d3352fc5b v7-4-392
 1bff71d202621d97acc4ef21ce9f47b78f68bda3 v7-4-393
+d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394

From 3687d9c432b3da02c7a98b3f2e902f673f8bfd9b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 17:44:14 +0200
Subject: [PATCH 023/473] updated for version 7.4.395 Problem:    C indent is
 wrong below an if with wrapped condition followed by 	    curly braces.
 (Trevor Powell) Solution:   Make a copy of tryposBrace.

---
 src/misc1.c          | 5 +++++
 src/testdir/test3.in | 8 ++++++++
 src/testdir/test3.ok | 8 ++++++++
 src/version.c        | 2 ++
 4 files changed, 23 insertions(+)

diff --git a/src/misc1.c b/src/misc1.c
index 2c28aae84c..6ae72cfbba 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -6995,6 +6995,7 @@ get_c_indent()
     char_u	*linecopy;
     pos_T	*trypos;
     pos_T	*tryposBrace = NULL;
+    pos_T	tryposBraceCopy;
     pos_T	our_paren_pos;
     char_u	*start;
     int		start_brace;
@@ -7532,7 +7533,11 @@ get_c_indent()
 	/*
 	 * We are inside braces, there is a { before this line at the position
 	 * stored in tryposBrace.
+	 * Make a copy of tryposBrace, it may point to pos_copy inside
+	 * find_start_brace(), which may be changed somewhere.
 	 */
+	tryposBraceCopy = *tryposBrace;
+	tryposBrace = &tryposBraceCopy;
 	trypos = tryposBrace;
 	ourscope = trypos->lnum;
 	start = ml_get(ourscope);
diff --git a/src/testdir/test3.in b/src/testdir/test3.in
index de86700380..7757569e37 100644
--- a/src/testdir/test3.in
+++ b/src/testdir/test3.in
@@ -464,6 +464,14 @@ label:  if (asdf &&
 	asdfasdf
 }
 
+{
+for ( int i = 0;
+	i < 10; i++ )
+{
+}
+	i = 0;
+}
+
 class bob
 {
 	int foo() {return 1;}
diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok
index 0d0e76fce4..e75de0ffa3 100644
--- a/src/testdir/test3.ok
+++ b/src/testdir/test3.ok
@@ -452,6 +452,14 @@ label:  if (asdf &&
 	asdfasdf
 }
 
+{
+	for ( int i = 0;
+			i < 10; i++ )
+	{
+	}
+	i = 0;
+}
+
 class bob
 {
 	int foo() {return 1;}
diff --git a/src/version.c b/src/version.c
index 082c5fc446..aa64155908 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    395,
 /**/
     394,
 /**/

From 090b3688fc3f7be514121aa511a155e80d0980e3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 17:44:14 +0200
Subject: [PATCH 024/473] Added tag v7-4-395 for changeset 65b0974c5beb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 429902a8b4..f439d76e78 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3117,3 +3117,4 @@ f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
 589fd07888abc8a1208616c56b21898d3352fc5b v7-4-392
 1bff71d202621d97acc4ef21ce9f47b78f68bda3 v7-4-393
 d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
+65b0974c5bebf5d6b56e9abc90d86759d1c4f6d7 v7-4-395

From 1255711304ac0f4ee0c2a30779c8a66375046d29 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 18:17:11 +0200
Subject: [PATCH 025/473] updated for version 7.4.396 Problem:    When
 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful) Solution:   Only
 set the clipboard after the last delete. (Christian Brabandt)

---
 src/ex_cmds.c    |  8 +++++++
 src/ex_cmds2.c   | 10 +++++++--
 src/ex_docmd.c   |  7 +++++++
 src/globals.h    |  2 ++
 src/ops.c        | 15 ++++++++++----
 src/proto/ui.pro |  2 ++
 src/ui.c         | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/version.c    |  2 ++
 8 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 62621bfa57..df6700d64b 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5514,7 +5514,15 @@ ex_global(eap)
 	    smsg((char_u *)_("Pattern not found: %s"), pat);
     }
     else
+    {
+#ifdef FEAT_CLIPBOARD
+	start_global_changes();
+#endif
 	global_exe(cmd);
+#ifdef FEAT_CLIPBOARD
+	end_global_changes();
+#endif
+    }
 
     ml_clearmarked();	   /* clear rest of the marks */
     vim_regfree(regmatch.regprog);
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index c502ff8527..908552d580 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2464,6 +2464,9 @@ ex_listdo(eap)
 	 * great speed improvement. */
 	save_ei = au_event_disable(",Syntax");
 #endif
+#ifdef FEAT_CLIPBOARD
+    start_global_changes();
+#endif
 
     if (eap->cmdidx == CMD_windo
 	    || eap->cmdidx == CMD_tabdo
@@ -2591,6 +2594,9 @@ ex_listdo(eap)
 					       curbuf->b_fname, TRUE, curbuf);
     }
 #endif
+#ifdef FEAT_CLIPBOARD
+    end_global_changes();
+#endif
 }
 
 /*
@@ -2750,8 +2756,8 @@ source_runtime(name, all)
  * used.
  * Returns OK when at least one match found, FAIL otherwise.
  *
- * If "name" is NULL calls callback for each entry in runtimepath. Cookie is 
- * passed by reference in this case, setting it to NULL indicates that callback 
+ * If "name" is NULL calls callback for each entry in runtimepath. Cookie is
+ * passed by reference in this case, setting it to NULL indicates that callback
  * has done its job.
  */
     int
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 083693b640..ba764bfcf6 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -11534,6 +11534,10 @@ ex_folddo(eap)
 {
     linenr_T	lnum;
 
+#ifdef FEAT_CLIPBOARD
+    start_global_changes();
+#endif
+
     /* First set the marks for all lines closed/open. */
     for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
 	if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
@@ -11542,5 +11546,8 @@ ex_folddo(eap)
     /* Execute the command on the marked lines. */
     global_exe(eap->arg);
     ml_clearmarked();	   /* clear rest of the marks */
+#ifdef FEAT_CLIPBOARD
+    end_global_changes();
+#endif
 }
 #endif
diff --git a/src/globals.h b/src/globals.h
index 77528c7b58..ce831f33d9 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -533,6 +533,8 @@ EXTERN int	clip_autoselect_plus INIT(= FALSE);
 EXTERN int	clip_autoselectml INIT(= FALSE);
 EXTERN int	clip_html INIT(= FALSE);
 EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
+EXTERN int	clip_did_set_selection INIT(= TRUE);
+EXTERN int	clip_unnamed_saved INIT(= 0);
 #endif
 
 /*
diff --git a/src/ops.c b/src/ops.c
index 265cf3a854..2b400916f7 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -1597,9 +1597,15 @@ adjust_clip_reg(rp)
 {
     /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard',
      * use '*' or '+' reg, respectively. "unnamedplus" prevails. */
-    if (*rp == 0 && clip_unnamed != 0)
-	*rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
+    if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0))
+    {
+	if (clip_unnamed != 0)
+	    *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
+								  ? '+' : '*';
+	else
+	    *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) && clip_plus.available)
 								  ? '+' : '*';
+    }
     if (!clip_star.available && *rp == '*')
 	*rp = 0;
     if (!clip_plus.available && *rp == '+')
@@ -3203,7 +3209,7 @@ op_yank(oap, deleting, mess)
     if (clip_star.available
 	    && (curr == &(y_regs[STAR_REGISTER])
 		|| (!deleting && oap->regname == 0
-					   && (clip_unnamed & CLIP_UNNAMED))))
+		   && ((clip_unnamed | clip_unnamed_saved) & CLIP_UNNAMED))))
     {
 	if (curr != &(y_regs[STAR_REGISTER]))
 	    /* Copy the text from register 0 to the clipboard register. */
@@ -3224,7 +3230,8 @@ op_yank(oap, deleting, mess)
     if (clip_plus.available
 	    && (curr == &(y_regs[PLUS_REGISTER])
 		|| (!deleting && oap->regname == 0
-				      && (clip_unnamed & CLIP_UNNAMED_PLUS))))
+		  && ((clip_unnamed | clip_unnamed_saved) &
+		      CLIP_UNNAMED_PLUS))))
     {
 	if (curr != &(y_regs[PLUS_REGISTER]))
 	    /* Copy the text from register 0 to the clipboard register. */
diff --git a/src/proto/ui.pro b/src/proto/ui.pro
index 234e99fd7e..4100aa7303 100644
--- a/src/proto/ui.pro
+++ b/src/proto/ui.pro
@@ -14,6 +14,8 @@ void clip_init __ARGS((int can_use));
 void clip_update_selection __ARGS((VimClipboard *clip));
 void clip_own_selection __ARGS((VimClipboard *cbd));
 void clip_lose_selection __ARGS((VimClipboard *cbd));
+void start_global_changes __ARGS((void));
+void end_global_changes __ARGS((void));
 void clip_auto_select __ARGS((void));
 int clip_isautosel_star __ARGS((void));
 int clip_isautosel_plus __ARGS((void));
diff --git a/src/ui.c b/src/ui.c
index db13555f4f..21d92f0b7b 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -557,6 +557,51 @@ clip_copy_selection(clip)
     }
 }
 
+/*
+ * Save and restore clip_unnamed before doing possibly many changes. This
+ * prevents accessing the clipboard very often which might slow down Vim
+ * considerably.
+ */
+
+/*
+ * Save clip_unnamed and reset it.
+ */
+    void
+start_global_changes()
+{
+    clip_unnamed_saved = clip_unnamed;
+
+    if (clip_did_set_selection)
+    {
+	clip_unnamed = FALSE;
+	clip_did_set_selection = FALSE;
+    }
+}
+
+/*
+ * Restore clip_unnamed and set the selection when needed.
+ */
+    void
+end_global_changes()
+{
+    if (!clip_did_set_selection)
+    {
+	clip_did_set_selection = TRUE;
+	clip_unnamed = clip_unnamed_saved;
+	if (clip_unnamed & CLIP_UNNAMED)
+	{
+	    clip_own_selection(&clip_star);
+	    clip_gen_set_selection(&clip_star);
+	}
+	if (clip_unnamed & CLIP_UNNAMED_PLUS)
+	{
+	    clip_own_selection(&clip_plus);
+	    clip_gen_set_selection(&clip_plus);
+	}
+    }
+    clip_unnamed_saved = FALSE;
+}
+
 /*
  * Called when Visual mode is ended: update the selection.
  */
@@ -1428,6 +1473,15 @@ clip_gen_lose_selection(cbd)
 clip_gen_set_selection(cbd)
     VimClipboard	*cbd;
 {
+    if (!clip_did_set_selection)
+    {
+	/* Updating postponed, so that accessing the system clipboard won't
+	 * hang Vim when accessing it many times (e.g. on a :g comand). */
+	if (cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
+	    return;
+	else if (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED))
+	    return;
+    }
 #ifdef FEAT_XCLIPBOARD
 # ifdef FEAT_GUI
     if (gui.in_use)
diff --git a/src/version.c b/src/version.c
index aa64155908..312e4abb60 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    396,
 /**/
     395,
 /**/

From cd3e9aaf6d171c388917bc0a104fb69730435aca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 18:17:11 +0200
Subject: [PATCH 026/473] Added tag v7-4-396 for changeset 7766142fc7d3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f439d76e78..68f9410268 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3118,3 +3118,4 @@ f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
 1bff71d202621d97acc4ef21ce9f47b78f68bda3 v7-4-393
 d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 65b0974c5bebf5d6b56e9abc90d86759d1c4f6d7 v7-4-395
+7766142fc7d3e90c2e15a9c606efcd97331edef8 v7-4-396

From a044cc69b85ce5e534bb414cbd58372094e5ef34 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 19:09:16 +0200
Subject: [PATCH 027/473] updated for version 7.4.397 Problem:    Matchparen
 only uses the topmost syntax item. Solution:   Go through the syntax stack to
 find items. (James McCoy) 	    Also use getcurpos() when possible.

---
 runtime/plugin/matchparen.vim | 13 ++++++++++---
 src/version.c                 |  2 ++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
index 817ce62b28..3804ab949a 100644
--- a/runtime/plugin/matchparen.vim
+++ b/runtime/plugin/matchparen.vim
@@ -98,10 +98,17 @@ function! s:Highlight_Matching_Pair()
     call cursor(c_lnum, c_col - before)
   endif
 
-  " When not in a string or comment ignore matches inside them.
+  " Build an expression that detects whether the current cursor position is in
+  " certain syntax types (string, comment, etc.), for use as searchpairpos()'s
+  " skip argument.
   " We match "escape" for special items, such as lispEscapeSpecial.
-  let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
-	\ '=~?  "string\\|character\\|singlequote\\|escape\\|comment"'
+  let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
+	\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
+  " If executing the expression determines that the cursor is currently in
+  " one of the syntax types, then we want searchpairpos() to find the pair
+  " within those syntax types (i.e., not skip).  Otherwise, the cursor is
+  " outside of the syntax types and s_skip should keep its value so we skip any
+  " matching pair inside the syntax types.
   execute 'if' s_skip '| let s_skip = 0 | endif'
 
   " Limit the search to lines visible in the window.
diff --git a/src/version.c b/src/version.c
index 312e4abb60..878ace89d4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    397,
 /**/
     396,
 /**/

From 3ef0e36f8dcf0f9fda62109665c001d7eea3af91 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 6 Aug 2014 19:09:16 +0200
Subject: [PATCH 028/473] Added tag v7-4-397 for changeset 8d361608fe86

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 68f9410268..12981ee35e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3119,3 +3119,4 @@ f051e50a6a5feb0f0c6d209440d9d305b82f5836 v7-4-391
 d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 65b0974c5bebf5d6b56e9abc90d86759d1c4f6d7 v7-4-395
 7766142fc7d3e90c2e15a9c606efcd97331edef8 v7-4-396
+8d361608fe86c534e51e4c7e583375642d34b7a4 v7-4-397

From bfe623becbc33f44f988af25f1e46df01fd422a2 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 7 Aug 2014 13:55:10 +0200
Subject: [PATCH 029/473] updated for version 7.4.398 Problem:    Gcc error for
 the argument of InterlockedIncrement() and 	    InterlockedDecrement().
 (Axel Bender) Solution:   Remove "unsigned" from the cRefCount_ declaration.

---
 src/gui_dwrite.cpp | 2 +-
 src/version.c      | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gui_dwrite.cpp b/src/gui_dwrite.cpp
index cf83c05044..d4c43a37d6 100644
--- a/src/gui_dwrite.cpp
+++ b/src/gui_dwrite.cpp
@@ -377,7 +377,7 @@ class GdiTextRenderer : public IDWriteTextRenderer
     }
 
 private:
-    unsigned long cRefCount_;
+    long cRefCount_;
     IDWriteBitmapRenderTarget* pRenderTarget_;
     IDWriteRenderingParams* pRenderingParams_;
 };
diff --git a/src/version.c b/src/version.c
index 878ace89d4..19183fdac8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    398,
 /**/
     397,
 /**/

From 6413c12d4bcbbeed42bfb708949f42d93660651c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 7 Aug 2014 13:55:10 +0200
Subject: [PATCH 030/473] Added tag v7-4-398 for changeset f62b2e76dd80

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 12981ee35e..bc9ec5c498 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3120,3 +3120,4 @@ d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 65b0974c5bebf5d6b56e9abc90d86759d1c4f6d7 v7-4-395
 7766142fc7d3e90c2e15a9c606efcd97331edef8 v7-4-396
 8d361608fe86c534e51e4c7e583375642d34b7a4 v7-4-397
+f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398

From d99496ef175f9ab0b461d583cf61eb4f10acd6ab Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 13:38:34 +0200
Subject: [PATCH 031/473] updated for version 7.4.399 Problem:    Encryption
 implementation is messy.  Blowfish encryption has a 	    weakness.
 Solution:   Refactor the encryption, store the state in an allocated struct 
     instead of using a save/restore mechanism.  Introduce the 	   
 "blowfish2" method, which does not have the weakness and encrypts 	   
 the whole undo file. (largely by David Leadbeater)

---
 runtime/doc/editing.txt |  34 +-
 runtime/doc/options.txt |  16 +-
 src/Makefile            |  31 +-
 src/blowfish.c          | 307 +++++++++---------
 src/crypt.c             | 585 +++++++++++++++++++++++++++++++++
 src/crypt_zip.c         | 158 +++++++++
 src/ex_docmd.c          |   3 +-
 src/fileio.c            | 346 +++++++++-----------
 src/globals.h           |   4 -
 src/main.c              |   3 +-
 src/memline.c           |  87 ++---
 src/misc2.c             | 335 +------------------
 src/option.c            |  10 +-
 src/proto.h             |   2 +
 src/proto/blowfish.pro  |  10 +-
 src/proto/crypt.pro     |  24 ++
 src/proto/crypt_zip.pro |   5 +
 src/proto/fileio.pro    |   2 -
 src/proto/misc2.pro     |  11 +-
 src/structs.h           |  25 +-
 src/testdir/test71.in   |  27 ++
 src/testdir/test71.ok   |   5 +
 src/testdir/test71a.in  |   4 +
 src/testdir/test72.in   |  27 ++
 src/testdir/test72.ok   |   4 +
 src/undo.c              | 692 ++++++++++++++++++++++++++++------------
 src/version.c           |   2 +
 27 files changed, 1781 insertions(+), 978 deletions(-)
 create mode 100644 src/crypt.c
 create mode 100644 src/crypt_zip.c
 create mode 100644 src/proto/crypt.pro
 create mode 100644 src/proto/crypt_zip.pro

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 0b5f69a7b7..cbb9b90e5f 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Jul 19
+*editing.txt*   For Vim version 7.4.  Last change: 2014 Aug 09
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1370,8 +1370,13 @@ lose your work.  The undo file can be disabled without much disadvantage. >
 
 Note: The text in memory is not encrypted.  A system administrator may be able
 to see your text while you are editing it.  When filtering text with
-":!filter" or using ":w !command" the text is not encrypted, this may reveal
-it to others.  The 'viminfo' file is not encrypted.
+":!filter" or using ":w !command" the text is also not encrypted, this may
+reveal it to others.  The 'viminfo' file is not encrypted.
+
+You could do this to edit very secret text: >
+	:set noundofile viminfo=
+	:noswapfile edit secrets.txt
+Keep in mind that without a swap file you risk loosing your work in a crash.
 
 WARNING: If you make a typo when entering the key and then write the file and
 exit, the text will be lost!
@@ -1398,18 +1403,25 @@ To disable the encryption, reset the 'key' option to an empty value: >
 	:set key=
 
 You can use the 'cryptmethod' option to select the type of encryption, use one
-of these two: >
-	:setlocal cm=zip       " weak method, backwards compatible
-	:setlocal cm=blowfish  " strong method
+of these: >
+	:setlocal cm=zip        " weak method, backwards compatible
+	:setlocal cm=blowfish   " method with flaws
+	:setlocal cm=blowfish2  " medium strong method
+
 Do this before writing the file.  When reading an encrypted file it will be
 set automatically to the method used when that file was written.  You can
 change 'cryptmethod' before writing that file to change the method.
+
 To set the default method, used for new files, use one of these in your
 |vimrc| file: >
 	set cm=zip
-	set cm=blowfish
+	set cm=blowfish2
+Use the first one if you need to be compatible with Vim 7.2 and older.  Using
+"blowfish2" is highly recommended if you can use a Vim version that supports
+it.
+
 The message given for reading and writing a file will show "[crypted]" when
-using zip, "[blowfish]" when using blowfish.
+using zip, "[blowfish]" when using blowfish, etc.
 
 When writing an undo file, the same key and method will be used for the text
 in the undo file. |persistent-undo|.
@@ -1444,7 +1456,7 @@ lines to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
      0	string	VimCrypt~	Vim encrypted file
      >9	string	01	- "zip" cryptmethod
      >9	string	02	- "blowfish" cryptmethod
-
+     >9	string	03	- "blowfish2" cryptmethod
 
 Notes:
 - Encryption is not possible when doing conversion with 'charconvert'.
@@ -1468,6 +1480,10 @@ Notes:
 - Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no
   objection to its export.  Pkzip's public file APPNOTE.TXT describes this
   algorithm in detail.
+- The implmentation of 'cryptmethod' "blowfish" has a flaw.  It is possible to
+  crack the first 64 bytes of a file and in some circumstances more of the
+  file. Use of it is not recommended, but it's still the strongest method
+  supported by Vim 7.3 and 7.4.  The "zip" method is even weaker.
 - Vim originates from the Netherlands.  That is where the sources come from.
   Thus the encryption code is not exported from the USA.
 
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 5f4a06e7ef..9d9cb1f937 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2229,10 +2229,18 @@ A jump table for the options with a short description can be found at |Q_op|.
 	   zip		PkZip compatible method.  A weak kind of encryption.
 			Backwards compatible with Vim 7.2 and older.
 							*blowfish*
-	   blowfish	Blowfish method.  Strong encryption.  Requires Vim 7.3
-			or later, files can NOT be read by Vim 7.2 and older.
-			This adds a "seed" to the file, every time you write
-			the file the encrypted bytes will be different.
+	   blowfish	Blowfish method.  Medium strong encryption but it has
+			an implementation flaw.  Requires Vim 7.3 or later,
+			files can NOT be read by Vim 7.2 and older.  This adds
+			a "seed" to the file, every time you write the file
+			the encrypted bytes will be different.
+							*blowfish2*
+	   blowfish2	Blowfish method.  Medium strong encryption.  Requires
+			Vim 7.4.399 or later, files can NOT be read by Vim 7.3
+			and older.  This adds a "seed" to the file, every time
+			you write the file the encrypted bytes will be
+			different.  The whole undo file is encrypted, not just
+			the pieces of text.
 
 	When reading an encrypted file 'cryptmethod' will be set automatically
 	to the detected method of the file being read.  Thus if you write it
diff --git a/src/Makefile b/src/Makefile
index 1d20ec1af1..772b15c7d6 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1431,6 +1431,8 @@ BASIC_SRC = \
 	blowfish.c \
 	buffer.c \
 	charset.c \
+	crypt.c \
+	crypt_zip.c \
 	diff.c \
 	digraph.c \
 	edit.c \
@@ -1520,6 +1522,8 @@ OBJ_COMMON = \
 	objects/buffer.o \
 	objects/blowfish.o \
 	objects/charset.o \
+	objects/crypt.o \
+	objects/crypt_zip.o \
 	objects/diff.o \
 	objects/digraph.o \
 	objects/edit.o \
@@ -1589,6 +1593,8 @@ PRO_AUTO = \
 	blowfish.pro \
 	buffer.pro \
 	charset.pro \
+	crypt.pro \
+	crypt_zip.pro \
 	diff.pro \
 	digraph.pro \
 	edit.pro \
@@ -1753,10 +1759,11 @@ xxd/xxd$(EXEEXT): xxd/xxd.c
 languages:
 	@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
 		cd $(PODIR); \
-		CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
+		  CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
 	fi
 	-@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
-		cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
+		cd $(PODIR); \
+		  CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
 	fi
 
 # Update the *.po files for changes in the sources.  Only run manually.
@@ -1883,8 +1890,14 @@ unittest unittests: $(UNITTEST_TARGETS)
 # Run individual test, assuming that Vim was already compiled.
 test1 test2 test3 test4 test5 test6 test7 test8 test9 \
 	test_autoformat_join \
+	test_breakindent \
+	test_changelist \
 	test_eval \
+	test_insertcount \
+	test_listlbr \
+	test_listlbr_utf8 \
 	test_options \
+	test_qf_title \
 	test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
 	test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
 	test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \
@@ -2506,6 +2519,12 @@ objects/buffer.o: buffer.c
 objects/charset.o: charset.c
 	$(CCC) -o $@ charset.c
 
+objects/crypt.o: crypt.c
+	$(CCC) -o $@ crypt.c
+
+objects/crypt_zip.o: crypt_zip.c
+	$(CCC) -o $@ crypt_zip.c
+
 objects/diff.o: diff.c
 	$(CCC) -o $@ diff.c
 
@@ -2855,6 +2874,14 @@ objects/charset.o: charset.c vim.h auto/config.h feature.h os_unix.h auto/osdef.
  ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
  gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
  arabic.h
+objects/crypt.o: crypt.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
+ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
+ gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
+ arabic.h
+objects/crypt_zip.o: crypt_zip.c vim.h auto/config.h feature.h os_unix.h \
+ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
+ regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
+ globals.h farsi.h arabic.h
 objects/diff.o: diff.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
  ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
  gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
diff --git a/src/blowfish.c b/src/blowfish.c
index 3d9ba5566a..6bf2482f0e 100644
--- a/src/blowfish.c
+++ b/src/blowfish.c
@@ -9,17 +9,25 @@
  * Blowfish encryption for Vim; in Blowfish cipher feedback mode.
  * Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh
  * Based on http://www.schneier.com/blowfish.html by Bruce Schneier.
+ *
+ * There are two variants:
+ * - The old one "blowfish" has a flaw which makes it much easier to crack the
+ *   key.  To see this, make a text file with one line of 1000 "x" characters
+ *   and write it encrypted.  Use "xxd" to inspect the bytes in the file.  You
+ *   will see that a block of 8 bytes repeats 8 times.
+ * - The new one "blowfish2" is better.  It uses an 8 byte CFB to avoid the
+ *   repeats.
  */
 
 #include "vim.h"
 
-#if defined(FEAT_CRYPT)
+#if defined(FEAT_CRYPT) || defined(PROTO)
 
 #define ARRAY_LENGTH(A)      (sizeof(A)/sizeof(A[0]))
 
 #define BF_BLOCK    8
 #define BF_BLOCK_MASK 7
-#define BF_CFB_LEN  (8*(BF_BLOCK))
+#define BF_MAX_CFB_LEN  (8 * BF_BLOCK)
 
 typedef union {
     UINT32_T ul[2];
@@ -37,14 +45,26 @@ typedef union {
 # endif
 #endif
 
-static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
-static void bf_e_cblock __ARGS((char_u *block));
-static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val));
+/* The state of encryption, referenced by cryptstate_T. */
+typedef struct {
+    UINT32_T	pax[18];	    /* P-array */
+    UINT32_T	sbx[4][256];	    /* S-boxes */
+    int		randbyte_offset;
+    int		update_offset;
+    char_u	cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */
+    int		cfb_len;	    /* size of cfb_buffer actually used */
+} bf_state_T;
+
+
+static void bf_e_block __ARGS((bf_state_T *state, UINT32_T *p_xl, UINT32_T *p_xr));
+static void bf_e_cblock __ARGS((bf_state_T *state, char_u *block));
+static int bf_check_tables __ARGS((UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val));
 static int bf_self_test __ARGS((void));
+static void bf_key_init __ARGS((bf_state_T *state, char_u *password, char_u *salt, int salt_len));
+static void bf_cfb_init __ARGS((bf_state_T *state, char_u *seed, int seed_len));
 
 /* Blowfish code */
-static UINT32_T pax[18];
-static UINT32_T ipa[18] = {
+static UINT32_T pax_init[18] = {
     0x243f6a88u, 0x85a308d3u, 0x13198a2eu,
     0x03707344u, 0xa4093822u, 0x299f31d0u,
     0x082efa98u, 0xec4e6c89u, 0x452821e6u,
@@ -53,8 +73,7 @@ static UINT32_T ipa[18] = {
     0xb5470917u, 0x9216d5d9u, 0x8979fb1bu
 };
 
-static UINT32_T sbx[4][256];
-static UINT32_T sbi[4][256] = {
+static UINT32_T sbx_init[4][256] = {
    {0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u,
     0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u,
     0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u,
@@ -314,33 +333,40 @@ static UINT32_T sbi[4][256] = {
  }
 };
 
-
 #define F1(i) \
-    xl ^= pax[i]; \
-    xr ^= ((sbx[0][xl >> 24] + \
-    sbx[1][(xl & 0xFF0000) >> 16]) ^ \
-    sbx[2][(xl & 0xFF00) >> 8]) + \
-    sbx[3][xl & 0xFF];
+    xl ^= bfs->pax[i]; \
+    xr ^= ((bfs->sbx[0][xl >> 24] + \
+    bfs->sbx[1][(xl & 0xFF0000) >> 16]) ^ \
+    bfs->sbx[2][(xl & 0xFF00) >> 8]) + \
+    bfs->sbx[3][xl & 0xFF];
 
 #define F2(i) \
-    xr ^= pax[i]; \
-    xl ^= ((sbx[0][xr >> 24] + \
-    sbx[1][(xr & 0xFF0000) >> 16]) ^ \
-    sbx[2][(xr & 0xFF00) >> 8]) + \
-    sbx[3][xr & 0xFF];
-
+    xr ^= bfs->pax[i]; \
+    xl ^= ((bfs->sbx[0][xr >> 24] + \
+    bfs->sbx[1][(xr & 0xFF0000) >> 16]) ^ \
+    bfs->sbx[2][(xr & 0xFF00) >> 8]) + \
+    bfs->sbx[3][xr & 0xFF];
 
     static void
-bf_e_block(p_xl, p_xr)
+bf_e_block(bfs, p_xl, p_xr)
+    bf_state_T *bfs;
     UINT32_T *p_xl;
     UINT32_T *p_xr;
 {
-    UINT32_T temp, xl = *p_xl, xr = *p_xr;
-
-    F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7)
-    F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15)
-    xl ^= pax[16];
-    xr ^= pax[17];
+    UINT32_T temp;
+    UINT32_T xl = *p_xl;
+    UINT32_T xr = *p_xr;
+
+    F1(0) F2(1)
+    F1(2) F2(3)
+    F1(4) F2(5)
+    F1(6) F2(7)
+    F1(8) F2(9)
+    F1(10) F2(11)
+    F1(12) F2(13)
+    F1(14) F2(15)
+    xl ^= bfs->pax[16];
+    xr ^= bfs->pax[17];
     temp = xl;
     xl = xr;
     xr = temp;
@@ -348,22 +374,6 @@ bf_e_block(p_xl, p_xr)
     *p_xr = xr;
 }
 
-#if 0  /* not used */
-    static void
-bf_d_block(p_xl, p_xr)
-    UINT32_T *p_xl;
-    UINT32_T *p_xr;
-{
-    UINT32_T temp, xl = *p_xl, xr = *p_xr;
-    F1(17) F2(16) F1(15) F2(14) F1(13) F2(12) F1(11) F2(10)
-    F1(9) F2(8) F1(7) F2(6) F1(5) F2(4) F1(3) F2(2)
-    xl ^= pax[1];
-    xr ^= pax[0];
-    temp = xl; xl = xr; xr = temp;
-    *p_xl = xl; *p_xr = xr;
-}
-#endif
-
 
 #ifdef WORDS_BIGENDIAN
 # define htonl2(x) \
@@ -374,7 +384,8 @@ bf_d_block(p_xl, p_xr)
 #endif
 
     static void
-bf_e_cblock(block)
+bf_e_cblock(bfs, block)
+    bf_state_T *bfs;
     char_u *block;
 {
     block8	bk;
@@ -382,35 +393,22 @@ bf_e_cblock(block)
     memcpy(bk.uc, block, 8);
     htonl2(bk.ul[0]);
     htonl2(bk.ul[1]);
-    bf_e_block(&bk.ul[0], &bk.ul[1]);
+    bf_e_block(bfs, &bk.ul[0], &bk.ul[1]);
     htonl2(bk.ul[0]);
     htonl2(bk.ul[1]);
     memcpy(block, bk.uc, 8);
 }
 
-#if 0  /* not used */
-    void
-bf_d_cblock(block)
-    char_u *block;
-{
-    block8 bk;
-    memcpy(bk.uc, block, 8);
-    htonl2(bk.ul[0]); htonl2(bk.ul[1]);
-    bf_d_block(&bk.ul[0], &bk.ul[1]);
-    htonl2(bk.ul[0]); htonl2(bk.ul[1]);
-    memcpy(block, bk.uc, 8);
-}
-#endif
-
 /*
  * Initialize the crypt method using "password" as the encryption key and
  * "salt[salt_len]" as the salt.
  */
-    void
-bf_key_init(password, salt, salt_len)
-    char_u *password;
-    char_u *salt;
-    int    salt_len;
+    static void
+bf_key_init(bfs, password, salt, salt_len)
+    bf_state_T	*bfs;
+    char_u	*password;
+    char_u	*salt;
+    int		salt_len;
 {
     int      i, j, keypos = 0;
     unsigned u;
@@ -418,7 +416,7 @@ bf_key_init(password, salt, salt_len)
     char_u   *key;
     int      keylen;
 
-    /* Process the key 1000 times.
+    /* Process the key 1001 times.
      * See http://en.wikipedia.org/wiki/Key_strengthening. */
     key = sha256_key(password, salt, salt_len);
     for (i = 0; i < 1000; i++)
@@ -437,52 +435,54 @@ bf_key_init(password, salt, salt_len)
 	key[i] = u;
     }
 
-    mch_memmove(sbx, sbi, 4 * 4 * 256);
+    /* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of
+     * Blowfish. */
+    mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256);
 
     for (i = 0; i < 18; ++i)
     {
 	val = 0;
 	for (j = 0; j < 4; ++j)
 	    val = (val << 8) | key[keypos++ % keylen];
-	pax[i] = ipa[i] ^ val;
+	bfs->pax[i] = pax_init[i] ^ val;
     }
 
     data_l = data_r = 0;
     for (i = 0; i < 18; i += 2)
     {
-	bf_e_block(&data_l, &data_r);
-	pax[i + 0] = data_l;
-	pax[i + 1] = data_r;
+	bf_e_block(bfs, &data_l, &data_r);
+	bfs->pax[i + 0] = data_l;
+	bfs->pax[i + 1] = data_r;
     }
 
     for (i = 0; i < 4; ++i)
     {
 	for (j = 0; j < 256; j += 2)
 	{
-	    bf_e_block(&data_l, &data_r);
-	    sbx[i][j + 0] = data_l;
-	    sbx[i][j + 1] = data_r;
+	    bf_e_block(bfs, &data_l, &data_r);
+	    bfs->sbx[i][j + 0] = data_l;
+	    bfs->sbx[i][j + 1] = data_r;
 	}
     }
 }
 
 /*
- * BF Self test for corrupted tables or instructions
+ * Blowfish self-test for corrupted tables or instructions.
  */
     static int
-bf_check_tables(a_ipa, a_sbi, val)
-    UINT32_T a_ipa[18];
-    UINT32_T a_sbi[4][256];
+bf_check_tables(pax, sbx, val)
+    UINT32_T pax[18];
+    UINT32_T sbx[4][256];
     UINT32_T val;
 {
     int i, j;
     UINT32_T c = 0;
 
     for (i = 0; i < 18; i++)
-	c ^= a_ipa[i];
+	c ^= pax[i];
     for (i = 0; i < 4; i++)
 	for (j = 0; j < 256; j++)
-	    c ^= a_sbi[i][j];
+	    c ^= sbx[i][j];
     return c == val;
 }
 
@@ -520,6 +520,10 @@ bf_self_test()
     int    err = 0;
     block8 bk;
     UINT32_T ui = 0xffffffffUL;
+    bf_state_T state;
+
+    vim_memset(&state, 0, sizeof(bf_state_T));
+    state.cfb_len = BF_MAX_CFB_LEN;
 
     /* We can't simply use sizeof(UINT32_T), it would generate a compiler
      * warning. */
@@ -528,21 +532,21 @@ bf_self_test()
 	EMSG(_("E820: sizeof(uint32_t) != 4"));
     }
 
-    if (!bf_check_tables(ipa, sbi, 0x6ffa520a))
+    if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
 	err++;
 
     bn = ARRAY_LENGTH(bf_test_data);
     for (i = 0; i < bn; i++)
     {
-	bf_key_init((char_u *)(bf_test_data[i].password),
+	bf_key_init(&state, (char_u *)(bf_test_data[i].password),
 		    bf_test_data[i].salt,
 		    (int)STRLEN(bf_test_data[i].salt));
-	if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum))
+	if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum))
 	    err++;
 
 	/* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */
 	memcpy(bk.uc, bf_test_data[i].plaintxt, 8);
-	bf_e_cblock(bk.uc);
+	bf_e_cblock(&state, bk.uc);
 	if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
 	{
 	    if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
@@ -554,43 +558,43 @@ bf_self_test()
     return err > 0 ? FAIL : OK;
 }
 
-/* Cipher feedback mode. */
-static int randbyte_offset = 0;
-static int update_offset = 0;
-static char_u cfb_buffer[BF_CFB_LEN]; /* 64 bytes */
+/*
+ * CFB: Cipher Feedback Mode.
+ */
 
 /*
- * Initialize with seed "iv[iv_len]".
+ * Initialize with seed "seed[seed_len]".
  */
-    void
-bf_cfb_init(iv, iv_len)
-    char_u *iv;
-    int    iv_len;
+    static void
+bf_cfb_init(bfs, seed, seed_len)
+    bf_state_T	*bfs;
+    char_u	*seed;
+    int		seed_len;
 {
     int i, mi;
 
-    randbyte_offset = update_offset = 0;
-    vim_memset(cfb_buffer, 0, BF_CFB_LEN);
-    if (iv_len > 0)
+    bfs->randbyte_offset = bfs->update_offset = 0;
+    vim_memset(bfs->cfb_buffer, 0, bfs->cfb_len);
+    if (seed_len > 0)
     {
-	mi = iv_len > BF_CFB_LEN ? iv_len : BF_CFB_LEN;
+	mi = seed_len > bfs->cfb_len ? seed_len : bfs->cfb_len;
 	for (i = 0; i < mi; i++)
-	    cfb_buffer[i % BF_CFB_LEN] ^= iv[i % iv_len];
+	    bfs->cfb_buffer[i % bfs->cfb_len] ^= seed[i % seed_len];
     }
 }
 
-#define BF_CFB_UPDATE(c) { \
-    cfb_buffer[update_offset] ^= (char_u)c; \
-    if (++update_offset == BF_CFB_LEN) \
-	update_offset = 0; \
+#define BF_CFB_UPDATE(bfs, c) { \
+    bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \
+    if (++bfs->update_offset == bfs->cfb_len) \
+	bfs->update_offset = 0; \
 }
 
-#define BF_RANBYTE(t) { \
-    if ((randbyte_offset & BF_BLOCK_MASK) == 0) \
-	bf_e_cblock(&cfb_buffer[randbyte_offset]); \
-    t = cfb_buffer[randbyte_offset]; \
-    if (++randbyte_offset == BF_CFB_LEN) \
-	randbyte_offset = 0; \
+#define BF_RANBYTE(bfs, t) { \
+    if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \
+	bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \
+    t = bfs->cfb_buffer[bfs->randbyte_offset]; \
+    if (++bfs->randbyte_offset == bfs->cfb_len) \
+	bfs->randbyte_offset = 0; \
 }
 
 /*
@@ -598,90 +602,69 @@ bf_cfb_init(iv, iv_len)
  * "from" and "to" can be equal to encrypt in place.
  */
     void
-bf_crypt_encode(from, len, to)
+crypt_blowfish_encode(state, from, len, to)
+    cryptstate_T *state;
     char_u	*from;
     size_t	len;
     char_u	*to;
 {
+    bf_state_T *bfs = state->method_state;
     size_t	i;
     int		ztemp, t;
 
     for (i = 0; i < len; ++i)
     {
 	ztemp = from[i];
-	BF_RANBYTE(t);
-	BF_CFB_UPDATE(ztemp);
+	BF_RANBYTE(bfs, t);
+	BF_CFB_UPDATE(bfs, ztemp);
 	to[i] = t ^ ztemp;
     }
 }
 
 /*
- * Decrypt "ptr[len]" in place.
+ * Decrypt "from[len]" into "to[len]".
  */
     void
-bf_crypt_decode(ptr, len)
-    char_u	*ptr;
-    long	len;
+crypt_blowfish_decode(state, from, len, to)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	*to;
 {
-    char_u	*p;
+    bf_state_T *bfs = state->method_state;
+    size_t	i;
     int		t;
 
-    for (p = ptr; p < ptr + len; ++p)
+    for (i = 0; i < len; ++i)
     {
-	BF_RANBYTE(t);
-	*p ^= t;
-	BF_CFB_UPDATE(*p);
+	BF_RANBYTE(bfs, t);
+	to[i] = from[i] ^ t;
+	BF_CFB_UPDATE(bfs, to[i]);
     }
 }
 
-/*
- * Initialize the encryption keys and the random header according to
- * the given password.
- */
     void
-bf_crypt_init_keys(passwd)
-    char_u *passwd;		/* password string with which to modify keys */
+crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
+    cryptstate_T	*state;
+    char_u*		key;
+    char_u*		salt;
+    int			salt_len;
+    char_u*		seed;
+    int			seed_len;
 {
-    char_u *p;
+    bf_state_T	*bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
 
-    for (p = passwd; *p != NUL; ++p)
-    {
-	BF_CFB_UPDATE(*p);
-    }
-}
+    state->method_state = bfs;
 
-static int save_randbyte_offset;
-static int save_update_offset;
-static char_u save_cfb_buffer[BF_CFB_LEN];
-static UINT32_T save_pax[18];
-static UINT32_T save_sbx[4][256];
+    /* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8
+     * times.  "blowfish2" uses a 8 byte buffer to avoid repeating. */
+    bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK;
 
-/*
- * Save the current crypt state.  Can only be used once before
- * bf_crypt_restore().
- */
-    void
-bf_crypt_save()
-{
-    save_randbyte_offset = randbyte_offset;
-    save_update_offset = update_offset;
-    mch_memmove(save_cfb_buffer, cfb_buffer, BF_CFB_LEN);
-    mch_memmove(save_pax, pax, 4 * 18);
-    mch_memmove(save_sbx, sbx, 4 * 4 * 256);
-}
+    if (blowfish_self_test() == FAIL)
+	return;
 
-/*
- * Restore the current crypt state.  Can only be used after
- * bf_crypt_save().
- */
-    void
-bf_crypt_restore()
-{
-    randbyte_offset = save_randbyte_offset;
-    update_offset = save_update_offset;
-    mch_memmove(cfb_buffer, save_cfb_buffer, BF_CFB_LEN);
-    mch_memmove(pax, save_pax, 4 * 18);
-    mch_memmove(sbx, save_sbx, 4 * 4 * 256);
+    bf_key_init(bfs, key, salt, salt_len);
+    bf_cfb_init(bfs, seed, seed_len);
 }
 
 /*
diff --git a/src/crypt.c b/src/crypt.c
new file mode 100644
index 0000000000..758ffb17b2
--- /dev/null
+++ b/src/crypt.c
@@ -0,0 +1,585 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved	by Bram Moolenaar
+ *
+ * Do ":help uganda"  in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * crypt.c: Generic encryption support.
+ */
+#include "vim.h"
+
+#if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Optional encryption support.
+ * Mohsin Ahmed, mosh@sasi.com, 1998-09-24
+ * Based on zip/crypt sources.
+ * Refactored by David Leadbeater, 2014.
+ *
+ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
+ * most countries.  There are a few exceptions, but that still should not be a
+ * problem since this code was originally created in Europe and India.
+ *
+ * Blowfish addition originally made by Mohsin Ahmed,
+ * http://www.cs.albany.edu/~mosh 2010-03-14
+ * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html)
+ * and sha256 by Christophe Devine.
+ */
+
+typedef struct {
+    char    *name;	/* encryption name as used in 'cryptmethod' */
+    char    *magic;	/* magic bytes stored in file header */
+    int	    salt_len;	/* length of salt, or 0 when not using salt */
+    int	    seed_len;	/* length of seed, or 0 when not using salt */
+    int	    works_inplace; /* encryption/decryption can be done in-place */
+    int	    whole_undofile; /* whole undo file is encrypted */
+
+    /* Optional function pointer for a self-test. */
+    int (* self_test_fn)();
+
+    /* Function pointer for initializing encryption/decription. */
+    void (* init_fn)(cryptstate_T *state, char_u *key,
+		      char_u *salt, int salt_len, char_u *seed, int seed_len);
+
+    /* Function pointers for encoding/decoding from one buffer into another.
+     * Optional, however, these or the _buffer ones should be configured. */
+    void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len,
+								  char_u *to);
+    void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len,
+								  char_u *to);
+
+    /* Function pointers for encoding and decoding, can buffer data if needed.
+     * Optional (however, these or the above should be configured). */
+    long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
+							     char_u **newptr);
+    long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
+							     char_u **newptr);
+
+    /* Function pointers for in-place encoding and decoding, used for
+     * crypt_*_inplace(). "from" and "to" arguments will be equal.
+     * These may be the same as decode_fn and encode_fn above, however an
+     * algorithm may implement them in a way that is not interchangeable with
+     * the crypt_(en|de)code() interface (for example because it wishes to add
+     * padding to files).
+     * This method is used for swap and undo files which have a rigid format.
+     */
+    void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
+								  char_u *p2);
+    void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
+								  char_u *p2);
+} cryptmethod_T;
+
+/* index is method_nr of cryptstate_T, CRYPT_M_* */
+static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
+    /* PK_Zip; very weak */
+    {
+	"zip",
+	"VimCrypt~01!",
+	0,
+	0,
+	TRUE,
+	FALSE,
+	NULL,
+	crypt_zip_init,
+	crypt_zip_encode, crypt_zip_decode,
+	NULL, NULL,
+	crypt_zip_encode, crypt_zip_decode,
+    },
+
+    /* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */
+    {
+	"blowfish",
+	"VimCrypt~02!",
+	8,
+	8,
+	TRUE,
+	FALSE,
+	blowfish_self_test,
+	crypt_blowfish_init,
+	crypt_blowfish_encode, crypt_blowfish_decode,
+	NULL, NULL,
+	crypt_blowfish_encode, crypt_blowfish_decode,
+    },
+
+    /* Blowfish/CFB + SHA-256 custom key derivation; fixed. */
+    {
+	"blowfish2",
+	"VimCrypt~03!",
+	8,
+	8,
+	TRUE,
+	TRUE,
+	blowfish_self_test,
+	crypt_blowfish_init,
+	crypt_blowfish_encode, crypt_blowfish_decode,
+	NULL, NULL,
+	crypt_blowfish_encode, crypt_blowfish_decode,
+    },
+};
+
+#define CRYPT_MAGIC_LEN	12	/* cannot change */
+static char	crypt_magic_head[] = "VimCrypt~";
+
+/*
+ * Return int value for crypt method name.
+ * 0 for "zip", the old method.  Also for any non-valid value.
+ * 1 for "blowfish".
+ * 2 for "blowfish2".
+ */
+    int
+crypt_method_nr_from_name(name)
+    char_u  *name;
+{
+    int i;
+
+    for (i = 0; i < CRYPT_M_COUNT; ++i)
+	if (STRCMP(name, cryptmethods[i].name) == 0)
+	    return i;
+    return 0;
+}
+
+/*
+ * Get the crypt method used for a file from "ptr[len]", the magic text at the
+ * start of the file.
+ * Returns -1 when no encryption used.
+ */
+    int
+crypt_method_nr_from_magic(ptr, len)
+    char  *ptr;
+    int   len;
+{
+    int i;
+
+    if (len < CRYPT_MAGIC_LEN)
+	return -1;
+
+    for (i = 0; i < CRYPT_M_COUNT; i++)
+	if (memcmp(ptr, cryptmethods[i].magic, CRYPT_MAGIC_LEN) == 0)
+	    return i;
+
+    i = (int)STRLEN(crypt_magic_head);
+    if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
+	EMSG(_("E821: File is encrypted with unknown method"));
+
+    return -1;
+}
+
+/*
+ * Return TRUE if the crypt method for "method_nr" can be done in-place.
+ */
+    int
+crypt_works_inplace(state)
+    cryptstate_T *state;
+{
+    return cryptmethods[state->method_nr].works_inplace;
+}
+
+/*
+ * Get the crypt method for buffer "buf" as a number.
+ */
+    int
+crypt_get_method_nr(buf)
+    buf_T *buf;
+{
+    return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
+}
+
+/*
+ * Return TRUE when the buffer uses an encryption method that encrypts the
+ * whole undo file, not only the text.
+ */
+    int
+crypt_whole_undofile(method_nr)
+    int method_nr;
+{
+    return cryptmethods[method_nr].whole_undofile;
+}
+
+/*
+ * Get crypt method specifc length of the file header in bytes.
+ */
+    int
+crypt_get_header_len(method_nr)
+    int method_nr;
+{
+    return CRYPT_MAGIC_LEN
+	+ cryptmethods[method_nr].salt_len
+	+ cryptmethods[method_nr].seed_len;
+}
+
+/*
+ * Set the crypt method for buffer "buf" to "method_nr" using the int value as
+ * returned by crypt_method_nr_from_name().
+ */
+    void
+crypt_set_cm_option(buf, method_nr)
+    buf_T   *buf;
+    int	    method_nr;
+{
+    free_string_option(buf->b_p_cm);
+    buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name);
+}
+
+/*
+ * If the crypt method for the current buffer has a self-test, run it and
+ * return OK/FAIL.
+ */
+    int
+crypt_self_test()
+{
+    int method_nr = crypt_get_method_nr(curbuf);
+
+    if (cryptmethods[method_nr].self_test_fn == NULL)
+	return OK;
+    return cryptmethods[method_nr].self_test_fn();
+}
+
+/*
+ * Allocate a crypt state and initialize it.
+ */
+    cryptstate_T *
+crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
+    int		method_nr;
+    char_u	*key;
+    char_u	*salt;
+    int		salt_len;
+    char_u	*seed;
+    int		seed_len;
+{
+    cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
+
+    state->method_nr = method_nr;
+    cryptmethods[method_nr].init_fn(state, key, salt, salt_len, seed, seed_len);
+    return state;
+}
+
+/*
+ * Allocate a crypt state from a file header and initialize it.
+ * Assumes that header contains at least the number of bytes that
+ * crypt_get_header_len() returns for "method_nr".
+ */
+    cryptstate_T *
+crypt_create_from_header(method_nr, key, header)
+    int		method_nr;
+    char_u	*key;
+    char_u	*header;
+{
+    char_u	*salt = NULL;
+    char_u	*seed = NULL;
+    int		salt_len = cryptmethods[method_nr].salt_len;
+    int		seed_len = cryptmethods[method_nr].seed_len;
+
+    if (salt_len > 0)
+	salt = header + CRYPT_MAGIC_LEN;
+    if (seed_len > 0)
+	seed = header + CRYPT_MAGIC_LEN + salt_len;
+
+    return crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
+}
+
+/*
+ * Read the crypt method specific header data from "fp".
+ * Return an allocated cryptstate_T or NULL on error.
+ */
+    cryptstate_T *
+crypt_create_from_file(fp, key)
+    FILE    *fp;
+    char_u  *key;
+{
+    int		method_nr;
+    int		header_len;
+    char	magic_buffer[CRYPT_MAGIC_LEN];
+    char_u	*buffer;
+    cryptstate_T *state;
+
+    if (fread(magic_buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
+	return NULL;
+    method_nr = crypt_method_nr_from_magic(magic_buffer, CRYPT_MAGIC_LEN);
+    if (method_nr < 0)
+	return NULL;
+
+    header_len = crypt_get_header_len(method_nr);
+    if ((buffer = alloc(header_len)) == NULL)
+	return NULL;
+    mch_memmove(buffer, magic_buffer, CRYPT_MAGIC_LEN);
+    if (header_len > CRYPT_MAGIC_LEN
+	    && fread(buffer + CRYPT_MAGIC_LEN,
+				    header_len - CRYPT_MAGIC_LEN, 1, fp) != 1)
+    {
+	vim_free(buffer);
+	return NULL;
+    }
+
+    state = crypt_create_from_header(method_nr, key, buffer);
+    vim_free(buffer);
+    return state;
+}
+
+/*
+ * Allocate a cryptstate_T for writing and initialize it with "key".
+ * Allocates and fills in the header and stores it in "header", setting
+ * "header_len".  The header may include salt and seed, depending on
+ * cryptmethod.  Caller must free header.
+ * Returns the state or NULL on failure.
+ */
+    cryptstate_T *
+crypt_create_for_writing(method_nr, key, header, header_len)
+    int	    method_nr;
+    char_u  *key;
+    char_u  **header;
+    int	    *header_len;
+{
+    int	    len = crypt_get_header_len(method_nr);
+    char_u  *salt = NULL;
+    char_u  *seed = NULL;
+    int	    salt_len = cryptmethods[method_nr].salt_len;
+    int	    seed_len = cryptmethods[method_nr].seed_len;
+    cryptstate_T *state;
+
+    *header_len = len;
+    *header = alloc(len);
+    if (*header == NULL)
+	return NULL;
+
+    mch_memmove(*header, cryptmethods[method_nr].magic, CRYPT_MAGIC_LEN);
+    if (salt_len > 0 || seed_len > 0)
+    {
+	if (salt_len > 0)
+	    salt = *header + CRYPT_MAGIC_LEN;
+	if (seed_len > 0)
+	    seed = *header + CRYPT_MAGIC_LEN + salt_len;
+
+	/* TODO: Should this be crypt method specific? (Probably not worth
+	 * it).  sha2_seed is pretty bad for large amounts of entropy, so make
+	 * that into something which is suitable for anything. */
+	sha2_seed(salt, salt_len, seed, seed_len);
+    }
+
+    state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
+    if (state == NULL)
+    {
+	vim_free(*header);
+	*header = NULL;
+    }
+    return state;
+}
+
+/*
+ * Free the crypt state.
+ */
+    void
+crypt_free_state(state)
+    cryptstate_T	*state;
+{
+    vim_free(state->method_state);
+    vim_free(state);
+}
+
+/*
+ * Encode "from[len]" and store the result in a newly allocated buffer, which
+ * is stored in "newptr".
+ * Return number of bytes in "newptr", 0 for need more or -1 on error.
+ */
+    long
+crypt_encode_alloc(state, from, len, newptr)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	**newptr;
+{
+    cryptmethod_T *method = &cryptmethods[state->method_nr];
+
+    if (method->encode_buffer_fn != NULL)
+	/* Has buffer function, pass through. */
+	return method->encode_buffer_fn(state, from, len, newptr);
+    if (len == 0)
+	/* Not buffering, just return EOF. */
+	return len;
+
+    *newptr = alloc(len);
+    if (*newptr == NULL)
+	return -1;
+    method->encode_fn(state, from, len, *newptr);
+    return len;
+}
+
+/*
+ * Decrypt "ptr[len]" and store the result in a newly allocated buffer, which
+ * is stored in "newptr".
+ * Return number of bytes in "newptr", 0 for need more or -1 on error.
+ */
+    long
+crypt_decode_alloc(state, ptr, len, newptr)
+    cryptstate_T *state;
+    char_u	*ptr;
+    long	len;
+    char_u      **newptr;
+{
+    cryptmethod_T *method = &cryptmethods[state->method_nr];
+
+    if (method->decode_buffer_fn != NULL)
+	/* Has buffer function, pass through. */
+	return method->decode_buffer_fn(state, ptr, len, newptr);
+
+    if (len == 0)
+	/* Not buffering, just return EOF. */
+	return len;
+
+    *newptr = alloc(len);
+    if (*newptr == NULL)
+	return -1;
+    method->decode_fn(state, ptr, len, *newptr);
+    return len;
+}
+
+/*
+ * Encrypting "from[len]" into "to[len]".
+ */
+    void
+crypt_encode(state, from, len, to)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	*to;
+{
+    cryptmethods[state->method_nr].encode_fn(state, from, len, to);
+}
+
+/*
+ * decrypting "from[len]" into "to[len]".
+ */
+    void
+crypt_decode(state, from, len, to)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	*to;
+{
+    cryptmethods[state->method_nr].decode_fn(state, from, len, to);
+}
+
+/*
+ * Simple inplace encryption, modifies "buf[len]" in place.
+ */
+    void
+crypt_encode_inplace(state, buf, len)
+    cryptstate_T *state;
+    char_u	*buf;
+    size_t	len;
+{
+    cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf);
+}
+
+/*
+ * Simple inplace decryption, modifies "buf[len]" in place.
+ */
+    void
+crypt_decode_inplace(state, buf, len)
+    cryptstate_T *state;
+    char_u	*buf;
+    size_t	len;
+{
+    cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf);
+}
+
+/*
+ * Free an allocated crypt key.  Clear the text to make sure it doesn't stay
+ * in memory anywhere.
+ */
+    void
+crypt_free_key(key)
+    char_u *key;
+{
+    char_u *p;
+
+    if (key != NULL)
+    {
+	for (p = key; *p != NUL; ++p)
+	    *p = 0;
+	vim_free(key);
+    }
+}
+
+/*
+ * Ask the user for a crypt key.
+ * When "store" is TRUE, the new key is stored in the 'key' option, and the
+ * 'key' option value is returned: Don't free it.
+ * When "store" is FALSE, the typed key is returned in allocated memory.
+ * Returns NULL on failure.
+ */
+    char_u *
+crypt_get_key(store, twice)
+    int		store;
+    int		twice;	    /* Ask for the key twice. */
+{
+    char_u	*p1, *p2 = NULL;
+    int		round;
+
+    for (round = 0; ; ++round)
+    {
+	cmdline_star = TRUE;
+	cmdline_row = msg_row;
+	p1 = getcmdline_prompt(NUL, round == 0
+		? (char_u *)_("Enter encryption key: ")
+		: (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING,
+		NULL);
+	cmdline_star = FALSE;
+
+	if (p1 == NULL)
+	    break;
+
+	if (round == twice)
+	{
+	    if (p2 != NULL && STRCMP(p1, p2) != 0)
+	    {
+		MSG(_("Keys don't match!"));
+		crypt_free_key(p1);
+		crypt_free_key(p2);
+		p2 = NULL;
+		round = -1;		/* do it again */
+		continue;
+	    }
+
+	    if (store)
+	    {
+		set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
+		crypt_free_key(p1);
+		p1 = curbuf->b_p_key;
+	    }
+	    break;
+	}
+	p2 = p1;
+    }
+
+    /* since the user typed this, no need to wait for return */
+    if (msg_didout)
+	msg_putchar('\n');
+    need_wait_return = FALSE;
+    msg_didout = FALSE;
+
+    crypt_free_key(p2);
+    return p1;
+}
+
+
+/*
+ * Append a message to IObuff for the encryption/decryption method being used.
+ */
+    void
+crypt_append_msg(buf)
+    buf_T *buf;
+{
+    if (crypt_get_method_nr(buf) == 0)
+	STRCAT(IObuff, _("[crypted]"));
+    else
+    {
+	STRCAT(IObuff, "[");
+	STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
+	STRCAT(IObuff, "]");
+    }
+}
+
+#endif /* FEAT_CRYPT */
diff --git a/src/crypt_zip.c b/src/crypt_zip.c
new file mode 100644
index 0000000000..571f3ec746
--- /dev/null
+++ b/src/crypt_zip.c
@@ -0,0 +1,158 @@
+/* vi:set ts=8 sts=4 sw=4:
+ *
+ * VIM - Vi IMproved	by Bram Moolenaar
+ *
+ * Do ":help uganda"  in Vim to read copying and usage conditions.
+ * Do ":help credits" in Vim to see a list of people who contributed.
+ * See README.txt for an overview of the Vim source code.
+ */
+
+/*
+ * crypt_zip.c: Zip encryption support.
+ */
+#include "vim.h"
+
+#if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Optional encryption support.
+ * Mohsin Ahmed, mosh@sasi.com, 98-09-24
+ * Based on zip/crypt sources.
+ *
+ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
+ * most countries.  There are a few exceptions, but that still should not be a
+ * problem since this code was originally created in Europe and India.
+ */
+
+/* Need a type that should be 32 bits. 64 also works but wastes space. */
+# if VIM_SIZEOF_INT >= 4
+typedef unsigned int u32_T;	/* int is at least 32 bits */
+# else
+typedef unsigned long u32_T;	/* long should be 32 bits or more */
+# endif
+
+/* The state of encryption, referenced by cryptstate_T. */
+typedef struct {
+    u32_T keys[3];
+} zip_state_T;
+
+
+static void make_crc_tab __ARGS((void));
+
+static u32_T crc_32_table[256];
+
+/*
+ * Fill the CRC table, if not done already.
+ */
+    static void
+make_crc_tab()
+{
+    u32_T	s, t, v;
+    static int	done = FALSE;
+
+    if (done)
+	return;
+    for (t = 0; t < 256; t++)
+    {
+	v = t;
+	for (s = 0; s < 8; s++)
+	    v = (v >> 1) ^ ((v & 1) * (u32_T)0xedb88320L);
+	crc_32_table[t] = v;
+    }
+    done = TRUE;
+}
+
+#define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
+
+/*
+ * Return the next byte in the pseudo-random sequence.
+ */
+#define DECRYPT_BYTE_ZIP(keys, t) { \
+    short_u temp = (short_u)keys[2] | 2; \
+    t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
+}
+
+/*
+ * Update the encryption keys with the next byte of plain text.
+ */
+#define UPDATE_KEYS_ZIP(keys, c) { \
+    keys[0] = CRC32(keys[0], (c)); \
+    keys[1] += keys[0] & 0xff; \
+    keys[1] = keys[1] * 134775813L + 1; \
+    keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
+}
+
+/*
+ * Initialize for encryption/decryption.
+ */
+    void
+crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
+    cryptstate_T    *state;
+    char_u	    *key;
+    char_u	    *salt UNUSED;
+    int		    salt_len UNUSED;
+    char_u	    *seed UNUSED;
+    int		    seed_len UNUSED;
+{
+    char_u	*p;
+    zip_state_T	*zs;
+
+    zs = (zip_state_T *)alloc(sizeof(zip_state_T));
+    state->method_state = zs;
+
+    make_crc_tab();
+    zs->keys[0] = 305419896L;
+    zs->keys[1] = 591751049L;
+    zs->keys[2] = 878082192L;
+    for (p = key; *p != NUL; ++p)
+    {
+	UPDATE_KEYS_ZIP(zs->keys, (int)*p);
+    }
+}
+
+/*
+ * Encrypt "from[len]" into "to[len]".
+ * "from" and "to" can be equal to encrypt in place.
+ */
+    void
+crypt_zip_encode(state, from, len, to)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	*to;
+{
+    zip_state_T *zs = state->method_state;
+    size_t	i;
+    int		ztemp, t;
+
+    for (i = 0; i < len; ++i)
+    {
+	ztemp = from[i];
+	DECRYPT_BYTE_ZIP(zs->keys, t);
+	UPDATE_KEYS_ZIP(zs->keys, ztemp);
+	to[i] = t ^ ztemp;
+    }
+}
+
+/*
+ * Decrypt "from[len]" into "to[len]".
+ */
+    void
+crypt_zip_decode(state, from, len, to)
+    cryptstate_T *state;
+    char_u	*from;
+    size_t	len;
+    char_u	*to;
+{
+    zip_state_T *zs = state->method_state;
+    size_t	i;
+    short_u	temp;
+
+    for (i = 0; i < len; ++i)
+    {
+	temp = (short_u)zs->keys[2] | 2;
+	temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
+	UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp);
+    }
+}
+
+#endif /* FEAT_CRYPT */
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index ba764bfcf6..fecb653b54 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -11506,8 +11506,7 @@ ex_match(eap)
 ex_X(eap)
     exarg_T	*eap UNUSED;
 {
-    if (get_crypt_method(curbuf) == 0 || blowfish_self_test() == OK)
-	(void)get_crypt_key(TRUE, TRUE);
+    (void)crypt_get_key(TRUE, TRUE);
 }
 #endif
 
diff --git a/src/fileio.c b/src/fileio.c
index 38dc2597da..a028b22a5c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -24,20 +24,6 @@
 #define BUFSIZE		8192	/* size of normal write buffer */
 #define SMBUFSIZE	256	/* size of emergency write buffer */
 
-#ifdef FEAT_CRYPT
-/* crypt_magic[0] is pkzip crypt, crypt_magic[1] is sha2+blowfish */
-static char	*crypt_magic[] = {"VimCrypt~01!", "VimCrypt~02!"};
-static char	crypt_magic_head[] = "VimCrypt~";
-# define CRYPT_MAGIC_LEN	12		/* must be multiple of 4! */
-
-/* For blowfish, after the magic header, we store 8 bytes of salt and then 8
- * bytes of seed (initialisation vector). */
-static int	crypt_salt_len[] = {0, 8};
-static int	crypt_seed_len[] = {0, 8};
-#define CRYPT_SALT_LEN_MAX 8
-#define CRYPT_SEED_LEN_MAX 8
-#endif
-
 /* Is there any system that doesn't have access()? */
 #define USE_MCH_ACCESS
 
@@ -55,7 +41,6 @@ static char_u *readfile_charconvert __ARGS((char_u *fname, char_u *fenc, int *fd
 static void check_marks_read __ARGS((void));
 #endif
 #ifdef FEAT_CRYPT
-static int crypt_method_from_magic __ARGS((char *ptr, int len));
 static char_u *check_for_cryptkey __ARGS((char_u *cryptkey, char_u *ptr, long *sizep, off_t *filesizep, int newfile, char_u *fname, int *did_ask));
 #endif
 #ifdef UNIX
@@ -116,6 +101,9 @@ struct bw_info
 #ifdef HAS_BW_FLAGS
     int		bw_flags;	/* FIO_ flags */
 #endif
+#ifdef FEAT_CRYPT
+    buf_T	*bw_buffer;	/* buffer being written */
+#endif
 #ifdef FEAT_MBYTE
     char_u	bw_rest[CONV_RESTLEN]; /* not converted bytes */
     int		bw_restlen;	/* nr of bytes in bw_rest[] */
@@ -250,7 +238,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 #ifdef FEAT_CRYPT
     char_u	*cryptkey = NULL;
     int		did_ask_for_key = FALSE;
-    int		crypt_method_used;
 #endif
 #ifdef FEAT_PERSISTENT_UNDO
     context_sha256_T sha_ctx;
@@ -966,13 +953,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 #endif
     }
 
-#ifdef FEAT_CRYPT
-    if (cryptkey != NULL)
-	/* Need to reset the state, but keep the key, don't want to ask for it
-	 * again. */
-	crypt_pop_state();
-#endif
-
     /*
      * When retrying with another "fenc" and the first time "fileformat"
      * will be reset.
@@ -1174,6 +1154,15 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 				  && !read_buffer);
 	if (read_undo_file)
 	    sha256_start(&sha_ctx);
+#endif
+#ifdef FEAT_CRYPT
+	if (curbuf->b_cryptstate != NULL)
+	{
+	    /* Need to free the state, but keep the key, don't want to ask for
+	     * it again. */
+	    crypt_free_state(curbuf->b_cryptstate);
+	    curbuf->b_cryptstate = NULL;
+	}
 #endif
     }
 
@@ -1339,6 +1328,76 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 		    size = read_eintr(fd, ptr, size);
 		}
 
+#ifdef FEAT_CRYPT
+		/*
+		 * At start of file: Check for magic number of encryption.
+		 */
+		if (filesize == 0 && size > 0)
+		    cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
+						  &filesize, newfile, sfname,
+						  &did_ask_for_key);
+		/*
+		 * Decrypt the read bytes.  This is done before checking for
+		 * EOF because the crypt layer may be buffering.
+		 */
+		if (cryptkey != NULL && size > 0)
+		{
+		    if (crypt_works_inplace(curbuf->b_cryptstate))
+		    {
+			crypt_decode_inplace(curbuf->b_cryptstate, ptr, size);
+		    }
+		    else
+		    {
+			char_u	*newptr = NULL;
+			int	decrypted_size;
+
+			decrypted_size = crypt_decode_alloc(
+				    curbuf->b_cryptstate, ptr, size, &newptr);
+
+			/* If the crypt layer is buffering, not producing
+			 * anything yet, need to read more. */
+			if (size > 0 && decrypted_size == 0)
+			    continue;
+
+			if (linerest == 0)
+			{
+			    /* Simple case: reuse returned buffer (may be
+			     * NULL, checked later). */
+			    new_buffer = newptr;
+			}
+			else
+			{
+			    long_u	new_size;
+
+			    /* Need new buffer to add bytes carried over. */
+			    new_size = (long_u)(decrypted_size + linerest + 1);
+			    new_buffer = lalloc(new_size, FALSE);
+			    if (new_buffer == NULL)
+			    {
+				do_outofmem_msg(new_size);
+				error = TRUE;
+				break;
+			    }
+
+			    mch_memmove(new_buffer, buffer, linerest);
+			    if (newptr != NULL)
+				mch_memmove(new_buffer + linerest, newptr,
+							      decrypted_size);
+			}
+
+			if (new_buffer != NULL)
+			{
+			    vim_free(buffer);
+			    buffer = new_buffer;
+			    new_buffer = NULL;
+			    line_start = buffer;
+			    ptr = buffer + linerest;
+			}
+			size = decrypted_size;
+		    }
+		}
+#endif
+
 		if (size <= 0)
 		{
 		    if (size < 0)		    /* read error */
@@ -1403,21 +1462,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 		    }
 #endif
 		}
-
-#ifdef FEAT_CRYPT
-		/*
-		 * At start of file: Check for magic number of encryption.
-		 */
-		if (filesize == 0)
-		    cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
-					&filesize, newfile, sfname,
-					&did_ask_for_key);
-		/*
-		 * Decrypt the read bytes.
-		 */
-		if (cryptkey != NULL && size > 0)
-		    crypt_decode(ptr, size);
-#endif
 	    }
 	    skip_read = FALSE;
 
@@ -1430,10 +1474,9 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 	     */
 	    if ((filesize == 0
 # ifdef FEAT_CRYPT
-		   || (filesize == (CRYPT_MAGIC_LEN
-					   + crypt_salt_len[use_crypt_method]
-					   + crypt_seed_len[use_crypt_method])
-							  && cryptkey != NULL)
+		   || (cryptkey != NULL
+			&& filesize == crypt_get_header_len(
+						 crypt_get_method_nr(curbuf)))
 # endif
 		       )
 		    && (fio_flags == FIO_UCSBOM
@@ -2262,15 +2305,15 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 	save_file_ff(curbuf);		/* remember the current file format */
 
 #ifdef FEAT_CRYPT
-    crypt_method_used = use_crypt_method;
-    if (cryptkey != NULL)
+    if (curbuf->b_cryptstate != NULL)
     {
-	crypt_pop_state();
-	if (cryptkey != curbuf->b_p_key)
-	    free_crypt_key(cryptkey);
-	/* don't set cryptkey to NULL, it's used below as a flag that
-	 * encryption was used */
+	crypt_free_state(curbuf->b_cryptstate);
+	curbuf->b_cryptstate = NULL;
     }
+    if (cryptkey != NULL && cryptkey != curbuf->b_p_key)
+	crypt_free_key(cryptkey);
+    /* Don't set cryptkey to NULL, it's used below as a flag that
+     * encryption was used. */
 #endif
 
 #ifdef FEAT_MBYTE
@@ -2457,10 +2500,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 #ifdef FEAT_CRYPT
 	    if (cryptkey != NULL)
 	    {
-		if (crypt_method_used == 1)
-		    STRCAT(IObuff, _("[blowfish]"));
-		else
-		    STRCAT(IObuff, _("[crypted]"));
+		crypt_append_msg(curbuf);
 		c = TRUE;
 	    }
 #endif
@@ -2489,9 +2529,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
 #ifdef FEAT_CRYPT
 	    if (cryptkey != NULL)
 		msg_add_lines(c, (long)linecnt, filesize
-			- CRYPT_MAGIC_LEN
-			- crypt_salt_len[use_crypt_method]
-			- crypt_seed_len[use_crypt_method]);
+			 - crypt_get_header_len(crypt_get_method_nr(curbuf)));
 	    else
 #endif
 		msg_add_lines(c, (long)linecnt, filesize);
@@ -2881,33 +2919,6 @@ check_marks_read()
 #endif
 
 #if defined(FEAT_CRYPT) || defined(PROTO)
-/*
- * Get the crypt method used for a file from "ptr[len]", the magic text at the
- * start of the file.
- * Returns -1 when no encryption used.
- */
-    static int
-crypt_method_from_magic(ptr, len)
-    char  *ptr;
-    int   len;
-{
-    int i;
-
-    for (i = 0; i < (int)(sizeof(crypt_magic) / sizeof(crypt_magic[0])); i++)
-    {
-	if (len < (CRYPT_MAGIC_LEN + crypt_salt_len[i] + crypt_seed_len[i]))
-	    continue;
-	if (memcmp(ptr, crypt_magic[i], CRYPT_MAGIC_LEN) == 0)
-	    return i;
-    }
-
-    i = (int)STRLEN(crypt_magic_head);
-    if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
-	EMSG(_("E821: File is encrypted with unknown method"));
-
-    return -1;
-}
-
 /*
  * Check for magic number used for encryption.  Applies to the current buffer.
  * If found, the magic number is removed from ptr[*sizep] and *sizep and
@@ -2924,7 +2935,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
     char_u	*fname;		/* file name to display */
     int		*did_ask;	/* flag: whether already asked for key */
 {
-    int method = crypt_method_from_magic((char *)ptr, *sizep);
+    int method = crypt_method_nr_from_magic((char *)ptr, *sizep);
     int b_p_ro = curbuf->b_p_ro;
 
     if (method >= 0)
@@ -2933,9 +2944,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 	 * Avoids accidentally overwriting the file with garbage. */
 	curbuf->b_p_ro = TRUE;
 
-	set_crypt_method(curbuf, method);
-	if (method > 0)
-	    (void)blowfish_self_test();
+	crypt_set_cm_option(curbuf, method);
 	if (cryptkey == NULL && !*did_ask)
 	{
 	    if (*curbuf->b_p_key)
@@ -2948,7 +2957,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 		 * Happens when retrying to detect encoding. */
 		smsg((char_u *)_(need_key_msg), fname);
 		msg_scroll = TRUE;
-		cryptkey = get_crypt_key(newfile, FALSE);
+		cryptkey = crypt_get_key(newfile, FALSE);
 		*did_ask = TRUE;
 
 		/* check if empty key entered */
@@ -2963,24 +2972,18 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 
 	if (cryptkey != NULL)
 	{
-	    int seed_len = crypt_seed_len[method];
-	    int salt_len = crypt_salt_len[method];
+	    int header_len;
 
-	    crypt_push_state();
-	    use_crypt_method = method;
-	    if (method == 0)
-		crypt_init_keys(cryptkey);
-	    else
-	    {
-		bf_key_init(cryptkey, ptr + CRYPT_MAGIC_LEN, salt_len);
-		bf_cfb_init(ptr + CRYPT_MAGIC_LEN + salt_len, seed_len);
-	    }
+	    curbuf->b_cryptstate = crypt_create_from_header(
+						       method, cryptkey, ptr);
+	    crypt_set_cm_option(curbuf, method);
+
+	    /* Remove cryptmethod specific header from the text. */
+	    header_len = crypt_get_header_len(method);
+	    *filesizep += header_len;
+	    *sizep -= header_len;
+	    mch_memmove(ptr, ptr + header_len, (size_t)*sizep);
 
-	    /* Remove magic number from the text */
-	    *filesizep += CRYPT_MAGIC_LEN + salt_len + seed_len;
-	    *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len;
-	    mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len,
-							      (size_t)*sizep);
 	    /* Restore the read-only flag. */
 	    curbuf->b_p_ro = b_p_ro;
 	}
@@ -2992,85 +2995,6 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 
     return cryptkey;
 }
-
-/*
- * Check for magic number used for encryption.  Applies to the current buffer.
- * If found and decryption is possible returns OK;
- */
-    int
-prepare_crypt_read(fp)
-    FILE	*fp;
-{
-    int		method;
-    char_u	buffer[CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
-						    + CRYPT_SEED_LEN_MAX + 2];
-
-    if (fread(buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
-	return FAIL;
-    method = crypt_method_from_magic((char *)buffer,
-					CRYPT_MAGIC_LEN +
-					CRYPT_SEED_LEN_MAX +
-					CRYPT_SALT_LEN_MAX);
-    if (method < 0 || method != get_crypt_method(curbuf))
-	return FAIL;
-
-    crypt_push_state();
-    if (method == 0)
-	crypt_init_keys(curbuf->b_p_key);
-    else
-    {
-	int salt_len = crypt_salt_len[method];
-	int seed_len = crypt_seed_len[method];
-
-	if (fread(buffer, salt_len + seed_len, 1, fp) != 1)
-	    return FAIL;
-	bf_key_init(curbuf->b_p_key, buffer, salt_len);
-	bf_cfb_init(buffer + salt_len, seed_len);
-    }
-    return OK;
-}
-
-/*
- * Prepare for writing encrypted bytes for buffer "buf".
- * Returns a pointer to an allocated header of length "*lenp".
- * When out of memory returns NULL.
- * Otherwise calls crypt_push_state(), call crypt_pop_state() later.
- */
-    char_u *
-prepare_crypt_write(buf, lenp)
-    buf_T *buf;
-    int   *lenp;
-{
-    char_u  *header;
-    int	    seed_len = crypt_seed_len[get_crypt_method(buf)];
-    int     salt_len = crypt_salt_len[get_crypt_method(buf)];
-    char_u  *salt;
-    char_u  *seed;
-
-    header = alloc_clear(CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
-						    + CRYPT_SEED_LEN_MAX + 2);
-    if (header != NULL)
-    {
-	crypt_push_state();
-	use_crypt_method = get_crypt_method(buf);  /* select zip or blowfish */
-	vim_strncpy(header, (char_u *)crypt_magic[use_crypt_method],
-							     CRYPT_MAGIC_LEN);
-	if (use_crypt_method == 0)
-	    crypt_init_keys(buf->b_p_key);
-	else
-	{
-	    /* Using blowfish, add salt and seed. */
-	    salt = header + CRYPT_MAGIC_LEN;
-	    seed = salt + salt_len;
-	    sha2_seed(salt, salt_len, seed, seed_len);
-	    bf_key_init(buf->b_p_key, salt, salt_len);
-	    bf_cfb_init(seed, seed_len);
-	}
-    }
-    *lenp = CRYPT_MAGIC_LEN + salt_len + seed_len;
-    return header;
-}
-
 #endif  /* FEAT_CRYPT */
 
 #ifdef UNIX
@@ -3224,9 +3148,6 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
     int		    write_undo_file = FALSE;
     context_sha256_T sha_ctx;
 #endif
-#ifdef FEAT_CRYPT
-    int		    crypt_method_used;
-#endif
 
     if (fname == NULL || *fname == NUL)	/* safety check */
 	return FAIL;
@@ -3261,6 +3182,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 # ifdef USE_ICONV
     write_info.bw_iconv_fd = (iconv_t)-1;
 # endif
+#endif
+#ifdef FEAT_CRYPT
+    write_info.bw_buffer = buf;
 #endif
 
     /* After writing a file changedtick changes but we don't want to display
@@ -4505,17 +4429,17 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 #ifdef FEAT_CRYPT
     if (*buf->b_p_key != NUL && !filtering)
     {
-	char_u *header;
-	int    header_len;
+	char_u		*header;
+	int		header_len;
 
-	header = prepare_crypt_write(buf, &header_len);
-	if (header == NULL)
+	buf->b_cryptstate = crypt_create_for_writing(crypt_get_method_nr(buf),
+					  buf->b_p_key, &header, &header_len);
+	if (buf->b_cryptstate == NULL || header == NULL)
 	    end = 0;
 	else
 	{
-	    /* Write magic number, so that Vim knows that this file is
-	     * encrypted when reading it again.  This also undergoes utf-8 to
-	     * ucs-2/4 conversion when needed. */
+	    /* Write magic number, so that Vim knows how this file is
+	     * encrypted when reading it back. */
 	    write_info.bw_buf = header;
 	    write_info.bw_len = header_len;
 	    write_info.bw_flags = FIO_NOCONVERT;
@@ -4769,12 +4693,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	mch_set_acl(wfname, acl);
 #endif
 #ifdef FEAT_CRYPT
-    crypt_method_used = use_crypt_method;
-    if (wb_flags & FIO_ENCRYPTED)
-	crypt_pop_state();
+    if (buf->b_cryptstate != NULL)
+    {
+	crypt_free_state(buf->b_cryptstate);
+	buf->b_cryptstate = NULL;
+    }
 #endif
 
-
 #if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
     if (wfname != fname)
     {
@@ -4924,10 +4849,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 #ifdef FEAT_CRYPT
 	if (wb_flags & FIO_ENCRYPTED)
 	{
-	    if (crypt_method_used == 1)
-		STRCAT(IObuff, _("[blowfish]"));
-	    else
-		STRCAT(IObuff, _("[crypted]"));
+	    crypt_append_msg(buf);
 	    c = TRUE;
 	}
 #endif
@@ -5740,8 +5662,26 @@ buf_write_bytes(ip)
 #endif /* FEAT_MBYTE */
 
 #ifdef FEAT_CRYPT
-    if (flags & FIO_ENCRYPTED)		/* encrypt the data */
-	crypt_encode(buf, len, buf);
+    if (flags & FIO_ENCRYPTED)
+    {
+	/* Encrypt the data. Do it in-place if possible, otherwise use an
+	 * allocated buffer. */
+	if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
+	{
+	    crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len);
+	}
+	else
+	{
+	    char_u *outbuf;
+
+	    len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf);
+	    if (len == 0)
+		return OK;  /* Crypt layer is buffering, will flush later. */
+	    wlen = write_eintr(ip->bw_fd, outbuf, len);
+	    vim_free(outbuf);
+	    return (wlen < len) ? FAIL : OK;
+	}
+    }
 #endif
 
     wlen = write_eintr(ip->bw_fd, buf, len);
diff --git a/src/globals.h b/src/globals.h
index ce831f33d9..d1fdc33acc 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -105,10 +105,6 @@ EXTERN int	exec_from_reg INIT(= FALSE);	/* executing register */
 
 EXTERN int	screen_cleared INIT(= FALSE);	/* screen has been cleared */
 
-#ifdef FEAT_CRYPT
-EXTERN int      use_crypt_method INIT(= 0);
-#endif
-
 /*
  * When '$' is included in 'cpoptions' option set:
  * When a change command is given that deletes only part of a line, a dollar
diff --git a/src/main.c b/src/main.c
index 9c92f7a844..2fb2edcb59 100644
--- a/src/main.c
+++ b/src/main.c
@@ -846,8 +846,7 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
 #ifdef FEAT_CRYPT
     if (params.ask_for_key)
     {
-	(void)blowfish_self_test();
-	(void)get_crypt_key(TRUE, TRUE);
+	(void)crypt_get_key(TRUE, TRUE);
 	TIME_MSG("getting crypt key");
     }
 #endif
diff --git a/src/memline.c b/src/memline.c
index fb438d273e..a5053f0233 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -63,6 +63,15 @@ typedef struct pointer_entry	PTR_EN;	    /* block/line-count pair */
 #define BLOCK0_ID1     '0'		    /* block 0 id 1 */
 #define BLOCK0_ID1_C0  'c'		    /* block 0 id 1 'cm' 0 */
 #define BLOCK0_ID1_C1  'C'		    /* block 0 id 1 'cm' 1 */
+#define BLOCK0_ID1_C2  'd'		    /* block 0 id 1 'cm' 2 */
+
+#if defined(FEAT_CRYPT)
+static int id1_codes[] = {
+    BLOCK0_ID1_C0,  /* CRYPT_M_ZIP */
+    BLOCK0_ID1_C1,  /* CRYPT_M_BF */
+    BLOCK0_ID1_C2,  /* CRYPT_M_BF2 */
+};
+#endif
 
 /*
  * pointer to a block, used in a pointer block
@@ -151,7 +160,7 @@ struct data_block
 struct block0
 {
     char_u	b0_id[2];	/* id for block 0: BLOCK0_ID0 and BLOCK0_ID1,
-				 * BLOCK0_ID1_C0, BLOCK0_ID1_C1 */
+				 * BLOCK0_ID1_C0, BLOCK0_ID1_C1, etc. */
     char_u	b0_version[10];	/* Vim version string */
     char_u	b0_page_size[4];/* number of bytes per page */
     char_u	b0_mtime[4];	/* last modification time of file */
@@ -256,7 +265,7 @@ static long char_to_long __ARGS((char_u *));
 static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name));
 #endif
 #ifdef FEAT_CRYPT
-static void ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading));
+static cryptstate_T *ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading));
 #endif
 #ifdef FEAT_BYTEOFF
 static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype));
@@ -359,8 +368,7 @@ ml_open(buf)
 	b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL;
 	long_to_char(mch_get_pid(), b0p->b0_pid);
 #ifdef FEAT_CRYPT
-	if (*buf->b_p_key != NUL)
-	    ml_set_b0_crypt(buf, b0p);
+	ml_set_b0_crypt(buf, b0p);
 #endif
     }
 
@@ -436,11 +444,11 @@ ml_set_b0_crypt(buf, b0p)
 	b0p->b0_id[1] = BLOCK0_ID1;
     else
     {
-	if (get_crypt_method(buf) == 0)
-	    b0p->b0_id[1] = BLOCK0_ID1_C0;
-	else
+	int method_nr = crypt_get_method_nr(buf);
+
+	b0p->b0_id[1] = id1_codes[method_nr];
+	if (method_nr > CRYPT_M_ZIP)
 	{
-	    b0p->b0_id[1] = BLOCK0_ID1_C1;
 	    /* Generate a seed and store it in block 0 and in the memfile. */
 	    sha2_seed(&b0p->b0_seed, MF_SEED_LEN, NULL, 0);
 	    mch_memmove(buf->b_ml.ml_mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN);
@@ -887,7 +895,8 @@ ml_check_b0_id(b0p)
     if (b0p->b0_id[0] != BLOCK0_ID0
 	    || (b0p->b0_id[1] != BLOCK0_ID1
 		&& b0p->b0_id[1] != BLOCK0_ID1_C0
-		&& b0p->b0_id[1] != BLOCK0_ID1_C1)
+		&& b0p->b0_id[1] != BLOCK0_ID1_C1
+		&& b0p->b0_id[1] != BLOCK0_ID1_C2)
 	    )
 	return FAIL;
     return OK;
@@ -1255,14 +1264,12 @@ ml_recover()
     }
 
 #ifdef FEAT_CRYPT
-    if (b0p->b0_id[1] == BLOCK0_ID1_C0)
-	b0_cm = 0;
-    else if (b0p->b0_id[1] == BLOCK0_ID1_C1)
-    {
-	b0_cm = 1;
+    for (i = 0; i < (int)(sizeof(id1_codes) / sizeof(int)); ++i)
+	if (id1_codes[i] == b0p->b0_id[1])
+	    b0_cm = i;
+    if (b0_cm > 0)
 	mch_memmove(mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN);
-    }
-    set_crypt_method(buf, b0_cm);
+    crypt_set_cm_option(buf, b0_cm < 0 ? 0 : b0_cm);
 #else
     if (b0p->b0_id[1] != BLOCK0_ID1)
     {
@@ -1389,7 +1396,7 @@ ml_recover()
 	}
 	else
 	    smsg((char_u *)_(need_key_msg), fname_used);
-	buf->b_p_key = get_crypt_key(FALSE, FALSE);
+	buf->b_p_key = crypt_get_key(FALSE, FALSE);
 	if (buf->b_p_key == NULL)
 	    buf->b_p_key = curbuf->b_p_key;
 	else if (*buf->b_p_key == NUL)
@@ -4816,6 +4823,7 @@ ml_encrypt_data(mfp, data, offset, size)
     char_u	*text_start;
     char_u	*new_data;
     int		text_len;
+    cryptstate_T *state;
 
     if (dp->db_id != DATA_ID)
 	return data;
@@ -4831,10 +4839,9 @@ ml_encrypt_data(mfp, data, offset, size)
     mch_memmove(new_data, dp, head_end - (char_u *)dp);
 
     /* Encrypt the text. */
-    crypt_push_state();
-    ml_crypt_prepare(mfp, offset, FALSE);
-    crypt_encode(text_start, text_len, new_data + dp->db_txt_start);
-    crypt_pop_state();
+    state = ml_crypt_prepare(mfp, offset, FALSE);
+    crypt_encode(state, text_start, text_len, new_data + dp->db_txt_start);
+    crypt_free_state(state);
 
     /* Clear the gap. */
     if (head_end < text_start)
@@ -4857,6 +4864,7 @@ ml_decrypt_data(mfp, data, offset, size)
     char_u	*head_end;
     char_u	*text_start;
     int		text_len;
+    cryptstate_T *state;
 
     if (dp->db_id == DATA_ID)
     {
@@ -4869,17 +4877,17 @@ ml_decrypt_data(mfp, data, offset, size)
 	    return;  /* data was messed up */
 
 	/* Decrypt the text in place. */
-	crypt_push_state();
-	ml_crypt_prepare(mfp, offset, TRUE);
-	crypt_decode(text_start, text_len);
-	crypt_pop_state();
+	state = ml_crypt_prepare(mfp, offset, TRUE);
+	crypt_decode_inplace(state, text_start, text_len);
+	crypt_free_state(state);
     }
 }
 
 /*
  * Prepare for encryption/decryption, using the key, seed and offset.
+ * Return an allocated cryptstate_T *.
  */
-    static void
+    static cryptstate_T *
 ml_crypt_prepare(mfp, offset, reading)
     memfile_T	*mfp;
     off_t	offset;
@@ -4887,38 +4895,37 @@ ml_crypt_prepare(mfp, offset, reading)
 {
     buf_T	*buf = mfp->mf_buffer;
     char_u	salt[50];
-    int		method;
+    int		method_nr;
     char_u	*key;
     char_u	*seed;
 
     if (reading && mfp->mf_old_key != NULL)
     {
 	/* Reading back blocks with the previous key/method/seed. */
-	method = mfp->mf_old_cm;
+	method_nr = mfp->mf_old_cm;
 	key = mfp->mf_old_key;
 	seed = mfp->mf_old_seed;
     }
     else
     {
-	method = get_crypt_method(buf);
+	method_nr = crypt_get_method_nr(buf);
 	key = buf->b_p_key;
 	seed = mfp->mf_seed;
     }
 
-    use_crypt_method = method;  /* select pkzip or blowfish */
-    if (method == 0)
+    if (method_nr == CRYPT_M_ZIP)
     {
+	/* For PKzip: Append the offset to the key, so that we use a different
+	 * key for every block. */
 	vim_snprintf((char *)salt, sizeof(salt), "%s%ld", key, (long)offset);
-	crypt_init_keys(salt);
-    }
-    else
-    {
-	/* Using blowfish, add salt and seed. We use the byte offset of the
-	 * block for the salt. */
-	vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset);
-	bf_key_init(key, salt, (int)STRLEN(salt));
-	bf_cfb_init(seed, MF_SEED_LEN);
+	return crypt_create(method_nr, salt, NULL, 0, NULL, 0);
     }
+
+    /* Using blowfish or better: add salt and seed. We use the byte offset
+     * of the block for the salt. */
+    vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset);
+    return crypt_create(method_nr, key, salt, (int)STRLEN(salt),
+							   seed, MF_SEED_LEN);
 }
 
 #endif
diff --git a/src/misc2.c b/src/misc2.c
index 1a5b370ba8..1f8878f674 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3803,322 +3803,6 @@ update_mouseshape(shape_idx)
 #endif /* CURSOR_SHAPE */
 
 
-#ifdef FEAT_CRYPT
-/*
- * Optional encryption support.
- * Mohsin Ahmed, mosh@sasi.com, 98-09-24
- * Based on zip/crypt sources.
- *
- * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
- * most countries.  There are a few exceptions, but that still should not be a
- * problem since this code was originally created in Europe and India.
- *
- * Blowfish addition originally made by Mohsin Ahmed,
- * http://www.cs.albany.edu/~mosh 2010-03-14
- * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html)
- * and sha256 by Christophe Devine.
- */
-
-/* from zip.h */
-
-typedef unsigned short ush;	/* unsigned 16-bit value */
-typedef unsigned long  ulg;	/* unsigned 32-bit value */
-
-static void make_crc_tab __ARGS((void));
-
-static ulg crc_32_tab[256];
-
-/*
- * Fill the CRC table.
- */
-    static void
-make_crc_tab()
-{
-    ulg		s,t,v;
-    static int	done = FALSE;
-
-    if (done)
-	return;
-    for (t = 0; t < 256; t++)
-    {
-	v = t;
-	for (s = 0; s < 8; s++)
-	    v = (v >> 1) ^ ((v & 1) * (ulg)0xedb88320L);
-	crc_32_tab[t] = v;
-    }
-    done = TRUE;
-}
-
-#define CRC32(c, b) (crc_32_tab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
-
-static ulg keys[3]; /* keys defining the pseudo-random sequence */
-
-/*
- * Return the next byte in the pseudo-random sequence.
- */
-#define DECRYPT_BYTE_ZIP(t) { \
-    ush temp; \
- \
-    temp = (ush)keys[2] | 2; \
-    t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
-}
-
-/*
- * Update the encryption keys with the next byte of plain text.
- */
-#define UPDATE_KEYS_ZIP(c) { \
-    keys[0] = CRC32(keys[0], (c)); \
-    keys[1] += keys[0] & 0xff; \
-    keys[1] = keys[1] * 134775813L + 1; \
-    keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
-}
-
-static int crypt_busy = 0;
-static ulg saved_keys[3];
-static int saved_crypt_method;
-
-/*
- * Return int value for crypt method string:
- * 0 for "zip", the old method.  Also for any non-valid value.
- * 1 for "blowfish".
- */
-    int
-crypt_method_from_string(s)
-    char_u  *s;
-{
-    return *s == 'b' ? 1 : 0;
-}
-
-/*
- * Get the crypt method for buffer "buf" as a number.
- */
-    int
-get_crypt_method(buf)
-    buf_T *buf;
-{
-    return crypt_method_from_string(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
-}
-
-/*
- * Set the crypt method for buffer "buf" to "method" using the int value as
- * returned by crypt_method_from_string().
- */
-    void
-set_crypt_method(buf, method)
-    buf_T   *buf;
-    int	    method;
-{
-    free_string_option(buf->b_p_cm);
-    buf->b_p_cm = vim_strsave((char_u *)(method == 0 ? "zip" : "blowfish"));
-}
-
-/*
- * Prepare for initializing encryption.  If already doing encryption then save
- * the state.
- * Must always be called symmetrically with crypt_pop_state().
- */
-    void
-crypt_push_state()
-{
-    if (crypt_busy == 1)
-    {
-	/* save the state */
-	if (use_crypt_method == 0)
-	{
-	    saved_keys[0] = keys[0];
-	    saved_keys[1] = keys[1];
-	    saved_keys[2] = keys[2];
-	}
-	else
-	    bf_crypt_save();
-	saved_crypt_method = use_crypt_method;
-    }
-    else if (crypt_busy > 1)
-	EMSG2(_(e_intern2), "crypt_push_state()");
-    ++crypt_busy;
-}
-
-/*
- * End encryption.  If doing encryption before crypt_push_state() then restore
- * the saved state.
- * Must always be called symmetrically with crypt_push_state().
- */
-    void
-crypt_pop_state()
-{
-    --crypt_busy;
-    if (crypt_busy == 1)
-    {
-	use_crypt_method = saved_crypt_method;
-	if (use_crypt_method == 0)
-	{
-	    keys[0] = saved_keys[0];
-	    keys[1] = saved_keys[1];
-	    keys[2] = saved_keys[2];
-	}
-	else
-	    bf_crypt_restore();
-    }
-}
-
-/*
- * Encrypt "from[len]" into "to[len]".
- * "from" and "to" can be equal to encrypt in place.
- */
-    void
-crypt_encode(from, len, to)
-    char_u	*from;
-    size_t	len;
-    char_u	*to;
-{
-    size_t	i;
-    int		ztemp, t;
-
-    if (use_crypt_method == 0)
-	for (i = 0; i < len; ++i)
-	{
-	    ztemp = from[i];
-	    DECRYPT_BYTE_ZIP(t);
-	    UPDATE_KEYS_ZIP(ztemp);
-	    to[i] = t ^ ztemp;
-	}
-    else
-	bf_crypt_encode(from, len, to);
-}
-
-/*
- * Decrypt "ptr[len]" in place.
- */
-    void
-crypt_decode(ptr, len)
-    char_u	*ptr;
-    long	len;
-{
-    char_u *p;
-
-    if (use_crypt_method == 0)
-	for (p = ptr; p < ptr + len; ++p)
-	{
-	    ush temp;
-
-	    temp = (ush)keys[2] | 2;
-	    temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
-	    UPDATE_KEYS_ZIP(*p ^= temp);
-	}
-    else
-	bf_crypt_decode(ptr, len);
-}
-
-/*
- * Initialize the encryption keys and the random header according to
- * the given password.
- * If "passwd" is NULL or empty, don't do anything.
- */
-    void
-crypt_init_keys(passwd)
-    char_u *passwd;		/* password string with which to modify keys */
-{
-    if (passwd != NULL && *passwd != NUL)
-    {
-	if (use_crypt_method == 0)
-	{
-	    char_u *p;
-
-	    make_crc_tab();
-	    keys[0] = 305419896L;
-	    keys[1] = 591751049L;
-	    keys[2] = 878082192L;
-	    for (p = passwd; *p!= NUL; ++p)
-	    {
-		UPDATE_KEYS_ZIP((int)*p);
-	    }
-	}
-	else
-	    bf_crypt_init_keys(passwd);
-    }
-}
-
-/*
- * Free an allocated crypt key.  Clear the text to make sure it doesn't stay
- * in memory anywhere.
- */
-    void
-free_crypt_key(key)
-    char_u *key;
-{
-    char_u *p;
-
-    if (key != NULL)
-    {
-	for (p = key; *p != NUL; ++p)
-	    *p = 0;
-	vim_free(key);
-    }
-}
-
-/*
- * Ask the user for a crypt key.
- * When "store" is TRUE, the new key is stored in the 'key' option, and the
- * 'key' option value is returned: Don't free it.
- * When "store" is FALSE, the typed key is returned in allocated memory.
- * Returns NULL on failure.
- */
-    char_u *
-get_crypt_key(store, twice)
-    int		store;
-    int		twice;	    /* Ask for the key twice. */
-{
-    char_u	*p1, *p2 = NULL;
-    int		round;
-
-    for (round = 0; ; ++round)
-    {
-	cmdline_star = TRUE;
-	cmdline_row = msg_row;
-	p1 = getcmdline_prompt(NUL, round == 0
-		? (char_u *)_("Enter encryption key: ")
-		: (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING,
-		NULL);
-	cmdline_star = FALSE;
-
-	if (p1 == NULL)
-	    break;
-
-	if (round == twice)
-	{
-	    if (p2 != NULL && STRCMP(p1, p2) != 0)
-	    {
-		MSG(_("Keys don't match!"));
-		free_crypt_key(p1);
-		free_crypt_key(p2);
-		p2 = NULL;
-		round = -1;		/* do it again */
-		continue;
-	    }
-
-	    if (store)
-	    {
-		set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
-		free_crypt_key(p1);
-		p1 = curbuf->b_p_key;
-	    }
-	    break;
-	}
-	p2 = p1;
-    }
-
-    /* since the user typed this, no need to wait for return */
-    if (msg_didout)
-	msg_putchar('\n');
-    need_wait_return = FALSE;
-    msg_didout = FALSE;
-
-    free_crypt_key(p2);
-    return p1;
-}
-
-#endif /* FEAT_CRYPT */
-
 /* TODO: make some #ifdef for this */
 /*--------[ file searching ]-------------------------------------------------*/
 /*
@@ -6587,9 +6271,24 @@ put_bytes(fd, nr, len)
 put_time(fd, the_time)
     FILE	*fd;
     time_t	the_time;
+{
+    char_u	buf[8];
+
+    time_to_bytes(the_time, buf);
+    fwrite(buf, (size_t)8, (size_t)1, fd);
+}
+
+/*
+ * Write time_t to "buf[8]".
+ */
+    void
+time_to_bytes(the_time, buf)
+    time_t	the_time;
+    char_u	*buf;
 {
     int		c;
     int		i;
+    int		bi = 0;
     time_t	wtime = the_time;
 
     /* time_t can be up to 8 bytes in size, more than long_u, thus we
@@ -6603,7 +6302,7 @@ put_time(fd, the_time)
     {
 	if (i + 1 > (int)sizeof(time_t))
 	    /* ">>" doesn't work well when shifting more bits than avail */
-	    putc(0, fd);
+	    buf[bi++] = 0;
 	else
 	{
 #if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4
@@ -6611,7 +6310,7 @@ put_time(fd, the_time)
 #else
 	    c = (int)((long_u)wtime >> (i * 8));
 #endif
-	    putc(c, fd);
+	    buf[bi++] = c;
 	}
     }
 }
diff --git a/src/option.c b/src/option.c
index 3e6164e5a6..62556b69c9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2989,7 +2989,7 @@ static char *(p_bg_values[]) = {"light", "dark", NULL};
 static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL};
 static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL};
 #ifdef FEAT_CRYPT
-static char *(p_cm_values[]) = {"zip", "blowfish", NULL};
+static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL};
 #endif
 #ifdef FEAT_CMDL_COMPL
 static char *(p_wop_values[]) = {"tagfile", NULL};
@@ -6140,7 +6140,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 # endif
 	if (STRCMP(curbuf->b_p_key, oldval) != 0)
 	    /* Need to update the swapfile. */
-	    ml_set_crypt_key(curbuf, oldval, get_crypt_method(curbuf));
+	    ml_set_crypt_key(curbuf, oldval, crypt_get_method_nr(curbuf));
     }
 
     else if (gvarp == &p_cm)
@@ -6151,7 +6151,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 	    p = p_cm;
 	if (check_opt_strings(p, p_cm_values, TRUE) != OK)
 	    errmsg = e_invarg;
-	else if (get_crypt_method(curbuf) > 0 && blowfish_self_test() == FAIL)
+	else if (crypt_self_test() == FAIL)
 	    errmsg = e_invarg;
 	else
 	{
@@ -6177,7 +6177,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 		p = curbuf->b_p_cm;
 	    if (STRCMP(s, p) != 0)
 		ml_set_crypt_key(curbuf, curbuf->b_p_key,
-						 crypt_method_from_string(s));
+						crypt_method_nr_from_name(s));
 
 	    /* If the global value changes need to update the swapfile for all
 	     * buffers using that value. */
@@ -6188,7 +6188,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 		for (buf = firstbuf; buf != NULL; buf = buf->b_next)
 		    if (buf != curbuf && *buf->b_p_cm == NUL)
 			ml_set_crypt_key(buf, buf->b_p_key,
-					    crypt_method_from_string(oldval));
+					   crypt_method_nr_from_name(oldval));
 	    }
 	}
     }
diff --git a/src/proto.h b/src/proto.h
index 191ecd8fdd..2b08eb38ff 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -70,6 +70,8 @@ extern int _stricoll __ARGS((char *a, char *b));
 
 # ifdef FEAT_CRYPT
 #  include "blowfish.pro"
+#  include "crypt.pro"
+#  include "crypt_zip.pro"
 # endif
 # include "buffer.pro"
 # include "charset.pro"
diff --git a/src/proto/blowfish.pro b/src/proto/blowfish.pro
index 4d64e10e80..66d029cd89 100644
--- a/src/proto/blowfish.pro
+++ b/src/proto/blowfish.pro
@@ -1,10 +1,6 @@
 /* blowfish.c */
-void bf_key_init __ARGS((char_u *password, char_u *salt, int salt_len));
-void bf_cfb_init __ARGS((char_u *iv, int iv_len));
-void bf_crypt_encode __ARGS((char_u *from, size_t len, char_u *to));
-void bf_crypt_decode __ARGS((char_u *ptr, long len));
-void bf_crypt_init_keys __ARGS((char_u *passwd));
-void bf_crypt_save __ARGS((void));
-void bf_crypt_restore __ARGS((void));
+void crypt_blowfish_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_blowfish_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_blowfish_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
 int blowfish_self_test __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/proto/crypt.pro b/src/proto/crypt.pro
new file mode 100644
index 0000000000..d61df718bd
--- /dev/null
+++ b/src/proto/crypt.pro
@@ -0,0 +1,24 @@
+/* crypt.c */
+int crypt_method_nr_from_name __ARGS((char_u *name));
+int crypt_method_nr_from_magic __ARGS((char *ptr, int len));
+int crypt_works_inplace __ARGS((cryptstate_T *state));
+int crypt_get_method_nr __ARGS((buf_T *buf));
+int crypt_whole_undofile __ARGS((int method_nr));
+int crypt_get_header_len __ARGS((int method_nr));
+void crypt_set_cm_option __ARGS((buf_T *buf, int method_nr));
+int crypt_self_test __ARGS((void));
+cryptstate_T *crypt_create __ARGS((int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
+cryptstate_T *crypt_create_from_header __ARGS((int method_nr, char_u *key, char_u *header));
+cryptstate_T *crypt_create_from_file __ARGS((FILE *fp, char_u *key));
+cryptstate_T *crypt_create_for_writing __ARGS((int method_nr, char_u *key, char_u **header, int *header_len));
+void crypt_free_state __ARGS((cryptstate_T *state));
+long crypt_encode_alloc __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u **newptr));
+long crypt_decode_alloc __ARGS((cryptstate_T *state, char_u *ptr, long len, char_u **newptr));
+void crypt_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_encode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
+void crypt_decode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
+void crypt_free_key __ARGS((char_u *key));
+char_u *crypt_get_key __ARGS((int store, int twice));
+void crypt_append_msg __ARGS((buf_T *buf));
+/* vim: set ft=c : */
diff --git a/src/proto/crypt_zip.pro b/src/proto/crypt_zip.pro
new file mode 100644
index 0000000000..5f4e137713
--- /dev/null
+++ b/src/proto/crypt_zip.pro
@@ -0,0 +1,5 @@
+/* crypt_zip.c */
+void crypt_zip_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len));
+void crypt_zip_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+void crypt_zip_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to));
+/* vim: set ft=c : */
diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro
index 7aa99cfa8a..0d532f4ce2 100644
--- a/src/proto/fileio.pro
+++ b/src/proto/fileio.pro
@@ -4,8 +4,6 @@ int readfile __ARGS((char_u *fname, char_u *sfname, linenr_T from, linenr_T line
 int prep_exarg __ARGS((exarg_T *eap, buf_T *buf));
 void set_file_options __ARGS((int set_options, exarg_T *eap));
 void set_forced_fenc __ARGS((exarg_T *eap));
-int prepare_crypt_read __ARGS((FILE *fp));
-char_u *prepare_crypt_write __ARGS((buf_T *buf, int *lenp));
 int check_file_readonly __ARGS((char_u *fname, int perm));
 int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering));
 void msg_add_fname __ARGS((buf_T *buf, char_u *fname));
diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro
index 4fd457382f..b2f72d8645 100644
--- a/src/proto/misc2.pro
+++ b/src/proto/misc2.pro
@@ -84,16 +84,6 @@ int illegal_slash __ARGS((char *name));
 char_u *parse_shape_opt __ARGS((int what));
 int get_shape_idx __ARGS((int mouse));
 void update_mouseshape __ARGS((int shape_idx));
-int crypt_method_from_string __ARGS((char_u *s));
-int get_crypt_method __ARGS((buf_T *buf));
-void set_crypt_method __ARGS((buf_T *buf, int method));
-void crypt_push_state __ARGS((void));
-void crypt_pop_state __ARGS((void));
-void crypt_encode __ARGS((char_u *from, size_t len, char_u *to));
-void crypt_decode __ARGS((char_u *ptr, long len));
-void crypt_init_keys __ARGS((char_u *passwd));
-void free_crypt_key __ARGS((char_u *key));
-char_u *get_crypt_key __ARGS((int store, int twice));
 void *vim_findfile_init __ARGS((char_u *path, char_u *filename, char_u *stopdirs, int level, int free_visited, int find_what, void *search_ctx_arg, int tagfile, char_u *rel_fname));
 char_u *vim_findfile_stopdir __ARGS((char_u *buf));
 void vim_findfile_cleanup __ARGS((void *ctx));
@@ -116,5 +106,6 @@ time_t get8ctime __ARGS((FILE *fd));
 char_u *read_string __ARGS((FILE *fd, int cnt));
 int put_bytes __ARGS((FILE *fd, long_u nr, int len));
 void put_time __ARGS((FILE *fd, time_t the_time));
+void time_to_bytes __ARGS((time_t the_time, char_u *buf));
 int has_non_ascii __ARGS((char_u *s));
 /* vim: set ft=c : */
diff --git a/src/structs.h b/src/structs.h
index 1382380552..441fcaa1c4 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1251,6 +1251,24 @@ typedef struct {
 } syn_time_T;
 #endif
 
+#ifdef FEAT_CRYPT
+/*
+ * Structure to hold the type of encryption and the state of encryption or
+ * decryption.
+ */
+typedef struct {
+    int	    method_nr;
+    void    *method_state;  /* method-specific state information */
+} cryptstate_T;
+
+/* values for method_nr */
+# define CRYPT_M_ZIP	0
+# define CRYPT_M_BF	1
+# define CRYPT_M_BF2	2
+# define CRYPT_M_COUNT	3 /* number of crypt methods */
+#endif
+
+
 /*
  * These are items normally related to a buffer.  But when using ":ownsyntax"
  * a window may have its own instance.
@@ -1778,7 +1796,12 @@ struct file_buffer
     int		b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */
 #endif
 
-};
+#ifdef FEAT_CRYPT
+    cryptstate_T *b_cryptstate;	/* Encryption state while reading or writing
+				 * the file. NULL when not using encryption. */
+#endif
+
+}; /* file_buffer */
 
 
 #ifdef FEAT_DIFF
diff --git a/src/testdir/test71.in b/src/testdir/test71.in
index 155fd413bc..944b69dc52 100644
--- a/src/testdir/test71.in
+++ b/src/testdir/test71.in
@@ -13,6 +13,8 @@ STARTTEST
 :let cm0_bytes = getline('.', '.')
 :/^start of cm=blowfish bytes/+1
 :let cm1_bytes = getline('.', '.')
+:/^start of cm=blowfish2 bytes/+1
+:let cm2_bytes = getline('.', '.')
 :bwipe!
 :call append(0, text_lines)
 :$d
@@ -36,6 +38,18 @@ barfoo
 :e Xtestfile
 barfoo
 :let cm1_read_back = getline('.', '$')
+:set key=
+:set cryptmethod=blowfish2
+:" If the blowfish test fails 'cryptmethod' will be 'zip' now.
+:%s/^/\=&cryptmethod == 'blowfish2' ? "OK " : "blowfish test failed "/
+:X
+bar2foo
+bar2foo
+:w! Xtestfile
+:bwipe!
+:e Xtestfile
+bar2foo
+:let cm2_read_back = getline('.', '$')
 :bwipe!
 :set bin noeol key=
 :call append(0, cm0_bytes)
@@ -57,7 +71,20 @@ foofoo
 :set nobin
 :e Xtestfile
 barbar
+:let cm1_read_bin = getline('.', '$')
+:bwipe!
+:set bin noeol key=
+:call append(0, cm2_bytes)
+:$d
+:set fenc=latin1
+:w! Xtestfile
+:bwipe!
+:set nobin
+:e Xtestfile
+barburp
+:call append(0, cm1_read_bin)
 :call append(0, cm0_read_bin)
+:call append(0, cm2_read_back)
 :call append(0, cm1_read_back)
 :call append(0, cm0_read_back)
 :set key= fenc=latin1
diff --git a/src/testdir/test71.ok b/src/testdir/test71.ok
index 24652c4380..de1b0ab837 100644
--- a/src/testdir/test71.ok
+++ b/src/testdir/test71.ok
@@ -4,7 +4,12 @@ line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 OK 01234567890123456789012345678901234567
 OK line 2  foo bar blah
 OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+OK OK 01234567890123456789012345678901234567
+OK OK line 2  foo bar blah
+OK OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 1234567890
 a�bbccdde�ff
 asdfasdfasdf
 0001112223333
+abcdefghijklmnopqrstuvwxyz
+!@#$%^&*()_+=-`~
diff --git a/src/testdir/test71a.in b/src/testdir/test71a.in
index 85bd22cd01..e79a39895a 100644
--- a/src/testdir/test71a.in
+++ b/src/testdir/test71a.in
@@ -12,3 +12,7 @@ end of cm=zip bytes
 start of cm=blowfish bytes
 VimCrypt~02!k)��#�S��=���#�M��J�AͥM��!��������
�
 end of cm=blowfish bytes
+
+start of cm=blowfish2 bytes
+VimCrypt~03!�N�;���^C)�.��FS��6�[T˧�ؾ9�2Q��@�ߚ�Iv�.���`�$�%�
+end of cm=blowfish2 bytes
diff --git a/src/testdir/test72.in b/src/testdir/test72.in
index 3b3a6a4329..031edbf146 100644
--- a/src/testdir/test72.in
+++ b/src/testdir/test72.in
@@ -81,6 +81,7 @@ uu:w >>test.out
 :"
 :" With encryption, cryptmethod=blowfish
 :e! Xtestfile
+rubbish
 :set undofile cm=blowfish
 ggdGijan
 feb
@@ -104,6 +105,32 @@ u:.w >>test.out
 u:.w >>test.out
 u:.w >>test.out
 :"
+:" With encryption, cryptmethod=blowfish2
+:e! Xtestfile
+rubbish
+:set undofile cm=blowfish2
+ggdGijan
+feb
+mar
+apr
+jun:set ul=100
+kk0ifoo :set ul=100
+dd:set ul=100
+ibar :set ul=100
+:X
+foo2bar
+foo2bar
+:w!
+:bwipe!
+:e Xtestfile
+foo2bar
+:set key=
+/bar
+:.w >>test.out
+u:.w >>test.out
+u:.w >>test.out
+u:.w >>test.out
+:"
 :" Rename the undo file so that it gets cleaned up.
 :if has("vms")
 : call rename("_un_Xtestfile", "Xtestundo")
diff --git a/src/testdir/test72.ok b/src/testdir/test72.ok
index bb267d0d8b..8d30ba10b3 100644
--- a/src/testdir/test72.ok
+++ b/src/testdir/test72.ok
@@ -25,3 +25,7 @@ bar apr
 apr
 foo mar
 mar
+bar apr
+apr
+foo mar
+mar
diff --git a/src/undo.c b/src/undo.c
index 5db25f04e8..1661c8074b 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -81,8 +81,25 @@
 #define UH_MAGIC 0x18dade	/* value for uh_magic when in use */
 #define UE_MAGIC 0xabc123	/* value for ue_magic when in use */
 
+/* Size of buffer used for encryption. */
+#define CRYPT_BUF_SIZE 8192
+
 #include "vim.h"
 
+/* Structure passed around between functions.
+ * Avoids passing cryptstate_T when encryption not available. */
+typedef struct {
+    buf_T	*bi_buf;
+    FILE	*bi_fp;
+#ifdef FEAT_CRYPT
+    cryptstate_T *bi_state;
+    char_u	*bi_buffer; /* CRYPT_BUF_SIZE, NULL when not buffering */
+    size_t	bi_used;    /* bytes written to/read from bi_buffer */
+    size_t	bi_avail;   /* bytes available in bi_buffer */
+#endif
+} bufinfo_T;
+
+
 static long get_undolevel __ARGS((void));
 static void u_unch_branch __ARGS((u_header_T *uhp));
 static u_entry_T *u_get_headentry __ARGS((void));
@@ -98,18 +115,26 @@ static void u_freeentry __ARGS((u_entry_T *, long));
 #ifdef FEAT_PERSISTENT_UNDO
 static void corruption_error __ARGS((char *mesg, char_u *file_name));
 static void u_free_uhp __ARGS((u_header_T *uhp));
-static size_t fwrite_crypt __ARGS((buf_T *buf UNUSED, char_u *ptr, size_t len, FILE *fp));
-static char_u *read_string_decrypt __ARGS((buf_T *buf UNUSED, FILE *fd, int len));
-static int serialize_header __ARGS((FILE *fp, buf_T *buf, char_u *hash));
-static int serialize_uhp __ARGS((FILE *fp, buf_T *buf, u_header_T *uhp));
-static u_header_T *unserialize_uhp __ARGS((FILE *fp, char_u *file_name));
-static int serialize_uep __ARGS((FILE *fp, buf_T *buf, u_entry_T *uep));
-static u_entry_T *unserialize_uep __ARGS((FILE *fp, int *error, char_u *file_name));
-static void serialize_pos __ARGS((pos_T pos, FILE *fp));
-static void unserialize_pos __ARGS((pos_T *pos, FILE *fp));
-static void serialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp));
-static void unserialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp));
-static void put_header_ptr __ARGS((FILE	*fp, u_header_T *uhp));
+static int undo_write __ARGS((bufinfo_T *bi, char_u *ptr, size_t len));
+static int undo_flush __ARGS((bufinfo_T *bi));
+static int fwrite_crypt __ARGS((bufinfo_T *bi, char_u *ptr, size_t len));
+static int undo_write_bytes __ARGS((bufinfo_T *bi, long_u nr, int len));
+static void put_header_ptr __ARGS((bufinfo_T *bi, u_header_T *uhp));
+static int undo_read_4c __ARGS((bufinfo_T *bi));
+static int undo_read_2c __ARGS((bufinfo_T *bi));
+static int undo_read_byte __ARGS((bufinfo_T *bi));
+static time_t undo_read_time __ARGS((bufinfo_T *bi));
+static int undo_read __ARGS((bufinfo_T *bi, char_u *buffer, size_t size));
+static char_u *read_string_decrypt __ARGS((bufinfo_T *bi, int len));
+static int serialize_header __ARGS((bufinfo_T *bi, char_u *hash));
+static int serialize_uhp __ARGS((bufinfo_T *bi, u_header_T *uhp));
+static u_header_T *unserialize_uhp __ARGS((bufinfo_T *bi, char_u *file_name));
+static int serialize_uep __ARGS((bufinfo_T *bi, u_entry_T *uep));
+static u_entry_T *unserialize_uep __ARGS((bufinfo_T *bi, int *error, char_u *file_name));
+static void serialize_pos __ARGS((bufinfo_T *bi, pos_T pos));
+static void unserialize_pos __ARGS((bufinfo_T *bi, pos_T *pos));
+static void serialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info));
+static void unserialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info));
 #endif
 
 #define U_ALLOC_LINE(size) lalloc((long_u)(size), FALSE)
@@ -859,68 +884,294 @@ u_free_uhp(uhp)
 }
 
 /*
- * Like fwrite() but crypt the bytes when 'key' is set.
- * Returns 1 if successful.
+ * Write a sequence of bytes to the undo file.
+ * Buffers and encrypts as needed.
+ * Returns OK or FAIL.
  */
-    static size_t
-fwrite_crypt(buf, ptr, len, fp)
-    buf_T	*buf UNUSED;
+    static int
+undo_write(bi, ptr, len)
+    bufinfo_T	*bi;
+    char_u	*ptr;
+    size_t	len;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	size_t	len_todo = len;
+	char_u  *p = ptr;
+
+	while (bi->bi_used + len_todo >= CRYPT_BUF_SIZE)
+	{
+	    size_t	n = CRYPT_BUF_SIZE - bi->bi_used;
+
+	    mch_memmove(bi->bi_buffer + bi->bi_used, p, n);
+	    len_todo -= n;
+	    p += n;
+	    bi->bi_used = CRYPT_BUF_SIZE;
+	    if (undo_flush(bi) == FAIL)
+		return FAIL;
+	}
+	if (len_todo > 0)
+	{
+	    mch_memmove(bi->bi_buffer + bi->bi_used, p, len_todo);
+	    bi->bi_used += len_todo;
+	}
+	return OK;
+    }
+#endif
+    if (fwrite(ptr, len, (size_t)1, bi->bi_fp) != 1)
+	return FAIL;
+    return OK;
+}
+
+#ifdef FEAT_CRYPT
+    static int
+undo_flush(bi)
+    bufinfo_T	*bi;
+{
+    if (bi->bi_used > 0)
+    {
+	crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
+	if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
+	    return FAIL;
+	bi->bi_used = 0;
+    }
+    return OK;
+}
+#endif
+
+/*
+ * Write "ptr[len]" and crypt the bytes when needed.
+ * Returns OK or FAIL.
+ */
+    static int
+fwrite_crypt(bi, ptr, len)
+    bufinfo_T	*bi;
     char_u	*ptr;
     size_t	len;
-    FILE	*fp;
 {
 #ifdef FEAT_CRYPT
     char_u  *copy;
     char_u  small_buf[100];
     size_t  i;
 
-    if (*buf->b_p_key == NUL)
-	return fwrite(ptr, len, (size_t)1, fp);
-    if (len < 100)
-	copy = small_buf;  /* no malloc()/free() for short strings */
-    else
+    if (bi->bi_state != NULL && bi->bi_buffer == NULL)
     {
-	copy = lalloc(len, FALSE);
-	if (copy == NULL)
-	    return 0;
+	/* crypting every piece of text separately */
+	if (len < 100)
+	    copy = small_buf;  /* no malloc()/free() for short strings */
+	else
+	{
+	    copy = lalloc(len, FALSE);
+	    if (copy == NULL)
+		return 0;
+	}
+	crypt_encode(bi->bi_state, ptr, len, copy);
+	i = fwrite(copy, len, (size_t)1, bi->bi_fp);
+	if (copy != small_buf)
+	    vim_free(copy);
+	return i == 1 ? OK : FAIL;
     }
-    crypt_encode(ptr, len, copy);
-    i = fwrite(copy, len, (size_t)1, fp);
-    if (copy != small_buf)
-	vim_free(copy);
-    return i;
-#else
-    return fwrite(ptr, len, (size_t)1, fp);
 #endif
+    return undo_write(bi, ptr, len);
 }
 
 /*
- * Read a string of length "len" from "fd".
- * When 'key' is set decrypt the bytes.
+ * Write a number, MSB first, in "len" bytes.
+ * Must match with undo_read_?c() functions.
+ * Returns OK or FAIL.
  */
-    static char_u *
-read_string_decrypt(buf, fd, len)
-    buf_T   *buf UNUSED;
-    FILE    *fd;
+    static int
+undo_write_bytes(bi, nr, len)
+    bufinfo_T *bi;
+    long_u  nr;
     int	    len;
 {
-    char_u  *ptr;
+    char_u  buf[8];
+    int	    i;
+    int	    bufi = 0;
+
+    for (i = len - 1; i >= 0; --i)
+	buf[bufi++] = nr >> (i * 8);
+    return undo_write(bi, buf, (size_t)len);
+}
+
+/*
+ * Write the pointer to an undo header.  Instead of writing the pointer itself
+ * we use the sequence number of the header.  This is converted back to
+ * pointers when reading. */
+    static void
+put_header_ptr(bi, uhp)
+    bufinfo_T	*bi;
+    u_header_T	*uhp;
+{
+    undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4);
+}
+
+    static int
+undo_read_4c(bi)
+    bufinfo_T	*bi;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	char_u  buf[4];
+	int	n;
+
+	undo_read(bi, buf, (size_t)4);
+	n = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
+	return n;
+    }
+#endif
+    return get4c(bi->bi_fp);
+}
+
+    static int
+undo_read_2c(bi)
+    bufinfo_T	*bi;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	char_u  buf[2];
+	int	n;
+
+	undo_read(bi, buf, (size_t)2);
+	n = (buf[0] << 8) + buf[1];
+	return n;
+    }
+#endif
+    return get2c(bi->bi_fp);
+}
+
+    static int
+undo_read_byte(bi)
+    bufinfo_T	*bi;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	char_u  buf[1];
+
+	undo_read(bi, buf, (size_t)1);
+	return buf[0];
+    }
+#endif
+    return getc(bi->bi_fp);
+}
+
+    static time_t
+undo_read_time(bi)
+    bufinfo_T	*bi;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	char_u  buf[8];
+	time_t	n = 0;
+	int	i;
+
+	undo_read(bi, buf, (size_t)8);
+	for (i = 0; i < 8; ++i)
+	    n = (n << 8) + buf[i];
+	return n;
+    }
+#endif
+    return get8ctime(bi->bi_fp);
+}
+
+/*
+ * Read "buffer[size]" from the undo file.
+ * Return OK or FAIL.
+ */
+    static int
+undo_read(bi, buffer, size)
+    bufinfo_T   *bi;
+    char_u	*buffer;
+    size_t	size;
+{
+#ifdef FEAT_CRYPT
+    if (bi->bi_buffer != NULL)
+    {
+	int	size_todo = size;
+	char_u	*p = buffer;
+
+	while (size_todo > 0)
+	{
+	    size_t n;
+
+	    if (bi->bi_used >= bi->bi_avail)
+	    {
+		n = fread(bi->bi_buffer, 1, (size_t)CRYPT_BUF_SIZE, bi->bi_fp);
+		if (n <= 0)
+		{
+		    /* Error may be checked for only later.  Fill with zeros,
+		     * so that the reader won't use garbage. */
+		    vim_memset(p, 0, size_todo);
+		    return FAIL;
+		}
+		bi->bi_avail = n;
+		bi->bi_used = 0;
+		crypt_decode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_avail);
+	    }
+	    n = size_todo;
+	    if (n > bi->bi_avail - bi->bi_used)
+		n = bi->bi_avail - bi->bi_used;
+	    mch_memmove(p, bi->bi_buffer + bi->bi_used, n);
+	    bi->bi_used += n;
+	    size_todo -= n;
+	    p += n;
+	}
+	return OK;
+    }
+#endif
+    if (fread(buffer, (size_t)size, 1, bi->bi_fp) != 1)
+	return FAIL;
+    return OK;
+}
+
+/*
+ * Read a string of length "len" from "bi->bi_fd".
+ * "len" can be zero to allocate an empty line.
+ * Decrypt the bytes if needed.
+ * Append a NUL.
+ * Returns a pointer to allocated memory or NULL for failure.
+ */
+    static char_u *
+read_string_decrypt(bi, len)
+    bufinfo_T	*bi;
+    int		len;
+{
+    char_u  *ptr = alloc((unsigned)len + 1);
 
-    ptr = read_string(fd, len);
+    if (ptr != NULL)
+    {
+	if (len > 0 && undo_read(bi, ptr, len) == FAIL)
+	{
+	    vim_free(ptr);
+	    return NULL;
+	}
+	ptr[len] = NUL;
 #ifdef FEAT_CRYPT
-    if (ptr != NULL && *buf->b_p_key != NUL)
-	crypt_decode(ptr, len);
+	if (bi->bi_state != NULL && bi->bi_buffer == NULL)
+	    crypt_decode_inplace(bi->bi_state, ptr, len);
 #endif
+    }
     return ptr;
 }
 
+/*
+ * Writes the (not encrypted) header and initializes encryption if needed.
+ */
     static int
-serialize_header(fp, buf, hash)
-    FILE	*fp;
-    buf_T	*buf;
+serialize_header(bi, hash)
+    bufinfo_T	*bi;
     char_u	*hash;
 {
-    int len;
+    int		len;
+    buf_T	*buf = bi->bi_buf;
+    FILE	*fp = bi->bi_fp;
+    char_u	time_buf[8];
 
     /* Start writing, first the magic marker and undo info version. */
     if (fwrite(UF_START_MAGIC, (size_t)UF_START_MAGIC_LEN, (size_t)1, fp) != 1)
@@ -934,108 +1185,124 @@ serialize_header(fp, buf, hash)
 	char_u *header;
 	int    header_len;
 
-	put_bytes(fp, (long_u)UF_VERSION_CRYPT, 2);
-	header = prepare_crypt_write(buf, &header_len);
-	if (header == NULL)
+	undo_write_bytes(bi, (long_u)UF_VERSION_CRYPT, 2);
+	bi->bi_state = crypt_create_for_writing(crypt_get_method_nr(buf),
+					  buf->b_p_key, &header, &header_len);
+	if (bi->bi_state == NULL)
 	    return FAIL;
 	len = (int)fwrite(header, (size_t)header_len, (size_t)1, fp);
 	vim_free(header);
 	if (len != 1)
 	{
-	    crypt_pop_state();
+	    crypt_free_state(bi->bi_state);
+	    bi->bi_state = NULL;
 	    return FAIL;
 	}
+
+	if (crypt_whole_undofile(crypt_get_method_nr(buf)))
+	{
+	    bi->bi_buffer = alloc(CRYPT_BUF_SIZE);
+	    if (bi->bi_buffer == NULL)
+	    {
+		crypt_free_state(bi->bi_state);
+		bi->bi_state = NULL;
+		return FAIL;
+	    }
+	    bi->bi_used = 0;
+	}
     }
     else
 #endif
-	put_bytes(fp, (long_u)UF_VERSION, 2);
+	undo_write_bytes(bi, (long_u)UF_VERSION, 2);
 
 
     /* Write a hash of the buffer text, so that we can verify it is still the
      * same when reading the buffer text. */
-    if (fwrite(hash, (size_t)UNDO_HASH_SIZE, (size_t)1, fp) != 1)
+    if (undo_write(bi, hash, (size_t)UNDO_HASH_SIZE) == FAIL)
 	return FAIL;
 
     /* buffer-specific data */
-    put_bytes(fp, (long_u)buf->b_ml.ml_line_count, 4);
+    undo_write_bytes(bi, (long_u)buf->b_ml.ml_line_count, 4);
     len = buf->b_u_line_ptr != NULL ? (int)STRLEN(buf->b_u_line_ptr) : 0;
-    put_bytes(fp, (long_u)len, 4);
-    if (len > 0 && fwrite_crypt(buf, buf->b_u_line_ptr, (size_t)len, fp) != 1)
+    undo_write_bytes(bi, (long_u)len, 4);
+    if (len > 0 && fwrite_crypt(bi, buf->b_u_line_ptr, (size_t)len) == FAIL)
 	return FAIL;
-    put_bytes(fp, (long_u)buf->b_u_line_lnum, 4);
-    put_bytes(fp, (long_u)buf->b_u_line_colnr, 4);
+    undo_write_bytes(bi, (long_u)buf->b_u_line_lnum, 4);
+    undo_write_bytes(bi, (long_u)buf->b_u_line_colnr, 4);
 
     /* Undo structures header data */
-    put_header_ptr(fp, buf->b_u_oldhead);
-    put_header_ptr(fp, buf->b_u_newhead);
-    put_header_ptr(fp, buf->b_u_curhead);
+    put_header_ptr(bi, buf->b_u_oldhead);
+    put_header_ptr(bi, buf->b_u_newhead);
+    put_header_ptr(bi, buf->b_u_curhead);
 
-    put_bytes(fp, (long_u)buf->b_u_numhead, 4);
-    put_bytes(fp, (long_u)buf->b_u_seq_last, 4);
-    put_bytes(fp, (long_u)buf->b_u_seq_cur, 4);
-    put_time(fp, buf->b_u_time_cur);
+    undo_write_bytes(bi, (long_u)buf->b_u_numhead, 4);
+    undo_write_bytes(bi, (long_u)buf->b_u_seq_last, 4);
+    undo_write_bytes(bi, (long_u)buf->b_u_seq_cur, 4);
+    time_to_bytes(buf->b_u_time_cur, time_buf);
+    undo_write(bi, time_buf, 8);
 
     /* Optional fields. */
-    putc(4, fp);
-    putc(UF_LAST_SAVE_NR, fp);
-    put_bytes(fp, (long_u)buf->b_u_save_nr_last, 4);
+    undo_write_bytes(bi, 4, 1);
+    undo_write_bytes(bi, UF_LAST_SAVE_NR, 1);
+    undo_write_bytes(bi, (long_u)buf->b_u_save_nr_last, 4);
 
-    putc(0, fp);  /* end marker */
+    undo_write_bytes(bi, 0, 1);  /* end marker */
 
     return OK;
 }
 
     static int
-serialize_uhp(fp, buf, uhp)
-    FILE	*fp;
-    buf_T	*buf;
+serialize_uhp(bi, uhp)
+    bufinfo_T	*bi;
     u_header_T	*uhp;
 {
     int		i;
     u_entry_T	*uep;
+    char_u	time_buf[8];
 
-    if (put_bytes(fp, (long_u)UF_HEADER_MAGIC, 2) == FAIL)
+    if (undo_write_bytes(bi, (long_u)UF_HEADER_MAGIC, 2) == FAIL)
 	return FAIL;
 
-    put_header_ptr(fp, uhp->uh_next.ptr);
-    put_header_ptr(fp, uhp->uh_prev.ptr);
-    put_header_ptr(fp, uhp->uh_alt_next.ptr);
-    put_header_ptr(fp, uhp->uh_alt_prev.ptr);
-    put_bytes(fp, uhp->uh_seq, 4);
-    serialize_pos(uhp->uh_cursor, fp);
+    put_header_ptr(bi, uhp->uh_next.ptr);
+    put_header_ptr(bi, uhp->uh_prev.ptr);
+    put_header_ptr(bi, uhp->uh_alt_next.ptr);
+    put_header_ptr(bi, uhp->uh_alt_prev.ptr);
+    undo_write_bytes(bi, uhp->uh_seq, 4);
+    serialize_pos(bi, uhp->uh_cursor);
 #ifdef FEAT_VIRTUALEDIT
-    put_bytes(fp, (long_u)uhp->uh_cursor_vcol, 4);
+    undo_write_bytes(bi, (long_u)uhp->uh_cursor_vcol, 4);
 #else
-    put_bytes(fp, (long_u)0, 4);
+    undo_write_bytes(bi, (long_u)0, 4);
 #endif
-    put_bytes(fp, (long_u)uhp->uh_flags, 2);
+    undo_write_bytes(bi, (long_u)uhp->uh_flags, 2);
     /* Assume NMARKS will stay the same. */
     for (i = 0; i < NMARKS; ++i)
-	serialize_pos(uhp->uh_namedm[i], fp);
-    serialize_visualinfo(&uhp->uh_visual, fp);
-    put_time(fp, uhp->uh_time);
+	serialize_pos(bi, uhp->uh_namedm[i]);
+    serialize_visualinfo(bi, &uhp->uh_visual);
+    time_to_bytes(uhp->uh_time, time_buf);
+    undo_write(bi, time_buf, 8);
 
     /* Optional fields. */
-    putc(4, fp);
-    putc(UHP_SAVE_NR, fp);
-    put_bytes(fp, (long_u)uhp->uh_save_nr, 4);
+    undo_write_bytes(bi, 4, 1);
+    undo_write_bytes(bi, UHP_SAVE_NR, 1);
+    undo_write_bytes(bi, (long_u)uhp->uh_save_nr, 4);
 
-    putc(0, fp);  /* end marker */
+    undo_write_bytes(bi, 0, 1);  /* end marker */
 
     /* Write all the entries. */
     for (uep = uhp->uh_entry; uep != NULL; uep = uep->ue_next)
     {
-	put_bytes(fp, (long_u)UF_ENTRY_MAGIC, 2);
-	if (serialize_uep(fp, buf, uep) == FAIL)
+	undo_write_bytes(bi, (long_u)UF_ENTRY_MAGIC, 2);
+	if (serialize_uep(bi, uep) == FAIL)
 	    return FAIL;
     }
-    put_bytes(fp, (long_u)UF_ENTRY_END_MAGIC, 2);
+    undo_write_bytes(bi, (long_u)UF_ENTRY_END_MAGIC, 2);
     return OK;
 }
 
     static u_header_T *
-unserialize_uhp(fp, file_name)
-    FILE	*fp;
+unserialize_uhp(bi, file_name)
+    bufinfo_T	*bi;
     char_u	*file_name;
 {
     u_header_T	*uhp;
@@ -1051,56 +1318,56 @@ unserialize_uhp(fp, file_name)
 #ifdef U_DEBUG
     uhp->uh_magic = UH_MAGIC;
 #endif
-    uhp->uh_next.seq = get4c(fp);
-    uhp->uh_prev.seq = get4c(fp);
-    uhp->uh_alt_next.seq = get4c(fp);
-    uhp->uh_alt_prev.seq = get4c(fp);
-    uhp->uh_seq = get4c(fp);
+    uhp->uh_next.seq = undo_read_4c(bi);
+    uhp->uh_prev.seq = undo_read_4c(bi);
+    uhp->uh_alt_next.seq = undo_read_4c(bi);
+    uhp->uh_alt_prev.seq = undo_read_4c(bi);
+    uhp->uh_seq = undo_read_4c(bi);
     if (uhp->uh_seq <= 0)
     {
 	corruption_error("uh_seq", file_name);
 	vim_free(uhp);
 	return NULL;
     }
-    unserialize_pos(&uhp->uh_cursor, fp);
+    unserialize_pos(bi, &uhp->uh_cursor);
 #ifdef FEAT_VIRTUALEDIT
-    uhp->uh_cursor_vcol = get4c(fp);
+    uhp->uh_cursor_vcol = undo_read_4c(bi);
 #else
-    (void)get4c(fp);
+    (void)undo_read_4c(bi);
 #endif
-    uhp->uh_flags = get2c(fp);
+    uhp->uh_flags = undo_read_2c(bi);
     for (i = 0; i < NMARKS; ++i)
-	unserialize_pos(&uhp->uh_namedm[i], fp);
-    unserialize_visualinfo(&uhp->uh_visual, fp);
-    uhp->uh_time = get8ctime(fp);
+	unserialize_pos(bi, &uhp->uh_namedm[i]);
+    unserialize_visualinfo(bi, &uhp->uh_visual);
+    uhp->uh_time = undo_read_time(bi);
 
     /* Optional fields. */
     for (;;)
     {
-	int len = getc(fp);
+	int len = undo_read_byte(bi);
 	int what;
 
 	if (len == 0)
 	    break;
-	what = getc(fp);
+	what = undo_read_byte(bi);
 	switch (what)
 	{
 	    case UHP_SAVE_NR:
-		uhp->uh_save_nr = get4c(fp);
+		uhp->uh_save_nr = undo_read_4c(bi);
 		break;
 	    default:
 		/* field not supported, skip */
 		while (--len >= 0)
-		    (void)getc(fp);
+		    (void)undo_read_byte(bi);
 	}
     }
 
     /* Unserialize the uep list. */
     last_uep = NULL;
-    while ((c = get2c(fp)) == UF_ENTRY_MAGIC)
+    while ((c = undo_read_2c(bi)) == UF_ENTRY_MAGIC)
     {
 	error = FALSE;
-	uep = unserialize_uep(fp, &error, file_name);
+	uep = unserialize_uep(bi, &error, file_name);
 	if (last_uep == NULL)
 	    uhp->uh_entry = uep;
 	else
@@ -1123,35 +1390,34 @@ unserialize_uhp(fp, file_name)
 }
 
 /*
- * Serialize "uep" to "fp".
+ * Serialize "uep".
  */
     static int
-serialize_uep(fp, buf, uep)
-    FILE	*fp;
-    buf_T	*buf;
+serialize_uep(bi, uep)
+    bufinfo_T	*bi;
     u_entry_T	*uep;
 {
     int		i;
     size_t	len;
 
-    put_bytes(fp, (long_u)uep->ue_top, 4);
-    put_bytes(fp, (long_u)uep->ue_bot, 4);
-    put_bytes(fp, (long_u)uep->ue_lcount, 4);
-    put_bytes(fp, (long_u)uep->ue_size, 4);
+    undo_write_bytes(bi, (long_u)uep->ue_top, 4);
+    undo_write_bytes(bi, (long_u)uep->ue_bot, 4);
+    undo_write_bytes(bi, (long_u)uep->ue_lcount, 4);
+    undo_write_bytes(bi, (long_u)uep->ue_size, 4);
     for (i = 0; i < uep->ue_size; ++i)
     {
 	len = STRLEN(uep->ue_array[i]);
-	if (put_bytes(fp, (long_u)len, 4) == FAIL)
+	if (undo_write_bytes(bi, (long_u)len, 4) == FAIL)
 	    return FAIL;
-	if (len > 0 && fwrite_crypt(buf, uep->ue_array[i], len, fp) != 1)
+	if (len > 0 && fwrite_crypt(bi, uep->ue_array[i], len) == FAIL)
 	    return FAIL;
     }
     return OK;
 }
 
     static u_entry_T *
-unserialize_uep(fp, error, file_name)
-    FILE	*fp;
+unserialize_uep(bi, error, file_name)
+    bufinfo_T	*bi;
     int		*error;
     char_u	*file_name;
 {
@@ -1168,10 +1434,10 @@ unserialize_uep(fp, error, file_name)
 #ifdef U_DEBUG
     uep->ue_magic = UE_MAGIC;
 #endif
-    uep->ue_top = get4c(fp);
-    uep->ue_bot = get4c(fp);
-    uep->ue_lcount = get4c(fp);
-    uep->ue_size = get4c(fp);
+    uep->ue_top = undo_read_4c(bi);
+    uep->ue_bot = undo_read_4c(bi);
+    uep->ue_lcount = undo_read_4c(bi);
+    uep->ue_size = undo_read_4c(bi);
     if (uep->ue_size > 0)
     {
 	array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size);
@@ -1188,9 +1454,9 @@ unserialize_uep(fp, error, file_name)
 
     for (i = 0; i < uep->ue_size; ++i)
     {
-	line_len = get4c(fp);
+	line_len = undo_read_4c(bi);
 	if (line_len >= 0)
-	    line = read_string_decrypt(curbuf, fp, line_len);
+	    line = read_string_decrypt(bi, line_len);
 	else
 	{
 	    line = NULL;
@@ -1207,83 +1473,71 @@ unserialize_uep(fp, error, file_name)
 }
 
 /*
- * Serialize "pos" to "fp".
+ * Serialize "pos".
  */
     static void
-serialize_pos(pos, fp)
+serialize_pos(bi, pos)
+    bufinfo_T *bi;
     pos_T pos;
-    FILE  *fp;
 {
-    put_bytes(fp, (long_u)pos.lnum, 4);
-    put_bytes(fp, (long_u)pos.col, 4);
+    undo_write_bytes(bi, (long_u)pos.lnum, 4);
+    undo_write_bytes(bi, (long_u)pos.col, 4);
 #ifdef FEAT_VIRTUALEDIT
-    put_bytes(fp, (long_u)pos.coladd, 4);
+    undo_write_bytes(bi, (long_u)pos.coladd, 4);
 #else
-    put_bytes(fp, (long_u)0, 4);
+    undo_write_bytes(bi, (long_u)0, 4);
 #endif
 }
 
 /*
- * Unserialize the pos_T at the current position in fp.
+ * Unserialize the pos_T at the current position.
  */
     static void
-unserialize_pos(pos, fp)
+unserialize_pos(bi, pos)
+    bufinfo_T *bi;
     pos_T *pos;
-    FILE  *fp;
 {
-    pos->lnum = get4c(fp);
+    pos->lnum = undo_read_4c(bi);
     if (pos->lnum < 0)
 	pos->lnum = 0;
-    pos->col = get4c(fp);
+    pos->col = undo_read_4c(bi);
     if (pos->col < 0)
 	pos->col = 0;
 #ifdef FEAT_VIRTUALEDIT
-    pos->coladd = get4c(fp);
+    pos->coladd = undo_read_4c(bi);
     if (pos->coladd < 0)
 	pos->coladd = 0;
 #else
-    (void)get4c(fp);
+    (void)undo_read_4c(bi);
 #endif
 }
 
 /*
- * Serialize "info" to "fp".
+ * Serialize "info".
  */
     static void
-serialize_visualinfo(info, fp)
+serialize_visualinfo(bi, info)
+    bufinfo_T	    *bi;
     visualinfo_T    *info;
-    FILE	    *fp;
 {
-    serialize_pos(info->vi_start, fp);
-    serialize_pos(info->vi_end, fp);
-    put_bytes(fp, (long_u)info->vi_mode, 4);
-    put_bytes(fp, (long_u)info->vi_curswant, 4);
+    serialize_pos(bi, info->vi_start);
+    serialize_pos(bi, info->vi_end);
+    undo_write_bytes(bi, (long_u)info->vi_mode, 4);
+    undo_write_bytes(bi, (long_u)info->vi_curswant, 4);
 }
 
 /*
- * Unserialize the visualinfo_T at the current position in fp.
+ * Unserialize the visualinfo_T at the current position.
  */
     static void
-unserialize_visualinfo(info, fp)
+unserialize_visualinfo(bi, info)
+    bufinfo_T	    *bi;
     visualinfo_T    *info;
-    FILE	    *fp;
-{
-    unserialize_pos(&info->vi_start, fp);
-    unserialize_pos(&info->vi_end, fp);
-    info->vi_mode = get4c(fp);
-    info->vi_curswant = get4c(fp);
-}
-
-/*
- * Write the pointer to an undo header.  Instead of writing the pointer itself
- * we use the sequence number of the header.  This is converted back to
- * pointers when reading. */
-    static void
-put_header_ptr(fp, uhp)
-    FILE	*fp;
-    u_header_T	*uhp;
 {
-    put_bytes(fp, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4);
+    unserialize_pos(bi, &info->vi_start);
+    unserialize_pos(bi, &info->vi_end);
+    info->vi_mode = undo_read_4c(bi);
+    info->vi_curswant = undo_read_4c(bi);
 }
 
 /*
@@ -1317,8 +1571,11 @@ u_write_undo(name, forceit, buf, hash)
     struct stat	st_old;
     struct stat	st_new;
 #endif
+    bufinfo_T	bi;
+
 #ifdef FEAT_CRYPT
-    int		do_crypt = FALSE;
+    bi.bi_state = NULL;
+    bi.bi_buffer = NULL;
 #endif
 
     if (name == NULL)
@@ -1474,14 +1731,12 @@ u_write_undo(name, forceit, buf, hash)
     u_sync(TRUE);
 
     /*
-     * Write the header.
+     * Write the header.  Initializes encryption, if enabled.
      */
-    if (serialize_header(fp, buf, hash) == FAIL)
+    bi.bi_buf = buf;
+    bi.bi_fp = fp;
+    if (serialize_header(&bi, hash) == FAIL)
 	goto write_error;
-#ifdef FEAT_CRYPT
-    if (*buf->b_p_key != NUL)
-	do_crypt = TRUE;
-#endif
 
     /*
      * Iteratively serialize UHPs and their UEPs from the top down.
@@ -1497,7 +1752,7 @@ u_write_undo(name, forceit, buf, hash)
 #ifdef U_DEBUG
 	    ++headers_written;
 #endif
-	    if (serialize_uhp(fp, buf, uhp) == FAIL)
+	    if (serialize_uhp(&bi, uhp) == FAIL)
 		goto write_error;
 	}
 
@@ -1516,7 +1771,7 @@ u_write_undo(name, forceit, buf, hash)
 	    uhp = uhp->uh_next.ptr;
     }
 
-    if (put_bytes(fp, (long_u)UF_HEADER_END_MAGIC, 2) == OK)
+    if (undo_write_bytes(&bi, (long_u)UF_HEADER_END_MAGIC, 2) == OK)
 	write_ok = TRUE;
 #ifdef U_DEBUG
     if (headers_written != buf->b_u_numhead)
@@ -1526,6 +1781,11 @@ u_write_undo(name, forceit, buf, hash)
     }
 #endif
 
+#ifdef FEAT_CRYPT
+    if (bi.bi_state != NULL && undo_flush(&bi) == FAIL)
+	write_ok = FALSE;
+#endif
+
 write_error:
     fclose(fp);
     if (!write_ok)
@@ -1551,8 +1811,9 @@ u_write_undo(name, forceit, buf, hash)
 
 theend:
 #ifdef FEAT_CRYPT
-    if (do_crypt)
-	crypt_pop_state();
+    if (bi.bi_state != NULL)
+	crypt_free_state(bi.bi_state);
+    vim_free(bi.bi_buffer);
 #endif
     if (file_name != name)
 	vim_free(file_name);
@@ -1598,9 +1859,7 @@ u_read_undo(name, hash, orig_name)
     struct stat	st_orig;
     struct stat	st_undo;
 #endif
-#ifdef FEAT_CRYPT
-    int		do_decrypt = FALSE;
-#endif
+    bufinfo_T	bi;
 
     if (name == NULL)
     {
@@ -1644,6 +1903,12 @@ u_read_undo(name, hash, orig_name)
 	    EMSG2(_("E822: Cannot open undo file for reading: %s"), file_name);
 	goto error;
     }
+    bi.bi_buf = curbuf;
+    bi.bi_fp = fp;
+#ifdef FEAT_CRYPT
+    bi.bi_state = NULL;
+    bi.bi_buffer = NULL;
+#endif
 
     /*
      * Read the undo file header.
@@ -1664,12 +1929,24 @@ u_read_undo(name, hash, orig_name)
 								   file_name);
 	    goto error;
 	}
-	if (prepare_crypt_read(fp) == FAIL)
+	bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key);
+	if (bi.bi_state == NULL)
 	{
 	    EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
 	    goto error;
 	}
-	do_decrypt = TRUE;
+	if (crypt_whole_undofile(bi.bi_state->method_nr))
+	{
+	    bi.bi_buffer = alloc(CRYPT_BUF_SIZE);
+	    if (bi.bi_buffer == NULL)
+	    {
+		crypt_free_state(bi.bi_state);
+		bi.bi_state = NULL;
+		goto error;
+	    }
+	    bi.bi_avail = 0;
+	    bi.bi_used = 0;
+	}
 #else
 	EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
 	goto error;
@@ -1681,12 +1958,12 @@ u_read_undo(name, hash, orig_name)
 	goto error;
     }
 
-    if (fread(read_hash, UNDO_HASH_SIZE, 1, fp) != 1)
+    if (undo_read(&bi, read_hash, (size_t)UNDO_HASH_SIZE) == FAIL)
     {
 	corruption_error("hash", file_name);
 	goto error;
     }
-    line_count = (linenr_T)get4c(fp);
+    line_count = (linenr_T)undo_read_4c(&bi);
     if (memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0
 				  || line_count != curbuf->b_ml.ml_line_count)
     {
@@ -1703,13 +1980,13 @@ u_read_undo(name, hash, orig_name)
     }
 
     /* Read undo data for "U" command. */
-    str_len = get4c(fp);
+    str_len = undo_read_4c(&bi);
     if (str_len < 0)
 	goto error;
     if (str_len > 0)
-	line_ptr = read_string_decrypt(curbuf, fp, str_len);
-    line_lnum = (linenr_T)get4c(fp);
-    line_colnr = (colnr_T)get4c(fp);
+	line_ptr = read_string_decrypt(&bi, str_len);
+    line_lnum = (linenr_T)undo_read_4c(&bi);
+    line_colnr = (colnr_T)undo_read_4c(&bi);
     if (line_lnum < 0 || line_colnr < 0)
     {
 	corruption_error("line lnum/col", file_name);
@@ -1717,32 +1994,32 @@ u_read_undo(name, hash, orig_name)
     }
 
     /* Begin general undo data */
-    old_header_seq = get4c(fp);
-    new_header_seq = get4c(fp);
-    cur_header_seq = get4c(fp);
-    num_head = get4c(fp);
-    seq_last = get4c(fp);
-    seq_cur = get4c(fp);
-    seq_time = get8ctime(fp);
+    old_header_seq = undo_read_4c(&bi);
+    new_header_seq = undo_read_4c(&bi);
+    cur_header_seq = undo_read_4c(&bi);
+    num_head = undo_read_4c(&bi);
+    seq_last = undo_read_4c(&bi);
+    seq_cur = undo_read_4c(&bi);
+    seq_time = undo_read_time(&bi);
 
     /* Optional header fields. */
     for (;;)
     {
-	int len = getc(fp);
+	int len = undo_read_byte(&bi);
 	int what;
 
 	if (len == 0 || len == EOF)
 	    break;
-	what = getc(fp);
+	what = undo_read_byte(&bi);
 	switch (what)
 	{
 	    case UF_LAST_SAVE_NR:
-		last_save_nr = get4c(fp);
+		last_save_nr = undo_read_4c(&bi);
 		break;
 	    default:
 		/* field not supported, skip */
 		while (--len >= 0)
-		    (void)getc(fp);
+		    (void)undo_read_byte(&bi);
 	}
     }
 
@@ -1758,7 +2035,7 @@ u_read_undo(name, hash, orig_name)
 	    goto error;
     }
 
-    while ((c = get2c(fp)) == UF_HEADER_MAGIC)
+    while ((c = undo_read_2c(&bi)) == UF_HEADER_MAGIC)
     {
 	if (num_read_uhps >= num_head)
 	{
@@ -1766,7 +2043,7 @@ u_read_undo(name, hash, orig_name)
 	    goto error;
 	}
 
-	uhp = unserialize_uhp(fp, file_name);
+	uhp = unserialize_uhp(&bi, file_name);
 	if (uhp == NULL)
 	    goto error;
 	uhp_table[num_read_uhps++] = uhp;
@@ -1898,8 +2175,9 @@ u_read_undo(name, hash, orig_name)
 
 theend:
 #ifdef FEAT_CRYPT
-    if (do_decrypt)
-	crypt_pop_state();
+    if (bi.bi_state != NULL)
+	crypt_free_state(bi.bi_state);
+    vim_free(bi.bi_buffer);
 #endif
     if (fp != NULL)
 	fclose(fp);
diff --git a/src/version.c b/src/version.c
index 19183fdac8..30bcb2e0f4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    399,
 /**/
     398,
 /**/

From e41d55b20eec9149ae8456cde73b83070117a999 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 13:38:34 +0200
Subject: [PATCH 032/473] Added tag v7-4-399 for changeset 18ac55444b37

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bc9ec5c498..5d6641dacf 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3121,3 +3121,4 @@ d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 7766142fc7d3e90c2e15a9c606efcd97331edef8 v7-4-396
 8d361608fe86c534e51e4c7e583375642d34b7a4 v7-4-397
 f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
+18ac55444b37bcae8ea090f7b3abf4826c679bc3 v7-4-399

From 0cbd20902fb8989a0a8aa5c1e961f0e761def53a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 13:46:36 +0200
Subject: [PATCH 033/473] updated for version 7.4.400 Problem:    List of
 distributed files is incomplete. Solution:   Add recently added files.

---
 Filelist      | 6 ++++++
 src/version.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/Filelist b/Filelist
index 46aaa964e3..0f4ed1d828 100644
--- a/Filelist
+++ b/Filelist
@@ -11,6 +11,8 @@ SRC_ALL =	\
 		src/blowfish.c \
 		src/buffer.c \
 		src/charset.c \
+		src/crypt.c \
+		src/crypt_zip.c \
 		src/diff.c \
 		src/digraph.c \
 		src/edit.c \
@@ -103,6 +105,8 @@ SRC_ALL =	\
 		src/proto/blowfish.pro \
 		src/proto/buffer.pro \
 		src/proto/charset.pro \
+		src/proto/crypt.pro \
+		src/proto/crypt_zip.pro \
 		src/proto/diff.pro \
 		src/proto/digraph.pro \
 		src/proto/edit.pro \
@@ -289,6 +293,8 @@ SRC_DOS =	\
 		src/dosinst.h \
 		src/glbl_ime.cpp \
 		src/glbl_ime.h \
+		src/gui_dwrite.cpp \
+		src/gui_dwrite.h \
 		src/gui_w16.c \
 		src/gui_w32.c \
 		src/gui_w48.c \
diff --git a/src/version.c b/src/version.c
index 30bcb2e0f4..57c23b5e62 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    400,
 /**/
     399,
 /**/

From f69a3c342c2800dfd651f4a5da07ac18ad701667 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 13:46:36 +0200
Subject: [PATCH 034/473] Added tag v7-4-400 for changeset 50a658bf4cff

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5d6641dacf..7bb9561ca0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3122,3 +3122,4 @@ d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 8d361608fe86c534e51e4c7e583375642d34b7a4 v7-4-397
 f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
 18ac55444b37bcae8ea090f7b3abf4826c679bc3 v7-4-399
+50a658bf4cff030cbe6a97a53bb838b5976c2e1a v7-4-400

From 3b18b0804a7ff6b9e2f8d69df23c0bebf13ac775 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 16:31:50 +0200
Subject: [PATCH 035/473] updated for version 7.4.401 Problem:    Can't build
 on MS-Windows. Solution:   Include the new files in all the Makefiles.

---
 src/Make_bc3.mak   |  2 ++
 src/Make_bc5.mak   |  2 ++
 src/Make_cyg.mak   |  5 ++++-
 src/Make_dice.mak  |  8 ++++++++
 src/Make_djg.mak   |  2 ++
 src/Make_ivc.mak   | 10 ++++++++++
 src/Make_manx.mak  | 12 ++++++++++++
 src/Make_ming.mak  |  2 ++
 src/Make_morph.mak |  2 ++
 src/Make_mvc.mak   |  8 ++++++++
 src/Make_os2.mak   |  4 ++++
 src/Make_sas.mak   | 10 ++++++++++
 src/version.c      |  2 ++
 13 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/src/Make_bc3.mak b/src/Make_bc3.mak
index 54c42acc6a..dea9e1011a 100644
--- a/src/Make_bc3.mak
+++ b/src/Make_bc3.mak
@@ -54,6 +54,8 @@ EXE_dependencies = \
 	blowfish.obj \
 	buffer.obj \
 	charset.obj \
+	crypt.obj \
+	crypt_zip.obj \
 	diff.obj \
 	digraph.obj \
 	edit.obj \
diff --git a/src/Make_bc5.mak b/src/Make_bc5.mak
index 5769bd64ba..2b759dce17 100644
--- a/src/Make_bc5.mak
+++ b/src/Make_bc5.mak
@@ -580,6 +580,8 @@ vimobj =  \
 	$(OBJDIR)\blowfish.obj \
 	$(OBJDIR)\buffer.obj \
 	$(OBJDIR)\charset.obj \
+	$(OBJDIR)\crypt.obj \
+	$(OBJDIR)\crypt_zip.obj \
 	$(OBJDIR)\diff.obj \
 	$(OBJDIR)\digraph.obj \
 	$(OBJDIR)\edit.obj \
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index 24f19c9f2a..4b9985f70a 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -1,6 +1,7 @@
 #
 # Makefile for VIM on Win32, using Cygnus gcc
-# Last updated by Dan Sharp.  Last Change: 2013 Dec 11
+# Updated by Dan Sharp.
+# Last Change: 2014 Aug 10
 #
 # Also read INSTALLpc.txt!
 #
@@ -546,6 +547,8 @@ OBJ = \
 	$(OUTDIR)/blowfish.o \
 	$(OUTDIR)/buffer.o \
 	$(OUTDIR)/charset.o \
+	$(OUTDIR)/crypt.o \
+	$(OUTDIR)/crypt_zip.o \
 	$(OUTDIR)/diff.o \
 	$(OUTDIR)/digraph.o \
 	$(OUTDIR)/edit.o \
diff --git a/src/Make_dice.mak b/src/Make_dice.mak
index e3a8b9e0fb..890f15d09c 100644
--- a/src/Make_dice.mak
+++ b/src/Make_dice.mak
@@ -29,6 +29,8 @@ SRC = \
 	blowfish.c \
 	buffer.c \
 	charset.c \
+	crypt.c \
+	crypt_zip.c \
 	diff.c \
 	digraph.c \
 	edit.c \
@@ -75,6 +77,8 @@ SRC = \
 OBJ =	o/blowfish.o \
 	o/buffer.o \
 	o/charset.o \
+	o/crypt.o \
+	o/crypt_zip.o \
 	o/diff.o \
 	o/digraph.o \
 	o/edit.o \
@@ -143,6 +147,10 @@ o/buffer.o:	buffer.c  $(SYMS)
 
 o/charset.o:	charset.c  $(SYMS)
 
+o/crypt.o:	crypt.c  $(SYMS)
+
+o/crypt_zip.o:	crypt_zip.c  $(SYMS)
+
 o/diff.o:	diff.c	$(SYMS)
 
 o/digraph.o:	digraph.c  $(SYMS)
diff --git a/src/Make_djg.mak b/src/Make_djg.mak
index f2e7c82712..1a92344765 100644
--- a/src/Make_djg.mak
+++ b/src/Make_djg.mak
@@ -22,6 +22,8 @@ OBJ = \
 	obj/blowfish.o \
 	obj/buffer.o \
 	obj/charset.o \
+	obj/crypt.o \
+	obj/crypt_zip.o \
 	obj/diff.o \
 	obj/digraph.o \
 	obj/edit.o \
diff --git a/src/Make_ivc.mak b/src/Make_ivc.mak
index 16589ea8ad..a891a9743b 100644
--- a/src/Make_ivc.mak
+++ b/src/Make_ivc.mak
@@ -213,6 +213,8 @@ LINK32_OBJS= \
 	"$(INTDIR)/blowfish.obj" \
 	"$(INTDIR)/buffer.obj" \
 	"$(INTDIR)/charset.obj" \
+	"$(INTDIR)/crypt.obj" \
+	"$(INTDIR)/crypt_zip.obj" \
 	"$(INTDIR)/diff.obj" \
 	"$(INTDIR)/digraph.obj" \
 	"$(INTDIR)/edit.obj" \
@@ -339,6 +341,14 @@ SOURCE=.\charset.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\crypt.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\crypt_zip.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\diff.c
 # End Source File
 # Begin Source File
diff --git a/src/Make_manx.mak b/src/Make_manx.mak
index 101c5c6b32..6305cd381e 100644
--- a/src/Make_manx.mak
+++ b/src/Make_manx.mak
@@ -37,6 +37,8 @@ DEL = $(SHELL) -c rm -f
 SRC =	blowfish.c \
 	buffer.c \
 	charset.c \
+	crypt.c \
+	crypt_zip.c \
 	diff.c \
 	digraph.c \
 	edit.c \
@@ -85,6 +87,8 @@ INCL = vim.h feature.h keymap.h macros.h ascii.h term.h structs.h os_amiga.h
 OBJ =	obj/blowfish.o \
 	obj/buffer.o \
 	obj/charset.o \
+	obj/crypt.o \
+	obj/crypt_zip.o \
 	obj/diff.o \
 	obj/digraph.o \
 	obj/edit.o \
@@ -131,6 +135,8 @@ OBJ =	obj/blowfish.o \
 PRO =	proto/blowfish.pro \
 	proto/buffer.pro \
 	proto/charset.pro \
+	proto/crypt.pro \
+	proto/crypt_zip.pro \
 	proto/diff.pro \
 	proto/digraph.pro \
 	proto/edit.pro \
@@ -227,6 +233,12 @@ obj/buffer.o:	buffer.c
 obj/charset.o:	charset.c
 	$(CCSYM) $@ charset.c
 
+obj/crypt.o:	crypt.c
+	$(CCSYM) $@ crypt.c
+
+obj/crypt_zip.o: crypt_zip.c
+	$(CCSYM) $@ crypt_zip.c
+
 obj/diff.o:	diff.c
 	$(CCSYM) $@ diff.c
 
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index de1d88fe4c..82988629ee 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -517,6 +517,8 @@ OBJ = \
 	$(OUTDIR)/blowfish.o \
 	$(OUTDIR)/buffer.o \
 	$(OUTDIR)/charset.o \
+	$(OUTDIR)/crypt.o \
+	$(OUTDIR)/crypt_zip.o \
 	$(OUTDIR)/diff.o \
 	$(OUTDIR)/digraph.o \
 	$(OUTDIR)/edit.o \
diff --git a/src/Make_morph.mak b/src/Make_morph.mak
index aa8fbd927a..15a74773c2 100644
--- a/src/Make_morph.mak
+++ b/src/Make_morph.mak
@@ -27,6 +27,8 @@ RM =		rm
 SRC =	blowfish.c						\
 	buffer.c						\
 	charset.c						\
+	crypt.c							\
+	crypt_zip.c						\
 	diff.c							\
 	digraph.c						\
 	edit.c							\
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 24069b24e9..c93f4b4aaa 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -547,6 +547,8 @@ OBJ = \
 	$(OUTDIR)\blowfish.obj \
 	$(OUTDIR)\buffer.obj \
 	$(OUTDIR)\charset.obj \
+	$(OUTDIR)\crypt.obj \
+	$(OUTDIR)\crypt_zip.obj \
 	$(OUTDIR)\diff.obj \
 	$(OUTDIR)\digraph.obj \
 	$(OUTDIR)\edit.obj \
@@ -1092,6 +1094,10 @@ $(OUTDIR)/buffer.obj:	$(OUTDIR) buffer.c  $(INCL)
 
 $(OUTDIR)/charset.obj:	$(OUTDIR) charset.c  $(INCL)
 
+$(OUTDIR)/crypt.obj:	$(OUTDIR) crypt.c  $(INCL)
+
+$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c  $(INCL)
+
 $(OUTDIR)/diff.obj:	$(OUTDIR) diff.c  $(INCL)
 
 $(OUTDIR)/digraph.obj:	$(OUTDIR) digraph.c  $(INCL)
@@ -1278,6 +1284,8 @@ proto.h: \
 	proto/blowfish.pro \
 	proto/buffer.pro \
 	proto/charset.pro \
+	proto/crypt.pro \
+	proto/crypt_zip.pro \
 	proto/diff.pro \
 	proto/digraph.pro \
 	proto/edit.pro \
diff --git a/src/Make_os2.mak b/src/Make_os2.mak
index 42dbdb346e..cd62d1c6d5 100644
--- a/src/Make_os2.mak
+++ b/src/Make_os2.mak
@@ -42,6 +42,8 @@ OBJ = \
 	blowfish.o \
 	buffer.o \
 	charset.o \
+	crypt.o \
+	crypt_zip.o \
 	diff.o \
 	digraph.o \
 	edit.o \
@@ -117,6 +119,8 @@ os_unix.o:	os_unix.c  $(INCL)
 blowfish.o:	blowfish.c  $(INCL)
 buffer.o:	buffer.c  $(INCL)
 charset.o:	charset.c  $(INCL)
+crypt.o:	crypt.c  $(INCL)
+crypt_zip.o:	crypt_zip.c  $(INCL)
 diff.o:		diff.c  $(INCL)
 digraph.o:	digraph.c  $(INCL)
 edit.o:		edit.c  $(INCL)
diff --git a/src/Make_sas.mak b/src/Make_sas.mak
index bf57c0dcb2..49dcb6bdcd 100644
--- a/src/Make_sas.mak
+++ b/src/Make_sas.mak
@@ -92,6 +92,8 @@ SRC = \
 	blowfish.c \
 	buffer.c \
 	charset.c \
+	crypt.c \
+	crypt_zip.c \
 	diff.c \
 	digraph.c \
 	edit.c \
@@ -139,6 +141,8 @@ OBJ = \
 	blowfish.o \
 	buffer.o \
 	charset.o \
+	crypt.o \
+	crypt_zip.o \
 	diff.o \
 	digraph.o \
 	edit.o \
@@ -186,6 +190,8 @@ PRO = \
 	proto/blowfish.pro \
 	proto/buffer.pro \
 	proto/charset.pro \
+	proto/crypt.pro \
+	proto/crypt_zip.pro \
 	proto/diff.pro \
 	proto/digraph.pro \
 	proto/edit.pro \
@@ -290,6 +296,10 @@ buffer.o:		buffer.c
 proto/buffer.pro:	buffer.c
 charset.o:		charset.c
 proto/charset.pro:	charset.c
+crypt.o:		crypt.c
+proto/crypt.pro:	crypt.c
+crypt_zip.o:		crypt_zip.c
+proto/crypt_zip.pro:	crypt_zip.c
 diff.o:			diff.c
 proto/diff.pro:		diff.c
 digraph.o:		digraph.c
diff --git a/src/version.c b/src/version.c
index 57c23b5e62..33cc85dcfd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    401,
 /**/
     400,
 /**/

From dffba533010657f891d7d1a58653ec3a0b8098f5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 10 Aug 2014 16:31:51 +0200
Subject: [PATCH 036/473] Added tag v7-4-401 for changeset ab71bb81b84e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7bb9561ca0..7a4e2cf5d9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3123,3 +3123,4 @@ d594c15521377493d5e23b03e4dbf5108df69acd v7-4-394
 f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
 18ac55444b37bcae8ea090f7b3abf4826c679bc3 v7-4-399
 50a658bf4cff030cbe6a97a53bb838b5976c2e1a v7-4-400
+ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401

From 2039998159b3e735b228250507698c8b679df891 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 12 Aug 2014 20:14:33 +0200
Subject: [PATCH 037/473] updated for version 7.4.402 Problem:    Test 72
 crashes under certain conditions. (Kazunobu Kuriyama) Solution:   Clear the
 whole bufinfo_T early.

---
 src/undo.c    | 12 +++---------
 src/version.c |  2 ++
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/undo.c b/src/undo.c
index 1661c8074b..8f50f0f0a8 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -929,7 +929,7 @@ undo_write(bi, ptr, len)
 undo_flush(bi)
     bufinfo_T	*bi;
 {
-    if (bi->bi_used > 0)
+    if (bi->bi_buffer != NULL && bi->bi_used > 0)
     {
 	crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used);
 	if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1)
@@ -1573,10 +1573,7 @@ u_write_undo(name, forceit, buf, hash)
 #endif
     bufinfo_T	bi;
 
-#ifdef FEAT_CRYPT
-    bi.bi_state = NULL;
-    bi.bi_buffer = NULL;
-#endif
+    vim_memset(&bi, 0, sizeof(bi));
 
     if (name == NULL)
     {
@@ -1861,6 +1858,7 @@ u_read_undo(name, hash, orig_name)
 #endif
     bufinfo_T	bi;
 
+    vim_memset(&bi, 0, sizeof(bi));
     if (name == NULL)
     {
 	file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE);
@@ -1905,10 +1903,6 @@ u_read_undo(name, hash, orig_name)
     }
     bi.bi_buf = curbuf;
     bi.bi_fp = fp;
-#ifdef FEAT_CRYPT
-    bi.bi_state = NULL;
-    bi.bi_buffer = NULL;
-#endif
 
     /*
      * Read the undo file header.
diff --git a/src/version.c b/src/version.c
index 33cc85dcfd..e98036195f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    402,
 /**/
     401,
 /**/

From 5cc90795b4ac40c6ba0db06ea8924dea37d4ddfc Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 12 Aug 2014 20:14:33 +0200
Subject: [PATCH 038/473] Added tag v7-4-402 for changeset 3aa37ad2c4ed

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7a4e2cf5d9..dfb3dd8ed5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3124,3 +3124,4 @@ f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
 18ac55444b37bcae8ea090f7b3abf4826c679bc3 v7-4-399
 50a658bf4cff030cbe6a97a53bb838b5976c2e1a v7-4-400
 ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
+3aa37ad2c4ed4d4f979e7c7e7d5d88586c6b74ba v7-4-402

From 10a01d419ec083736922de1718bd3cd3bfef0ad8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 13 Aug 2014 21:58:28 +0200
Subject: [PATCH 039/473] updated for version 7.4.403 Problem:    Valgrind
 reports errors when running test 72. (Dominique Pelle) Solution:   Reset the
 local 'cryptmethod' option before storing the seed. 	    Set the seed in
 the memfile even when there is no block0 yet.

---
 src/fileio.c  |  1 +
 src/memline.c | 33 ++++++++++++++++++++++++++++++++-
 src/option.c  |  8 ++++++++
 src/version.c |  2 ++
 4 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/src/fileio.c b/src/fileio.c
index a028b22a5c..17490ac21a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2944,6 +2944,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 	 * Avoids accidentally overwriting the file with garbage. */
 	curbuf->b_p_ro = TRUE;
 
+	/* Set the cryptmethod local to the buffer. */
 	crypt_set_cm_option(curbuf, method);
 	if (cryptkey == NULL && !*did_ask)
 	{
diff --git a/src/memline.c b/src/memline.c
index a5053f0233..7adb2dc990 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -235,6 +235,7 @@ typedef enum {
 } upd_block0_T;
 
 #ifdef FEAT_CRYPT
+static void ml_set_mfp_crypt __ARGS((buf_T *buf));
 static void ml_set_b0_crypt __ARGS((buf_T *buf, ZERO_BL *b0p));
 #endif
 static int ml_check_b0_id __ARGS((ZERO_BL *b0p));
@@ -432,6 +433,25 @@ ml_open(buf)
 }
 
 #if defined(FEAT_CRYPT) || defined(PROTO)
+/*
+ * Prepare encryption for "buf" for the current key and method.
+ */
+    static void
+ml_set_mfp_crypt(buf)
+    buf_T	*buf;
+{
+    if (*buf->b_p_key != NUL)
+    {
+	int method_nr = crypt_get_method_nr(buf);
+
+	if (method_nr > CRYPT_M_ZIP)
+	{
+	    /* Generate a seed and store it in the memfile. */
+	    sha2_seed(buf->b_ml.ml_mfp->mf_seed, MF_SEED_LEN, NULL, 0);
+	}
+    }
+}
+
 /*
  * Prepare encryption for "buf" with block 0 "b0p".
  */
@@ -915,8 +935,19 @@ ml_upd_block0(buf, what)
     ZERO_BL	*b0p;
 
     mfp = buf->b_ml.ml_mfp;
-    if (mfp == NULL || (hp = mf_get(mfp, (blocknr_T)0, 1)) == NULL)
+    if (mfp == NULL)
 	return;
+    hp = mf_get(mfp, (blocknr_T)0, 1);
+    if (hp == NULL)
+    {
+#ifdef FEAT_CRYPT
+	/* Possibly update the seed in the memfile before there is a block0. */
+	if (what == UB_CRYPT)
+	    ml_set_mfp_crypt(buf);
+#endif
+	return;
+    }
+
     b0p = (ZERO_BL *)(hp->bh_data);
     if (ml_check_b0_id(b0p) == FAIL)
 	EMSG(_("E304: ml_upd_block0(): Didn't get block 0??"));
diff --git a/src/option.c b/src/option.c
index 62556b69c9..f928b3ba94 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6163,6 +6163,14 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 		p_cm = vim_strsave((char_u *)"zip");
 		new_value_alloced = TRUE;
 	    }
+	    /* When using ":set cm=name" the local value is going to be empty.
+	     * Do that here, otherwise the crypt functions will still use the
+	     * local value. */
+	    if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)
+	    {
+		free_string_option(curbuf->b_p_cm);
+		curbuf->b_p_cm = empty_option;
+	    }
 
 	    /* Need to update the swapfile when the effective method changed.
 	     * Set "s" to the effective old value, "p" to the effective new
diff --git a/src/version.c b/src/version.c
index e98036195f..b832539c0e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    403,
 /**/
     402,
 /**/

From 359983948f9b2707b6a70ba2f248aed6ff740953 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 13 Aug 2014 21:58:28 +0200
Subject: [PATCH 040/473] Added tag v7-4-403 for changeset 86fb698a38d5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index dfb3dd8ed5..2846d4314a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3125,3 +3125,4 @@ f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
 50a658bf4cff030cbe6a97a53bb838b5976c2e1a v7-4-400
 ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 3aa37ad2c4ed4d4f979e7c7e7d5d88586c6b74ba v7-4-402
+86fb698a38d5c10f59928e57da94ce5b3e124a40 v7-4-403

From af72e95b7fba3be59adef9b4a7d5045e7e59304c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 13 Aug 2014 22:05:53 +0200
Subject: [PATCH 041/473] updated for version 7.4.404 Problem:    Windows 64
 bit compiler warnings. Solution:   Add type casts. (Mike Williams)

---
 src/crypt.c   | 6 +++---
 src/undo.c    | 6 +++---
 src/version.c | 2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/crypt.c b/src/crypt.c
index 758ffb17b2..c54e15c4af 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -397,13 +397,13 @@ crypt_encode_alloc(state, from, len, newptr)
 	return method->encode_buffer_fn(state, from, len, newptr);
     if (len == 0)
 	/* Not buffering, just return EOF. */
-	return len;
+	return (long)len;
 
-    *newptr = alloc(len);
+    *newptr = alloc((long)len);
     if (*newptr == NULL)
 	return -1;
     method->encode_fn(state, from, len, *newptr);
-    return len;
+    return (long)len;
 }
 
 /*
diff --git a/src/undo.c b/src/undo.c
index 8f50f0f0a8..db6ea29ab7 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -992,7 +992,7 @@ undo_write_bytes(bi, nr, len)
     int	    bufi = 0;
 
     for (i = len - 1; i >= 0; --i)
-	buf[bufi++] = nr >> (i * 8);
+	buf[bufi++] = (char_u)(nr >> (i * 8));
     return undo_write(bi, buf, (size_t)len);
 }
 
@@ -1093,7 +1093,7 @@ undo_read(bi, buffer, size)
 #ifdef FEAT_CRYPT
     if (bi->bi_buffer != NULL)
     {
-	int	size_todo = size;
+	int	size_todo = (int)size;
 	char_u	*p = buffer;
 
 	while (size_todo > 0)
@@ -1119,7 +1119,7 @@ undo_read(bi, buffer, size)
 		n = bi->bi_avail - bi->bi_used;
 	    mch_memmove(p, bi->bi_buffer + bi->bi_used, n);
 	    bi->bi_used += n;
-	    size_todo -= n;
+	    size_todo -= (int)n;
 	    p += n;
 	}
 	return OK;
diff --git a/src/version.c b/src/version.c
index b832539c0e..42369f1d6e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    404,
 /**/
     403,
 /**/

From dce0029fd7264840879a6935565c0e9ece5e2cff Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 13 Aug 2014 22:05:54 +0200
Subject: [PATCH 042/473] Added tag v7-4-404 for changeset 0242c27e40e1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2846d4314a..0c9a0a6217 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3126,3 +3126,4 @@ f62b2e76dd809dc57cad9d0fd8f04a4f3a7193e9 v7-4-398
 ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 3aa37ad2c4ed4d4f979e7c7e7d5d88586c6b74ba v7-4-402
 86fb698a38d5c10f59928e57da94ce5b3e124a40 v7-4-403
+0242c27e40e1ce913ec2b6540371d5ea5fceeac9 v7-4-404

From 3fef850faba61c1f7a11ce5476ae517f33e2b69e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 16:28:36 +0200
Subject: [PATCH 043/473] updated for version 7.4.405 Problem:    Screen
 updating is slow when using matches. Solution:   Do not use the ">=" as in
 patch 7.4.362, check the lnum.

---
 src/screen.c          |  2 +-
 src/testdir/test63.in | 23 ++++++++++++++++++++++-
 src/testdir/test63.ok |  2 ++
 src/version.c         |  2 ++
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 3ab53d9e27..4c134f0e6d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3858,7 +3858,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 			{
 			    shl->attr_cur = shl->attr;
 			}
-			else if (v >= (long)shl->endcol)
+			else if (v >= (long)shl->endcol && shl->lnum == lnum)
 			{
 			    shl->attr_cur = 0;
 			    next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
diff --git a/src/testdir/test63.in b/src/testdir/test63.in
index 5ec315ad7a..a161d6745c 100644
--- a/src/testdir/test63.in
+++ b/src/testdir/test63.in
@@ -3,6 +3,7 @@ Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()",
 
 STARTTEST
 :so small.vim
+:set encoding=utf8
 :" --- Check that "matcharg()" returns the correct group and pattern if a match
 :" --- is defined.
 :let @r = "*** Test 1: "
@@ -164,7 +165,27 @@ STARTTEST
 :if v1 != v5 && v6 == v1 && v8 == v5 && v10 == v5 && v11 == v1
 :  let @r .= "OK\n"
 :else
-:  let @r .= "FAILED\n"
+:  let @r .= "FAILED: " . v5 . "/" . v6 . "/" . v8 . "/" . v10 . "/" . v11 . "\n"
+:endif
+:call clearmatches()
+:"
+:call setline(1, 'abcdΣabcdef')
+:call matchaddpos("MyGroup1", [[1, 4, 2], [1, 9, 2]])
+:1
+:redraw!
+:let v1 = screenattr(1, 1)
+:let v4 = screenattr(1, 4)
+:let v5 = screenattr(1, 5)
+:let v6 = screenattr(1, 6)
+:let v7 = screenattr(1, 7)
+:let v8 = screenattr(1, 8)
+:let v9 = screenattr(1, 9)
+:let v10 = screenattr(1, 10)
+:let @r .= string(getmatches())."\n"
+:if v1 != v4 && v5 == v4 && v6 == v1 && v7 == v1 && v8 == v4 && v9 == v4 && v10 == v1
+:  let @r .= "OK\n"
+:else
+:  let @r .= "FAILED: " . v4 . "/" . v5 . "/" . v6 . "/" . v7 . "/" . v8 . "/" . v9 . "/" . v10 . "\n"
 :endif
 :call clearmatches()
 G"rp
diff --git a/src/testdir/test63.ok b/src/testdir/test63.ok
index f804b693ac..5d619395b7 100644
--- a/src/testdir/test63.ok
+++ b/src/testdir/test63.ok
@@ -12,3 +12,5 @@ Results of test63:
 *** Test 11:
 [{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}]
 OK
+[{'group': 'MyGroup1', 'id': 11, 'priority': 10, 'pos1': [1, 4, 2], 'pos2': [1, 9, 2]}]
+OK
diff --git a/src/version.c b/src/version.c
index 42369f1d6e..28a3fdb371 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    405,
 /**/
     404,
 /**/

From b859094e016576ce7f7a9312d21bba1f6d4a9dfa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 16:28:36 +0200
Subject: [PATCH 044/473] Added tag v7-4-405 for changeset 4c25af735304

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0c9a0a6217..8d0a711562 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3127,3 +3127,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 3aa37ad2c4ed4d4f979e7c7e7d5d88586c6b74ba v7-4-402
 86fb698a38d5c10f59928e57da94ce5b3e124a40 v7-4-403
 0242c27e40e1ce913ec2b6540371d5ea5fceeac9 v7-4-404
+4c25af735304ff17a27bb3ce21e7f7d3b304ff88 v7-4-405

From 27f1c11982ddcf8ec567f2c79c0dd655185699bc Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 17:34:34 +0200
Subject: [PATCH 045/473] updated for version 7.4.406 Problem:    Test 72 and
 100 fail on MS-Windows. Solution:   Set fileformat to unix in the tests.
 (Taro Muraoka)

---
 src/testdir/test100.in | 3 +++
 src/testdir/test72.in  | 1 +
 src/version.c          | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/src/testdir/test100.in b/src/testdir/test100.in
index 61d28c15f0..e703f18199 100644
--- a/src/testdir/test100.in
+++ b/src/testdir/test100.in
@@ -18,6 +18,7 @@ STARTTEST
 :call FillBuffer()
 :call feedkeys(":earlier 10\n", 't')
 :call UndoLevel()
+:set ff=unix
 :%w! test.out
 :new two
 :0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)'
@@ -27,6 +28,7 @@ STARTTEST
 :call UndoLevel()
 :setlocal ul=10
 :call UndoLevel()
+:set ff=unix
 :%w >> test.out
 :wincmd p
 :redir >>test.out | echo "global value shouldn't be changed and still be 5!" | echo 'ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'|:setglobal undolevels? | echon ' global' | setlocal undolevels? | echon ' local' |echo "" |redir end
@@ -35,6 +37,7 @@ STARTTEST
 :1put ='global value should be changed to 50'
 :2put ='THREE: expecting global undolevels: 50, local undolevels: -123456 (default)'
 :call UndoLevel()
+:set ff=unix
 :%w >> test.out
 :"sleep 10
 :"
diff --git a/src/testdir/test72.in b/src/testdir/test72.in
index 031edbf146..87c25d4863 100644
--- a/src/testdir/test72.in
+++ b/src/testdir/test72.in
@@ -8,6 +8,7 @@ STARTTEST
 :" Test 'undofile': first a simple one-line change.
 :set nocompatible viminfo+=nviminfo visualbell
 :set ul=100 undofile nomore
+:set ff=unix
 :e! Xtestfile
 ggdGithis is one line:set ul=100
 :s/one/ONE/
diff --git a/src/version.c b/src/version.c
index 28a3fdb371..7e5b3cdd51 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    406,
 /**/
     405,
 /**/

From 28c4195e68d0b1feeb1999cd2b08ba9b3394c693 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 17:34:34 +0200
Subject: [PATCH 046/473] Added tag v7-4-406 for changeset 1134bba900c1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 8d0a711562..e3c925d0ee 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3128,3 +3128,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 86fb698a38d5c10f59928e57da94ce5b3e124a40 v7-4-403
 0242c27e40e1ce913ec2b6540371d5ea5fceeac9 v7-4-404
 4c25af735304ff17a27bb3ce21e7f7d3b304ff88 v7-4-405
+1134bba900c17abcecdc414c6e30da22c17d32a5 v7-4-406

From 411c05c77d45e1be2282469c0eef8a019f8c7e29 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 18:13:03 +0200
Subject: [PATCH 047/473] updated for version 7.4.407 Problem:    Inserting
 text for Visual block mode, with cursor movement, 	    repeats the wrong
 text. (Aleksandar Ivanov) Solution:   Reset the update_Insstart_orig flag.
 (Christian Brabandt)

---
 src/edit.c            |  10 ++++++++--
 src/testdir/test39.in |   8 ++++++++
 src/testdir/test39.ok | Bin 481 -> 514 bytes
 src/version.c         |   2 ++
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/edit.c b/src/edit.c
index 6f30d81f60..29721afa33 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -6768,13 +6768,19 @@ stop_arrow()
 {
     if (arrow_used)
     {
+	Insstart = curwin->w_cursor;	/* new insertion starts here */
+	if (Insstart.col > Insstart_orig.col && !ins_need_undo)
+	    /* Don't update the original insert position when moved to the
+	     * right, except when nothing was inserted yet. */
+	    update_Insstart_orig = FALSE;
+	Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
+
 	if (u_save_cursor() == OK)
 	{
 	    arrow_used = FALSE;
 	    ins_need_undo = FALSE;
 	}
-	Insstart = curwin->w_cursor;	/* new insertion starts here */
-	Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
+
 	ai_col = 0;
 #ifdef FEAT_VREPLACE
 	if (State & VREPLACE_FLAG)
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
index c1e1cc49a6..7d1c672522 100644
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -23,6 +23,9 @@ G$khhhhhkkcmno
 /^aaaa/
 :exe ":norm! l\<C-V>jjjlllI\<Right>\<Right>  \<Esc>"
 :/^aa/,/^$/w >> test.out
+/xaaa$/
+:exe ":norm! \<C-V>jjjI<>\<Left>p\<Esc>"
+:/xaaa$/,/^$/w >> test.out
 :" Test for Visual block was created with the last <C-v>$
 /^A23$/
 :exe ":norm! l\<C-V>j$Aab\<Esc>"
@@ -77,6 +80,11 @@ bbbbbb
 cccccc
 dddddd
 
+xaaa
+bbbb
+cccc
+dddd
+
 A23
 4567
 
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
index ef7a2c6442ca8ae973f2ca86e6105214a166180d..d8e901563af492e50b8f70c470fee5678644dc0c 100644
GIT binary patch
delta 39
lcmaFJ+{7|rqKr*}T}5JIA{UTO0s;`73<MxLWn)h$BLE9K4HN(X

delta 10
RcmZo-dB{9r;>Jw@i~tx91V8`)

diff --git a/src/version.c b/src/version.c
index 7e5b3cdd51..2b5dc454e5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    407,
 /**/
     406,
 /**/

From 9cab7b4b59eca69269bb72b534fc88a628d3b6d8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 18:13:03 +0200
Subject: [PATCH 048/473] Added tag v7-4-407 for changeset 3f92ef156c66

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e3c925d0ee..2a493eabdc 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3129,3 +3129,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 0242c27e40e1ce913ec2b6540371d5ea5fceeac9 v7-4-404
 4c25af735304ff17a27bb3ce21e7f7d3b304ff88 v7-4-405
 1134bba900c17abcecdc414c6e30da22c17d32a5 v7-4-406
+3f92ef156c664fb8fea1f036a4a4c87af487ba6b v7-4-407

From 4465c9a0cd0cdc5f4ede329f516d5c8b9a138153 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 18:36:43 +0200
Subject: [PATCH 049/473] updated for version 7.4.408 Problem:    Visual block
 insert breaks a multi-byte character. Solution:   Calculate the position
 properly. (Yasuhiro Matsumoto)

---
 src/ops.c                  | 20 ++++++++++++++++++++
 src/testdir/Make_amiga.mak | 16 +++++++++-------
 src/testdir/Make_dos.mak   |  9 +++++----
 src/testdir/Make_ming.mak  |  9 +++++----
 src/testdir/Make_os2.mak   |  5 +++--
 src/testdir/Make_vms.mms   | 11 ++++++-----
 src/testdir/Makefile       |  9 +++++----
 src/version.c              |  2 ++
 8 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/src/ops.c b/src/ops.c
index 2b400916f7..86408a4944 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -609,6 +609,26 @@ block_insert(oap, s, b_insert, bdp)
 	    }
 	}
 
+#ifdef FEAT_MBYTE
+	if (has_mbyte && spaces > 0)
+	{
+	    /* Avoid starting halfway a multi-byte character. */
+	    if (b_insert)
+	    {
+		int off = (*mb_head_off)(oldp, oldp + offset + spaces);
+		spaces -= off;
+		count -= off;
+	    }
+	    else
+	    {
+		int off = (*mb_off_next)(oldp, oldp + offset);
+		offset += off;
+		spaces = 0;
+		count = 0;
+	    }
+	}
+#endif
+
 	newp = alloc_check((unsigned)(STRLEN(oldp)) + s_len + count + 1);
 	if (newp == NULL)
 	    continue;
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 030542430c..5012812448 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -38,13 +38,14 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test104.out test105.out test106.out test107.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
-		test_listlbr.out \
-		test_listlbr_utf8.out \
-		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
 		test_insertcount.out \
-		test_options.out
+		test_listlbr.out \
+		test_listlbr_utf8.out \
+		test_options.out \
+		test_qf_title.out \
+		test_utf8.out
 
 .SUFFIXES: .in .out
 
@@ -170,10 +171,11 @@ test106.out: test106.in
 test107.out: test107.in
 test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
-test_listlbr.out: test_listlbr.in
-test_listlbr_utf8.out: test_listlbr_utf8.in
-test_qf_title.out: test_qf_title.in
 test_changelist.out: test_changelist.in
 test_eval.out: test_eval.in
 test_insertcount.out: test_insertcount.in
+test_listlbr.out: test_listlbr.in
+test_listlbr_utf8.out: test_listlbr_utf8.in
 test_options.out: test_options.in
+test_qf_title.out: test_qf_title.in
+test_utf8.out: test_utf8.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 232e8809d3..cd7aa4d487 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -37,13 +37,14 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test105.out test106.out  test107.out\
 		test_autoformat_join.out \
 		test_breakindent.out \
-		test_listlbr.out \
-		test_listlbr_utf8.out \
-		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
 		test_insertcount.out \
-		test_options.out
+		test_listlbr.out \
+		test_listlbr_utf8.out \
+		test_options.out \
+		test_qf_title.out \
+		test_utf8.out
 
 SCRIPTS32 =	test50.out test70.out
 
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index eb533c9d0b..782f89d646 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -57,13 +57,14 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test105.out test106.out test107.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
-		test_listlbr.out \
-		test_listlbr_utf8.out \
-		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
 		test_insertcount.out \
-		test_options.out
+		test_listlbr.out \
+		test_listlbr_utf8.out \
+		test_options.out \
+		test_qf_title.out \
+		test_utf8.out
 
 SCRIPTS32 =	test50.out test70.out
 
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 0bd0096061..d3e833793a 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -38,14 +38,15 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
 		test_autoformat_join.out \
+		test_breakindent.out \
 		test_changelist.out \
 		test_eval.out \
 		test_insertcount.out \
-		test_breakindent.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_options.out \
 		test_qf_title.out \
-		test_options.out
+		test_utf8.out
 
 .SUFFIXES: .in .out
 
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 7ccdf24e72..3c7afc346d 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Jul 30
+# Last change:  2014 Aug 16
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -98,13 +98,14 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test105.out test106.out test107.out \
 	 test_autoformat_join.out \
 	 test_breakindent.out \
-	 test_listlbr.out \
-	 test_listlbr_utf8.out \
-	 test_qf_title.out \
 	 test_changelist.out \
 	 test_eval.out \
 	 test_insertcount.out \
-	 test_options.out
+	 test_listlbr.out \
+	 test_listlbr_utf8.out \
+	 test_options.out \
+	 test_qf_title.out \
+	 test_utf8.out
 
 # Known problems:
 # test17: ?
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index f2b2216378..59fe011696 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -35,13 +35,14 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test104.out test105.out test106.out test107.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
-		test_listlbr.out \
-		test_listlbr_utf8.out \
-		test_qf_title.out \
 		test_changelist.out \
 		test_eval.out \
 		test_insertcount.out \
-		test_options.out
+		test_listlbr.out \
+		test_listlbr_utf8.out \
+		test_options.out \
+		test_qf_title.out \
+		test_utf8.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/version.c b/src/version.c
index 2b5dc454e5..4a876b5c72 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    408,
 /**/
     407,
 /**/

From 89c9fc0fe4e697a57a7bf395d990ceeed5137993 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 18:36:43 +0200
Subject: [PATCH 050/473] Added tag v7-4-408 for changeset cb3218a69c2f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2a493eabdc..8f2b08a461 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3130,3 +3130,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 4c25af735304ff17a27bb3ce21e7f7d3b304ff88 v7-4-405
 1134bba900c17abcecdc414c6e30da22c17d32a5 v7-4-406
 3f92ef156c664fb8fea1f036a4a4c87af487ba6b v7-4-407
+cb3218a69c2f0949bbff5bcf9beeccc83ef2ef59 v7-4-408

From 8df6936d0087f9980348c3a9db2341152533ebe3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 16 Aug 2014 19:45:02 +0200
Subject: [PATCH 051/473] Add files missing from 7.4.408.

---
 src/testdir/test_utf8.in | 18 ++++++++++++++++++
 src/testdir/test_utf8.ok |  4 ++++
 2 files changed, 22 insertions(+)
 create mode 100644 src/testdir/test_utf8.in
 create mode 100644 src/testdir/test_utf8.ok

diff --git a/src/testdir/test_utf8.in b/src/testdir/test_utf8.in
new file mode 100644
index 0000000000..713fee2c8f
--- /dev/null
+++ b/src/testdir/test_utf8.in
@@ -0,0 +1,18 @@
+Tests for Unicode manipulations                vim: set ft=vim :
+ 
+STARTTEST
+:so small.vim
+:set encoding=utf-8
+:" Visual block Insert adjusts for multi-byte char
+:new
+:call setline(1, ["aaa", "あああ", "bbb"])
+:exe ":norm! gg0l\<C-V>jjIx\<Esc>"
+:let r = getline(1, '$')
+:
+:bwipeout!
+:$put=r
+:call garbagecollect(1)
+:/^start:/,$wq! test.out
+ENDTEST
+ 
+start:
diff --git a/src/testdir/test_utf8.ok b/src/testdir/test_utf8.ok
new file mode 100644
index 0000000000..c5bed54856
--- /dev/null
+++ b/src/testdir/test_utf8.ok
@@ -0,0 +1,4 @@
+start:
+axaa
+xあああ
+bxbb

From 772ee83f1e460d73792a460eba253f070ed6f7be Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 17 Aug 2014 17:05:44 +0200
Subject: [PATCH 052/473] updated for version 7.4.409 Problem:    Can't build
 with Perl on Fedora 20. Solution:   Find xsubpp in another directory.
 (Michael Henry)

---
 src/Makefile       | 2 +-
 src/auto/configure | 9 +++++++++
 src/config.mk.in   | 3 ++-
 src/configure.in   | 8 ++++++++
 src/version.c      | 2 ++
 5 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 772b15c7d6..64691a39bc 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2477,7 +2477,7 @@ lintinstall:
 
 auto/if_perl.c: if_perl.xs
 	$(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@
-	$(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
+	$(PERL) $(PERL_XSUBPP) -prototypes -typemap \
 	    $(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@
 
 auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
diff --git a/src/auto/configure b/src/auto/configure
index 30db8a022f..b0fba306e6 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -687,6 +687,7 @@ PERL_PRO
 PERL_OBJ
 PERL_SRC
 shrpenv
+vi_cv_perl_xsubpp
 vi_cv_perllib
 vi_cv_path_perl
 MZSCHEME_MZC
@@ -5604,6 +5605,14 @@ $as_echo "OK" >&6; }
       fi
       vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
 
+      vi_cv_perl_extutils=unknown_perl_extutils_path
+      for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
+	xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
+	if test -f "$xsubpp_path"; then
+	  vi_cv_perl_xsubpp="$xsubpp_path"
+	fi
+      done
+
             perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
 	      -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'`
             perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
diff --git a/src/config.mk.in b/src/config.mk.in
index bd5649e4d7..15b5a62390 100644
--- a/src/config.mk.in
+++ b/src/config.mk.in
@@ -48,11 +48,12 @@ MZSCHEME_SRC	= @MZSCHEME_SRC@
 MZSCHEME_OBJ	= @MZSCHEME_OBJ@
 MZSCHEME_CFLAGS	= @MZSCHEME_CFLAGS@
 MZSCHEME_PRO	= @MZSCHEME_PRO@
-MZSCHEME_EXTRA  = @MZSCHEME_EXTRA@
+MZSCHEME_EXTRA	= @MZSCHEME_EXTRA@
 MZSCHEME_MZC	= @MZSCHEME_MZC@
 
 PERL		= @vi_cv_path_perl@
 PERLLIB		= @vi_cv_perllib@
+PERL_XSUBPP	= @vi_cv_perl_xsubpp@
 PERL_LIBS	= @PERL_LIBS@
 SHRPENV		= @shrpenv@
 PERL_SRC	= @PERL_SRC@
diff --git a/src/configure.in b/src/configure.in
index 1cee1e61d1..62785e171c 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -933,6 +933,14 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
       fi
       vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
       AC_SUBST(vi_cv_perllib)
+      vi_cv_perl_extutils=unknown_perl_extutils_path
+      for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
+	xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
+	if test -f "$xsubpp_path"; then
+	  vi_cv_perl_xsubpp="$xsubpp_path"
+	fi
+      done
+      AC_SUBST(vi_cv_perl_xsubpp)
       dnl Remove "-fno-something", it breaks using cproto.
       perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
 	      -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
diff --git a/src/version.c b/src/version.c
index 4a876b5c72..f7084a7cd6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    409,
 /**/
     408,
 /**/

From ef08f0baf0e122515d4e3e298154052b84e46d5e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 17 Aug 2014 17:05:44 +0200
Subject: [PATCH 053/473] Added tag v7-4-409 for changeset de35e123e63c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 8f2b08a461..7880c10481 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3131,3 +3131,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 1134bba900c17abcecdc414c6e30da22c17d32a5 v7-4-406
 3f92ef156c664fb8fea1f036a4a4c87af487ba6b v7-4-407
 cb3218a69c2f0949bbff5bcf9beeccc83ef2ef59 v7-4-408
+de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409

From 98899557b53f039308189a3c7902af3fa0bc32a1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 17 Aug 2014 17:24:07 +0200
Subject: [PATCH 054/473] updated for version 7.4.410 Problem:    Fold does not
 open after search when there is a CmdwinLeave 	    autocommand. Solution:  
 Restore KeyTyped. (Jacob Niehus)

---
 src/ex_getln.c | 14 ++++++++++++++
 src/version.c  |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/ex_getln.c b/src/ex_getln.c
index fcc1d600a6..6ca707e432 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -6363,6 +6363,9 @@ ex_window()
 #ifdef FEAT_RIGHTLEFT
     int			save_cmdmsg_rl = cmdmsg_rl;
 #endif
+#ifdef FEAT_FOLDING
+    int			save_KeyTyped;
+#endif
 
     /* Can't do this recursively.  Can't do it when typing a password. */
     if (cmdwin_type != 0
@@ -6497,8 +6500,19 @@ ex_window()
     RedrawingDisabled = i;
 
 # ifdef FEAT_AUTOCMD
+
+#  ifdef FEAT_FOLDING
+    save_KeyTyped = KeyTyped;
+#  endif
+
     /* Trigger CmdwinLeave autocommands. */
     apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
+
+#  ifdef FEAT_FOLDING
+    /* Restore KeyTyped in case it is modified by autocommands */
+    KeyTyped = save_KeyTyped;
+#  endif
+
 # endif
 
     /* Restore the command line info. */
diff --git a/src/version.c b/src/version.c
index f7084a7cd6..7126b8b9ed 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    410,
 /**/
     409,
 /**/

From d34de707324fa84282221037e0bd77c824eac972 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 17 Aug 2014 17:24:07 +0200
Subject: [PATCH 055/473] Added tag v7-4-410 for changeset 2fd550c75256

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7880c10481..e06b455e17 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3132,3 +3132,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 3f92ef156c664fb8fea1f036a4a4c87af487ba6b v7-4-407
 cb3218a69c2f0949bbff5bcf9beeccc83ef2ef59 v7-4-408
 de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409
+2fd550c75256cc1ecf06a4afc6a856b305cf7a8a v7-4-410

From b66c1d528361c62efeeac810d4a48ec00d48628a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 13:13:27 +0200
Subject: [PATCH 056/473] updated for version 7.4.411 Problem:    "foo bar"
 sorts before "foo" with sort(). (John Little) Solution:   Avoid putting
 quotes around strings before comparing them.

---
 src/eval.c    | 32 +++++++++++++++++++++++++++-----
 src/version.c |  2 ++
 2 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index ae8331d5aa..654e4187d5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -17382,16 +17382,38 @@ item_compare(s1, s2)
     const void	*s2;
 {
     sortItem_T  *si1, *si2;
+    typval_T	*tv1, *tv2;
     char_u	*p1, *p2;
-    char_u	*tofree1, *tofree2;
+    char_u	*tofree1 = NULL, *tofree2 = NULL;
     int		res;
     char_u	numbuf1[NUMBUFLEN];
     char_u	numbuf2[NUMBUFLEN];
 
     si1 = (sortItem_T *)s1;
     si2 = (sortItem_T *)s2;
-    p1 = tv2string(&si1->item->li_tv, &tofree1, numbuf1, 0);
-    p2 = tv2string(&si2->item->li_tv, &tofree2, numbuf2, 0);
+    tv1 = &si1->item->li_tv;
+    tv2 = &si2->item->li_tv;
+    /* tv2string() puts quotes around a string and allocates memory.  Don't do
+     * that for string variables. Use a single quote when comparing with a
+     * non-string to do what the docs promise. */
+    if (tv1->v_type == VAR_STRING)
+    {
+	if (tv2->v_type != VAR_STRING || item_compare_numeric)
+	    p1 = (char_u *)"'";
+	else
+	    p1 = tv1->vval.v_string;
+    }
+    else
+	p1 = tv2string(tv1, &tofree1, numbuf1, 0);
+    if (tv2->v_type == VAR_STRING)
+    {
+	if (tv1->v_type != VAR_STRING || item_compare_numeric)
+	    p2 = (char_u *)"'";
+	else
+	    p2 = tv2->vval.v_string;
+    }
+    else
+	p2 = tv2string(tv2, &tofree2, numbuf2, 0);
     if (p1 == NULL)
 	p1 = (char_u *)"";
     if (p2 == NULL)
@@ -17411,8 +17433,8 @@ item_compare(s1, s2)
 	res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1;
     }
 
-    /* When the result would be zero, compare the pointers themselves.  Makes
-     * the sort stable. */
+    /* When the result would be zero, compare the item indexes.  Makes the
+     * sort stable. */
     if (res == 0 && !item_compare_keep_zero)
 	res = si1->idx > si2->idx ? 1 : -1;
 
diff --git a/src/version.c b/src/version.c
index 7126b8b9ed..93660b44b5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    411,
 /**/
     410,
 /**/

From 714f65b85ced4fa1aa87bfd73099ad4c16acf24a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 13:13:28 +0200
Subject: [PATCH 057/473] Added tag v7-4-411 for changeset d4e0c197e979

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e06b455e17..949232fd41 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3133,3 +3133,4 @@ ab71bb81b84e9a1cdf030b172f61d779ccda975c v7-4-401
 cb3218a69c2f0949bbff5bcf9beeccc83ef2ef59 v7-4-408
 de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409
 2fd550c75256cc1ecf06a4afc6a856b305cf7a8a v7-4-410
+d4e0c197e97968050596f4c441552383e31db63b v7-4-411

From d46f8654adcc4a83ef3c3cef4f3f20961eeb012f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 18:12:57 +0200
Subject: [PATCH 058/473] updated for version 7.4.412 Problem:    Can't build
 on Windows XP with MSVC. Solution:   Add SUBSYSTEM_VER to the Makefile.
 (Yongwei Wu)

---
 src/INSTALLpc.txt | 24 ++++++++++++++++++++++++
 src/Make_mvc.mak  |  4 ++++
 src/version.c     |  2 ++
 3 files changed, 30 insertions(+)

diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 7ba2801b0a..370c208eec 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -192,6 +192,30 @@ To set the environment execute the msvc2010.bat script.  You can then build
 Vim with Make_mvc.mak.
 
 
+Targeting Windows XP with new MSVC      *new-msvc-windows-xp*
+----------------------------------
+
+Beginning with Visual C++ 2010, Microsoft changed the behavior of LINK.EXE
+so that it targets Windows 6.0 (Vista) by default.  In order to override
+this, the target Windows version number needs to be passed to LINK like
+follows:
+    LINK ... /subsystem:console,5.01
+
+Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
+Use lines like follows to target Windows XP (assuming using Visual C++ 2012
+under 64-bit Windows):
+    set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
+    set SDK_INCLUDE_DIR=%WinSdk71%\Include
+    set INCLUDE=%WinSdk71%\Include;%INCLUDE%
+    set LIB=%WinSdk71%\Lib;%LIB%
+    set PATH=%WinSdk71%\Bin;%PATH%
+    set CL=/D_USING_V110_SDK71_
+    nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
+
+The following Visual C++ team blog can serve as a reference page:
+    http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
+
+
 2. MinGW
 ========
 
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index c93f4b4aaa..31bcd68440 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -657,6 +657,10 @@ GUI_LIB = \
 SUBSYSTEM = console
 !endif
 
+!if "$(SUBSYSTEM_VER)" != ""
+SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
+!endif
+
 !if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
 CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
 GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
diff --git a/src/version.c b/src/version.c
index 93660b44b5..40b7ae483a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    412,
 /**/
     411,
 /**/

From 73f2047802a041e857318a344ca6f20e722c02dd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 18:12:57 +0200
Subject: [PATCH 059/473] Added tag v7-4-412 for changeset 4c845a1600d2

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 949232fd41..220b11b517 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3134,3 +3134,4 @@ cb3218a69c2f0949bbff5bcf9beeccc83ef2ef59 v7-4-408
 de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409
 2fd550c75256cc1ecf06a4afc6a856b305cf7a8a v7-4-410
 d4e0c197e97968050596f4c441552383e31db63b v7-4-411
+4c845a1600d28db8edabd211e6d7a9cd03883ea6 v7-4-412

From ac2e2f686ba09fff3efd89a61073411d5ac51f1c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 18:44:33 +0200
Subject: [PATCH 060/473] updated for version 7.4.413 Problem:    MS-Windows:
 Using US international keyboard layout, inserting dead 	    key by
 pressing space does not always work.  Issue 250. Solution:   Let MS-Windows
 translate the message. (John Wellesz)

---
 src/gui_w48.c | 31 +++++++++++++++----------------
 src/version.c |  2 ++
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/src/gui_w48.c b/src/gui_w48.c
index ae4c921c0d..cd7fdde549 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -614,6 +614,8 @@ _OnChar(
     char_u	string[40];
     int		len = 0;
 
+    dead_key = 0;
+
     len = char_to_string(ch, string, 40, FALSE);
     if (len == 1 && string[0] == Ctrl_C && ctrl_c_interrupts)
     {
@@ -1788,24 +1790,21 @@ process_message(void)
     if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN)
     {
 	vk = (int) msg.wParam;
-	/* handle key after dead key, but ignore shift, alt and control */
-	if (dead_key && vk != VK_SHIFT && vk != VK_MENU && vk != VK_CONTROL)
+	/*
+	 * If a dead key was pressed and the user presses VK_SPACE, VK_BACK, or
+	 * VK_ESCAPE it means that he actually wants to deal with the dead char
+	 * now, so do nothing special and let Windows handle it.
+	 *
+	 * Note that VK_SPACE combines with the dead_key's character and only
+	 * one WM_CHAR will be generated by TranslateMessage(), in the two
+	 * other cases two WM_CHAR will be generated: the dead char and VK_BACK
+	 * or VK_ESCAPE.  That is most likely what the user expects.
+	 */
+	if (dead_key && (vk == VK_SPACE || vk == VK_BACK || vk == VK_ESCAPE))
 	{
 	    dead_key = 0;
-	    /* handle non-alphabetic keys (ones that hopefully cannot generate
-	     * umlaut-characters), unless when control is down */
-	    if (vk < 'A' || vk > 'Z' || (GetKeyState(VK_CONTROL) & 0x8000))
-	    {
-		MSG dm;
-
-		dm.message = msg.message;
-		dm.hwnd = msg.hwnd;
-		dm.wParam = VK_SPACE;
-		MyTranslateMessage(&dm);	/* generate dead character */
-		if (vk != VK_SPACE) /* and send current character once more */
-		    PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
-		return;
-	    }
+	    MyTranslateMessage(&msg);
+	    return;
 	}
 
 	/* Check for CTRL-BREAK */
diff --git a/src/version.c b/src/version.c
index 40b7ae483a..e742d187c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    413,
 /**/
     412,
 /**/

From cdf6a68a0ddee86e0322c258d824636fc2273ff1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 18:44:34 +0200
Subject: [PATCH 061/473] Added tag v7-4-413 for changeset 121613e72e39

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 220b11b517..5b3ad613ec 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3135,3 +3135,4 @@ de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409
 2fd550c75256cc1ecf06a4afc6a856b305cf7a8a v7-4-410
 d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 4c845a1600d28db8edabd211e6d7a9cd03883ea6 v7-4-412
+121613e72e397db495f5e9b640b249aead5a61c1 v7-4-413

From 8433901b207803d7ee5158e24cb54140d199c1c8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 19:21:47 +0200
Subject: [PATCH 062/473] Updated runtime files.

---
 runtime/autoload/phpcomplete.vim | 121 +++++-
 runtime/compiler/go.vim          |  29 ++
 runtime/doc/cmdline.txt          |   5 +-
 runtime/doc/eval.txt             |  16 +-
 runtime/doc/insert.txt           |   4 +-
 runtime/doc/options.txt          |   2 +-
 runtime/doc/pattern.txt          |  19 +-
 runtime/doc/quickref.txt         |   3 +-
 runtime/doc/tags                 |   5 +
 runtime/doc/todo.txt             |  94 +++--
 runtime/doc/usr_41.txt           |   3 +-
 runtime/doc/various.txt          |   2 +-
 runtime/filetype.vim             |   7 +-
 runtime/ftplugin/go.vim          |  18 +
 runtime/ftplugin/vroom.vim       |   2 +-
 runtime/indent/go.vim            |  78 ++++
 runtime/indent/sh.vim            |   6 +-
 runtime/indent/vroom.vim         |   2 +-
 runtime/optwin.vim               |   6 +-
 runtime/synmenu.vim              |   3 +-
 runtime/syntax/gnuplot.vim       | 672 +++++++++++++++++++++++--------
 runtime/syntax/go.vim            | 208 ++++++++++
 runtime/syntax/godoc.vim         |  21 +
 runtime/syntax/vroom.vim         |   2 +-
 runtime/tutor/tutor.es.utf-8     |   2 +-
 runtime/tutor/tutor.fr           |   4 +-
 runtime/tutor/tutor.fr.utf-8     |   4 +-
 runtime/tutor/tutor.ja.euc       |   7 +-
 runtime/tutor/tutor.ja.sjis      |   7 +-
 runtime/tutor/tutor.ja.utf-8     |   7 +-
 runtime/tutor/tutor.pt           |   4 +-
 runtime/tutor/tutor.pt.utf-8     |   4 +-
 runtime/tutor/tutor.utf-8        |   4 +-
 runtime/tutor/tutor.zh.big5      |   4 +-
 runtime/tutor/tutor.zh.euc       |   4 +-
 runtime/tutor/tutor.zh.utf-8     |   4 +-
 runtime/tutor/tutor.zh_cn.utf-8  |   4 +-
 runtime/tutor/tutor.zh_tw.utf-8  |   4 +-
 38 files changed, 1120 insertions(+), 271 deletions(-)
 create mode 100644 runtime/compiler/go.vim
 create mode 100644 runtime/ftplugin/go.vim
 create mode 100644 runtime/indent/go.vim
 create mode 100644 runtime/syntax/go.vim
 create mode 100644 runtime/syntax/godoc.vim

diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index 0bdcd5d5fb..c00e55cc1e 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
 " Maintainer:	Dávid Szabó ( complex857 AT gmail DOT com )
 " Previous Maintainer:	Mikolaj Machowski ( mikmach AT wp DOT pl )
 " URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change:  2014 May 30
+" Last Change:  2014 Jul 24
 "
 "	OPTIONS:
 "
@@ -277,7 +277,7 @@ endfunction
 " }}}
 
 function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
-	" Complete everything else -
+	" Complete everything
 	"  + functions,  DONE
 	"  + keywords of language DONE
 	"  + defines (constant definitions), DONE
@@ -949,12 +949,11 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
 		endif
 	endfor
 
-	let jvars = join(variables, ' ')
-	let svars = split(jvars, '\$')
+	let static_vars = split(join(variables, ' '), '\$')
 	let c_variables = {}
 
 	let var_index = 0
-	for i in svars
+	for i in static_vars
 		let c_var = matchstr(i,
 					\ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
 		if c_var != ''
@@ -1083,7 +1082,6 @@ endfunction
 " }}}
 
 function! phpcomplete#GetTaglist(pattern) " {{{
-
 	let cache_checksum = ''
 	if g:phpcomplete_cache_taglists == 1
 		" build a string with  format of "<tagfile>:<mtime>$<tagfile2>:<mtime2>..."
@@ -1447,6 +1445,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 	" Get class name
 	" Class name can be detected in few ways:
 	" @var $myVar class
+	" @var class $myVar
 	" in the same line (php 5.4 (new Class)-> syntax)
 	" line above
 	" or line in tags file
@@ -1525,6 +1524,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 		let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0)
 		let object = matchstr(object, variable_name_pattern)
 
+		let function_boundary = phpcomplete#GetCurrentFunctionBoundaries()
+		let search_end_line = max([1, function_boundary[0][0]])
+		" -1 makes us ignore the current line (where the completion was invoked
+		let lines = reverse(getline(search_end_line, line('.') - 1))
+
 		" check Constant lookup
 		let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
 		if constant_object != ''
@@ -1533,21 +1537,20 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 
 		if classname_candidate == ''
 			" scan the file backwards from current line for explicit type declaration (@var $variable Classname)
-			let i = 1 " start from the current line - 1
-			while i < a:start_line
-				let line = getline(a:start_line - i)
+			for line in lines
 				" in file lookup for /* @var $foo Class */
 				if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern
 					let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?')
 					let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
 					break
-				elseif line !~ '^\s*$'
-					" type indicator comments should be next to the variable
-					" non empty lines break the search
+				endif
+				" in file lookup for /* @var Class $foo */
+				if line =~# '@var\s\+'.class_name_pattern.'\s\+'.object
+					let classname_candidate = matchstr(line, '@var\s\+\zs'.class_name_pattern.'\(\[\]\)\?\ze'.'\s\+'.object)
+					let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
 					break
 				endif
-				let i += 1
-			endwhile
+			endfor
 		endif
 
 		if classname_candidate != ''
@@ -1555,12 +1558,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 			" return absolute classname, without leading \
 			return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
 		endif
-
 		" scan the file backwards from the current line
 		let i = 1
-		while i < a:start_line " {{{
-			let line = getline(a:start_line - i)
-
+		for line in lines " {{{
 			" do in-file lookup of $var = new Class
 			if line =~# '^\s*'.object.'\s*=\s*new\s\+'.class_name_pattern && !object_is_array
 				let classname_candidate = matchstr(line, object.'\c\s*=\s*new\s*\zs'.class_name_pattern.'\ze')
@@ -1722,7 +1722,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 			endif
 
 			let i += 1
-		endwhile " }}}
+		endfor " }}}
 
 		if classname_candidate != ''
 			let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
@@ -1962,7 +1962,9 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
 			let namespace = '\'
 		endif
 		let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
-		if classlocation != '' && filereadable(classlocation)
+		if classlocation == "VIMPHP_BUILTINOBJECT"
+			let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
+		elseif classlocation != '' && filereadable(classlocation)
 			let full_file_path = fnamemodify(classlocation, ':p')
 			let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
 		elseif tolower(current_namespace) == tolower(namespace)
@@ -1985,6 +1987,51 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
 endfunction
 " }}}
 
+function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
+	let re = 'class '.a:class_info['name']." {"
+	for [name, initializer] in items(a:class_info.constants)
+		let re .= "\n\tconst ".name." = ".initializer.";"
+	endfor
+	for [name, info] in items(a:class_info.properties)
+		let re .= "\n\t// @var $".name." ".info.type
+		let re .= "\n\tpublic $".name.";"
+	endfor
+	for [name, info] in items(a:class_info.static_properties)
+		let re .= "\n\t// @var ".name." ".info.type
+		let re .= "\n\tpublic static ".name." = ".info.initializer.";"
+	endfor
+	for [name, info] in items(a:class_info.methods)
+		if name =~ '^__'
+			continue
+		endif
+		let re .= "\n\t/**"
+		let re .= "\n\t * ".name
+		let re .= "\n\t *"
+		let re .= "\n\t * @return ".info.return_type
+		let re .= "\n\t */"
+		let re .= "\n\tpublic function ".name."(".info.signature."){"
+		let re .= "\n\t}"
+	endfor
+	for [name, info] in items(a:class_info.static_methods)
+		let re .= "\n\t/**"
+		let re .= "\n\t * ".name
+		let re .= "\n\t *"
+		let re .= "\n\t * @return ".info.return_type
+		let re .= "\n\t */"
+		let re .= "\n\tpublic static function ".name."(".info.signature."){"
+		let re .= "\n\t}"
+	endfor
+	let re .= "\n}"
+
+	return { 'class': a:class_info['name'],
+				\ 'content': re,
+				\ 'namespace': '',
+				\ 'imports': {},
+				\ 'file': 'VIMPHP_BUILTINOBJECT',
+				\ 'mtime': 0,
+				\ }
+endfunction " }}}
+
 function! phpcomplete#GetDocBlock(sccontent, search) " {{{
 	let i = 0
 	let l = 0
@@ -2307,6 +2354,40 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
 endfunction
 " }}}
 
+function! phpcomplete#GetCurrentFunctionBoundaries() " {{{
+	let old_cursor_pos = [line('.'), col('.')]
+	let current_line_no = old_cursor_pos[0]
+	let function_pattern = '\c\(.*\%#\)\@!\_^\s*\zs\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\_.\{-}(\_.\{-})\_.\{-}{'
+
+	let func_start_pos = searchpos(function_pattern, 'Wbc')
+	if func_start_pos == [0, 0]
+		call cursor(old_cursor_pos[0], old_cursor_pos[1])
+		return 0
+	endif
+
+	" get the line where the function declaration actually started
+	call search('\cfunction\_.\{-}(\_.\{-})\_.\{-}{', 'Wce')
+
+	" get the position of the function block's closing "}"
+	let func_end_pos = searchpairpos('{', '', '}', 'W')
+	if func_end_pos == [0, 0]
+		" there is a function start but no end found, assume that we are in a
+		" function but the user did not typed the closing "}" yet and the
+		" function runs to the end of the file
+		let func_end_pos = [line('$'), len(getline(line('$')))]
+	endif
+
+	" Decho func_start_pos[0].' <= '.current_line_no.' && '.current_line_no.' <= '.func_end_pos[0]
+	if func_start_pos[0] <= current_line_no && current_line_no <= func_end_pos[0]
+		call cursor(old_cursor_pos[0], old_cursor_pos[1])
+		return [func_start_pos, func_end_pos]
+	endif
+
+	call cursor(old_cursor_pos[0], old_cursor_pos[1])
+	return 0
+endfunction
+" }}}
+
 function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
 	" if there's an imported class, just use that class's information
 	if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')
diff --git a/runtime/compiler/go.vim b/runtime/compiler/go.vim
new file mode 100644
index 0000000000..cf638f23d6
--- /dev/null
+++ b/runtime/compiler/go.vim
@@ -0,0 +1,29 @@
+" Vim compiler file
+" Compiler:	Go
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-go)
+" Last Change:	2014 Aug 16
+
+if exists('current_compiler')
+  finish
+endif
+let current_compiler = 'go'
+
+if exists(':CompilerSet') != 2
+  command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:save_cpo = &cpo
+set cpo-=C
+
+CompilerSet makeprg=go\ build
+CompilerSet errorformat=
+    \%-G#\ %.%#,
+    \%A%f:%l:%c:\ %m,
+    \%A%f:%l:\ %m,
+    \%C%*\\s%m,
+    \%-G%.%#
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index f58389af8c..a31f7107f5 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,4 +1,4 @@
-*cmdline.txt*   For Vim version 7.4.  Last change: 2014 Feb 23
+*cmdline.txt*   For Vim version 7.4.  Last change: 2014 Aug 16
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1084,6 +1084,9 @@ another window, or drag statuslines of other windows.  You can drag the
 statusline of the command-line window itself and the statusline above it.
 Thus you can resize the command-line window, but not others.
 
+The |getcmdwintype()| function returns the type of the command-line being
+edited as described in |cmdwin-char|.
+
 
 AUTOCOMMANDS
 
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 62aa167041..28cbb927b9 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Jul 19
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Aug 16
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1807,7 +1807,8 @@ getchar( [expr])		Number	get one character from the user
 getcharmod( )			Number	modifiers for the last typed character
 getcmdline()			String	return the current command-line
 getcmdpos()			Number	return cursor position in command-line
-getcmdtype()			String	return the current command-line type
+getcmdtype()			String	return current command-line type
+getcmdwintype()			String	return current command-line window type
 getcurpos()			List	position of the cursor
 getcwd()			String	the current working directory
 getfontname( [{name}])		String	name of font being used
@@ -2112,8 +2113,8 @@ argidx()	The result is the current index in the argument list.  0 is
 arglistid([{winnr}, [ {tabnr} ]])
 		Return the argument list ID.  This is a number which
 		identifies the argument list being used.  Zero is used for the
-		global argument list.
-		Return zero if the arguments are invalid.
+		global argument list.  See |arglist|.
+		Return -1 if the arguments are invalid.
 
 		Without arguments use the current window.
 		With {winnr} only use this window in the current tab page.
@@ -3349,6 +3350,11 @@ getcmdtype()						*getcmdtype()*
 		Returns an empty string otherwise.
 		Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.
 
+getcmdwintype()						*getcmdwintype()*
+		Return the current |command-line-window| type. Possible return
+		values are the same as |getcmdtype()|. Returns an empty string
+		when not in the command-line window.
+
 							*getcurpos()*
 getcurpos()	Get the position of the cursor.  This is like getpos('.'), but
 		includes an extra item in the list:
@@ -3359,7 +3365,7 @@ getcurpos()	Get the position of the cursor.  This is like getpos('.'), but
 			let save_cursor = getcurpos()
 			MoveTheCursorAround
 			call setpos('.', save_cursor)
-
+<
 							*getcwd()*
 getcwd()	The result is a String, which is the name of the current
 		working directory.
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 4136c91898..2a114bc095 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.4.  Last change: 2014 Jul 06
+*insert.txt*    For Vim version 7.4.  Last change: 2014 Aug 04
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -51,6 +51,8 @@ char		action	~
 		abbreviation.
 		Note: If your <Esc> key is hard to hit on your keyboard, train
 		yourself to use CTRL-[.
+		If Esc doesn't work and you are using a Mac, try CTRL-Esc.
+		Or disable Listening under Accessibility preferences.
 						*i_CTRL-C*
 CTRL-C		Quit insert mode, go back to Normal mode.  Do not check for
 		abbreviations.  Does not trigger the |InsertLeave| autocommand
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 9d9cb1f937..2dcfa19e48 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.4.  Last change: 2014 Jul 23
+*options.txt*	For Vim version 7.4.  Last change: 2014 Aug 09
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 207a43d87f..f66ac170ae 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.4.  Last change: 2014 May 28
+*pattern.txt*   For Vim version 7.4.  Last change: 2014 Jul 30
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -706,11 +706,18 @@ overview.
 	But to limit the time needed, only the line where what follows matches
 	is searched, and one line before that (if there is one).  This should
 	be sufficient to match most things and not be too slow.
-	The part of the pattern after "\@<=" and "\@<!" are checked for a
-	match first, thus things like "\1" don't work to reference \(\) inside
-	the preceding atom.  It does work the other way around:
-	Example			matches ~
-	\1\@<=,\([a-z]\+\)	",abc" in "abc,abc"
+
+	In the old regexp engine the part of the pattern after "\@<=" and
+	"\@<!" are checked for a match first, thus things like "\1" don't work
+	to reference \(\) inside the preceding atom.  It does work the other
+	way around:
+	Bad example			matches ~
+	\%#=1\1\@<=,\([a-z]\+\)		",abc" in "abc,abc"
+
+	However, the new regexp engine works differently, it is better to not
+	rely on this behavior, do not use \@<= if it can be avoided:
+	Example				matches ~
+	\([a-z]\+\)\zs,\1		",abc" in "abc,abc"
 
 \@123<=
 	Like "\@<=" but only look back 123 bytes. This avoids trying lots
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 79d87fa915..096921f003 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt*  For Vim version 7.4.  Last change: 2014 Jun 25
+*quickref.txt*  For Vim version 7.4.  Last change: 2014 Aug 06
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -831,6 +831,7 @@ Short explanation of each option:		*option-list*
 'regexpengine'	  're'	    default regexp engine to use
 'relativenumber'  'rnu'	    show relative line number in front of each line
 'remap'			    allow mappings to work recursively
+'renderoptions'	  'rop'	    options for text rendering on Windows
 'report'		    threshold for reporting nr. of lines changed
 'restorescreen'   'rs'	    Win32: restore screen when exiting
 'revins'	  'ri'	    inserting characters will work backwards
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 5c454c12a4..55f221f480 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -756,6 +756,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 'regexpengine'	options.txt	/*'regexpengine'*
 'relativenumber'	options.txt	/*'relativenumber'*
 'remap'	options.txt	/*'remap'*
+'renderoptions'	options.txt	/*'renderoptions'*
 'report'	options.txt	/*'report'*
 'restorescreen'	options.txt	/*'restorescreen'*
 'revins'	options.txt	/*'revins'*
@@ -766,6 +767,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 'rlc'	options.txt	/*'rlc'*
 'rnu'	options.txt	/*'rnu'*
 'ro'	options.txt	/*'ro'*
+'rop'	options.txt	/*'rop'*
 'rs'	options.txt	/*'rs'*
 'rtp'	options.txt	/*'rtp'*
 'ru'	options.txt	/*'ru'*
@@ -1171,6 +1173,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 +dialog_gui	various.txt	/*+dialog_gui*
 +diff	various.txt	/*+diff*
 +digraphs	various.txt	/*+digraphs*
++directx	various.txt	/*+directx*
 +dnd	various.txt	/*+dnd*
 +emacs_tags	various.txt	/*+emacs_tags*
 +eval	various.txt	/*+eval*
@@ -4902,6 +4905,7 @@ blockwise-operators	visual.txt	/*blockwise-operators*
 blockwise-register	change.txt	/*blockwise-register*
 blockwise-visual	visual.txt	/*blockwise-visual*
 blowfish	options.txt	/*blowfish*
+blowfish2	options.txt	/*blowfish2*
 bold	syntax.txt	/*bold*
 bom-bytes	mbyte.txt	/*bom-bytes*
 book	intro.txt	/*book*
@@ -6138,6 +6142,7 @@ getcharmod()	eval.txt	/*getcharmod()*
 getcmdline()	eval.txt	/*getcmdline()*
 getcmdpos()	eval.txt	/*getcmdpos()*
 getcmdtype()	eval.txt	/*getcmdtype()*
+getcmdwintype()	eval.txt	/*getcmdwintype()*
 getcurpos()	eval.txt	/*getcurpos()*
 getcwd()	eval.txt	/*getcwd()*
 getfontname()	eval.txt	/*getfontname()*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 21f24a7d33..4be7867ef6 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Jul 26
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 22
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -47,31 +47,73 @@ Regexp problems:
 - Does not work with NFA regexp engine:
   \%u, \%x, \%o, \%d followed by a composing character
 - Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
+- Using back reference before the capturing group sometimes works with the old
+  engine, can we do this with the new engine?  E.g. with
+  "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
 
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
+More info Jul 24.  Not clear why.
+
+Patch for:
+    CmdUndefined    - Like FuncUndefined but for user commands.
+Yasuhiro Matsumoto, 2014 Aug 18
 
 Patch to make getregtype() return the right size for non-linux systems.
 (Yasuhiro Matsumoto, 2014 Jul 8)
 Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 
+Patch to fix a problem with breakindent. (Christian Brabandt, 2014 Aug 17)
+It's actually not a breakindent problem. With test: Aug 19.
+With renamed test: Aug 20
+
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-DiffChange highlighting doesn't combine with 'cursurline'. (Benjamin Fritz)
-Patch by Christian (2014 Jul 12)
+ml_get error when using Python, issue 248.
+
+Patch to fix typos in help files. (Dominique, 2014 Aug 9)
 
-BufWinLeave autocommand executed in the wrong buffer? (Davit Samvelyan, 2014
-Jul 14)
+Way to reproduce problem that characters are put on the screen twice in Insert
+mode when using system(). (Jacob Niehus, 2014 Aug 9)
+Related to setting TMODE_COOK.  Perhaps we can omit that for system()?
 
-When 'clipboard' is "unnamed", :g/pat/d is very slow.  Only set the clipboard
-after the last delete? (Praful, 2014 May 28)
-Patch by Christian Brabandt, 2014 Jun 18.  Update Jun 25.
+Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13)
+
+Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show
+up. (Paul Moore, 2014 Jul 30)
+Should it depend on the Windows version?  Waiting for feedback.
+No longer needed after including DirectX patch?
+
+Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
+14)
+    Make ":1close" close the first window.
+    Make ":+1close" close the next window.
+    Make ":-1close" close the previous window.
+Can't easily close the help window, like ":pc" closes the preview window and
+":ccl" closes the quickfix window.  Add ":hclose". (Chris Gaal)
+Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
+
+Patch by Marcin Szamotulski to add +cmd to buffer commands.
+(2014 Aug 18)
+
+Patch to fix that system() with empty input fails. (Olaf Dabrunz, 2014 Aug 19)
+
+When using a visual selection of multiple words and doing CTRL-W_] it jumps to
+the tag matching the word under the cursor, not the selected text.
+(Patrick hemmer)
+Patch by Christian, 2014 Aug 8.
 
 Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
 
+Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
+Prefer the second solution.
+
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
+Patch to add a special key name for K_CURSORHOLD. (Hirohito Higashi, 2014 Aug
+10)
+
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
@@ -79,8 +121,6 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-When using an undo file, also restore the changelist, so that "g;" works.
-
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistant with the documentation.
 
@@ -94,19 +134,12 @@ Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
 Jun 8)
 
-Syntax file for gnuplot.  Existing one is very old. (Andrew Rasmussen, 2014
-Feb 24)
-
-Issue 174: Detect Mason files.
-
 No error for missing endwhile. (ZyX, 2014 Mar 20)
 
-Phpcomplete.vim update. (Complex, 2014 Jan 15)
+Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
 
 PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19)
 
-Patch for matchparen. (James McCoy, 2014 Jul 11)
-
 Spell files use a latin single quote. Unicode also has another single quote:
 0x2019.  (Ron Aaron, 2014 Apr 4)
 New OpenOffice spell files support this with ICONV.  But they are not
@@ -116,8 +149,8 @@ Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
 Also fixes wrong result from executable().
 Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
 
-Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
-More tests May 14. Update May 29.
+Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
+More tests May 14. Update May 29.  Update Aug 10.
 
 The garbage collector may use too much stack.  Make set_ref_in_item()
 iterative instead of recursive.   Test program by Marc Weber (2013 Dec 10)
@@ -215,6 +248,8 @@ command instead of doing this alphabetically. (Mikel Jorgensen)
 
 Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
 
+Patch to get MSVC version in a nicer way. (Ken Takata, 2014 Jul 24)
+
 Patch to make test 100 work on MS-Windows. (Taro Muraoka, 2013 Dec 12)
 
 Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
@@ -230,7 +265,7 @@ Issue 28.
 Go through more coverity reports.
 
 Patch to add ":undorecover", get as much text out of the undo file as
-possible. (Christian Brabandt, 2014 Mar 12)
+possible. (Christian Brabandt, 2014 Mar 12, update Aug 16)
 
 Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
 
@@ -367,7 +402,7 @@ Patch to allow setting w:quickfix_title via setqflist() and setloclist()
 functions. (Christian Brabandt, 2013 May 8, update May 21)
 Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
 Second one. Update May 22.
-Update by Daniel Hahler, 2014 Jul 4.
+Update by Daniel Hahler, 2014 Jul 4, Aug 14.
 
 Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
 
@@ -422,13 +457,6 @@ signs?  Patch by Christian Brabandt, 2013 Aug 22.
 
 Patch to remove flicker from popup menu. (Yasuhiro Matsumoto, 2013 Aug 15)
 
-Patch to use directX to draw text on Windows.  Adds the 'renderoptions'
-option.  (Taro Muraoka, 2013 Jan 25, update 2013 Apr 3, May 14)
-Fixes this problem:
-8   Win32: Multi-byte characters are not displayed, even though the same font
-    in Notepad can display them. (Srinath Avadhanula)  Try with the
-    UTF-8-demo.txt page with Andale Mono.
-
 Patch to add 'completeselect' option.  Specifies how to select a candidate in
 insert completion. (Shougo, 2013 May 29)
 Update to add to existing 'completeopt'. 2013 May 30
@@ -642,6 +670,7 @@ effects?  (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12)
 Would also need to do this for spellbadword() and spellsuggest().
 
 Patch for variable tabstops.  On github (Christian Brabandt, 2014 May 15)
+Update Aug 16 (email).
 
 On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
 64 bits value.  Change all number options to use nropt_T and define it to the
@@ -1349,10 +1378,6 @@ Jul 31)
 C syntax: {} inside () causes following {} to be highlighted as error.
 (Michalis Giannakidis, 2006 Jun 1)
 
-Can't easily close the help window, like ":pc" closes the preview window and
-":ccl" closes the quickfix window.  Add ":hclose". (Chris Gaal)
-Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
-
 When 'diffopt' has "context:0" a single deleted line causes two folds to merge
 and mess up syncing. (Austin Jennings, 2008 Jan 31)
 
@@ -3048,6 +3073,8 @@ Spell checking:
 
 
 Diff mode:
+9   When making small changes, e.g. deleting a character, update the diff.
+    Possibly without running diff.
 9   Instead invoking an external diff program, use builtin code.  One can be
     found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c
     It's quite big and badly documented though.
@@ -3942,7 +3969,6 @@ Autocommands:
 		      when exiting isn't a good idea.
     CursorHoldC     - CursorHold while command-line editing
     WinMoved	    - when windows have been moved around, e.g, ":wincmd J"
-    CmdUndefined    - Like FuncUndefined but for user commands.
     SearchPost	    - After doing a search command (e.g. to do "M")
     PreDirChanged/PostDirChanged
 		    - Before/after ":cd" has been used (for changing the
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index f30b79a2ea..28bdbad896 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -1,4 +1,4 @@
-*usr_41.txt*	For Vim version 7.4.  Last change: 2014 May 28
+*usr_41.txt*	For Vim version 7.4.  Last change: 2014 Aug 16
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -793,6 +793,7 @@ Command line:					*command-line-functions*
 	getcmdpos()		get position of the cursor in the command line
 	setcmdpos()		set position of the cursor in the command line
 	getcmdtype()		return the current command-line type
+	getcmdwintype()		return the current command-line window type
 
 Quickfix and location lists:			*quickfix-functions*
 	getqflist()		list of quickfix errors
diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt
index a03a0bd94a..4ad328773a 100644
--- a/runtime/doc/various.txt
+++ b/runtime/doc/various.txt
@@ -1,4 +1,4 @@
-*various.txt*   For Vim version 7.4.  Last change: 2014 May 22
+*various.txt*   For Vim version 7.4.  Last change: 2014 Aug 06
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index dac44d72af..91afa65a80 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Jul 23
+" Last Change:	2014 Aug 22
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -811,6 +811,9 @@ au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc	setf perl
 " Gnuplot scripts
 au BufNewFile,BufRead *.gpi			setf gnuplot
 
+" Go (Google)
+au BufNewFile,BufRead *.go			setf go
+
 " GrADS scripts
 au BufNewFile,BufRead *.gs			setf grads
 
@@ -1145,7 +1148,7 @@ au BufNewFile,BufRead *.map			setf map
 au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,README.md  setf markdown
 
 " Mason
-au BufNewFile,BufRead *.mason,*.mhtml		setf mason
+au BufNewFile,BufRead *.mason,*.mhtml,*.comp	setf mason
 
 " Matlab or Objective C
 au BufNewFile,BufRead *.m			call s:FTm()
diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim
new file mode 100644
index 0000000000..61dc1a13b7
--- /dev/null
+++ b/runtime/ftplugin/go.vim
@@ -0,0 +1,18 @@
+" Vim filetype plugin file
+" Language:	Go
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-go)
+" Last Change:	2014 Aug 16
+
+if exists('b:did_ftplugin')
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal formatoptions-=t
+
+setlocal comments=s1:/*,mb:*,ex:*/,://
+setlocal commentstring=//\ %s
+
+let b:undo_ftplugin = 'setl fo< com< cms<'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/ftplugin/vroom.vim b/runtime/ftplugin/vroom.vim
index 75f61f7b90..3d9e7835d0 100644
--- a/runtime/ftplugin/vroom.vim
+++ b/runtime/ftplugin/vroom.vim
@@ -1,6 +1,6 @@
 " Vim filetype plugin file
 " Language:	Vroom (vim testing and executable documentation)
-" Maintainer:	David Barnett (https://github.com/google/vim-ft.vroom)
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-vroom)
 " Last Change:	2014 Jul 23
 
 if exists('b:did_ftplugin')
diff --git a/runtime/indent/go.vim b/runtime/indent/go.vim
new file mode 100644
index 0000000000..412ac871c4
--- /dev/null
+++ b/runtime/indent/go.vim
@@ -0,0 +1,78 @@
+" Vim indent file
+" Language:	Go
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-go)
+" Last Change:	2014 Aug 16
+"
+" TODO:
+" - function invocations split across lines
+" - general line splits (line ends in an operator)
+
+if exists('b:did_indent')
+  finish
+endif
+let b:did_indent = 1
+
+" C indentation is too far off useful, mainly due to Go's := operator.
+" Let's just define our own.
+setlocal nolisp
+setlocal autoindent
+setlocal indentexpr=GoIndent(v:lnum)
+setlocal indentkeys+=<:>,0=},0=)
+
+if exists('*GoIndent')
+  finish
+endif
+
+" The shiftwidth() function is relatively new.
+" Don't require it to exist.
+if exists('*shiftwidth')
+  function s:sw() abort
+    return shiftwidth()
+  endfunction
+else
+  function s:sw() abort
+    return &shiftwidth
+  endfunction
+endif
+
+function! GoIndent(lnum)
+  let l:prevlnum = prevnonblank(a:lnum-1)
+  if l:prevlnum == 0
+    " top of file
+    return 0
+  endif
+
+  " grab the previous and current line, stripping comments.
+  let l:prevl = substitute(getline(l:prevlnum), '//.*$', '', '')
+  let l:thisl = substitute(getline(a:lnum), '//.*$', '', '')
+  let l:previ = indent(l:prevlnum)
+
+  let l:ind = l:previ
+
+  if l:prevl =~ '[({]\s*$'
+    " previous line opened a block
+    let l:ind += s:sw()
+  endif
+  if l:prevl =~# '^\s*\(case .*\|default\):$'
+    " previous line is part of a switch statement
+    let l:ind += s:sw()
+  endif
+  " TODO: handle if the previous line is a label.
+
+  if l:thisl =~ '^\s*[)}]'
+    " this line closed a block
+    let l:ind -= s:sw()
+  endif
+
+  " Colons are tricky.
+  " We want to outdent if it's part of a switch ("case foo:" or "default:").
+  " We ignore trying to deal with jump labels because (a) they're rare, and
+  " (b) they're hard to disambiguate from a composite literal key.
+  if l:thisl =~# '^\s*\(case .*\|default\):$'
+    let l:ind -= s:sw()
+  endif
+
+  return l:ind
+endfunction
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index 68f764ee69..0394ee22e8 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -2,7 +2,7 @@
 " Language:         Shell Script
 " Maintainer:       Peter Aronoff <telemachus@arpinum.org>
 " Original Author:  Nikolai Weibull <now@bitwi.se>
-" Latest Revision:  2013-11-28
+" Latest Revision:  2014-08-22
 
 if exists("b:did_indent")
   finish
@@ -91,7 +91,9 @@ function! GetShIndent()
     if s:is_case(pine)
       let ind = indent(lnum) + s:indent_value('case-labels')
     else
-      let ind -= s:indent_value('case-statements') - s:indent_value('case-breaks')
+      let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ?
+                  \ 0 : s:indent_value('case-statements')) -
+                  \ s:indent_value('case-breaks')
     endif
   elseif s:is_case_break(line)
     let ind -= s:indent_value('case-breaks')
diff --git a/runtime/indent/vroom.vim b/runtime/indent/vroom.vim
index 10efb0eb90..d333e2c14e 100644
--- a/runtime/indent/vroom.vim
+++ b/runtime/indent/vroom.vim
@@ -1,6 +1,6 @@
 " Vim indent file
 " Language:	Vroom (vim testing and executable documentation)
-" Maintainer:	David Barnett (https://github.com/google/vim-ft.vroom)
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-vroom)
 " Last Change:	2014 Jul 23
 
 if exists('b:did_indent')
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 0c92f1a791..b51d58bad6 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Apr 01
+" Last Change:	2014 Aug 06
 
 " If there already is an option window, jump to that one.
 if bufwinnr("option-window") > 0
@@ -606,6 +606,10 @@ if has("gui")
     call append("$", "guiheadroom\troom (in pixels) left above/below the window")
     call append("$", " \tset ghr=" . &ghr)
   endif
+  if has("directx")
+    call append("$", "renderoptions\toptions for text rendering")
+    call <SID>OptionG("rop", &rop)
+  endif
   call append("$", "guipty\tuse a pseudo-tty for I/O to external commands")
   call <SID>BinOptionG("guipty", &guipty)
   if has("browse")
diff --git a/runtime/synmenu.vim b/runtime/synmenu.vim
index be88f1c539..2db72a2b60 100644
--- a/runtime/synmenu.vim
+++ b/runtime/synmenu.vim
@@ -2,7 +2,7 @@
 " This file is normally sourced from menu.vim.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2013 Jun 24
+" Last Change:	2014 Aug 13
 
 " Define the SetSyn function, used for the Syntax menu entries.
 " Set 'filetype' and also 'syntax' if it is manually selected.
@@ -326,6 +326,7 @@ an 50.70.270 &Syntax.M.Messages\ (/var/log) :cal SetSyn("messages")<CR>
 an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf")<CR>
 an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp")<CR>
 an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl")<CR>
+an 50.70.305 &Syntax.M.MIX :cal SetSyn("mix")<CR>
 an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix")<CR>
 an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
 an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>
diff --git a/runtime/syntax/gnuplot.vim b/runtime/syntax/gnuplot.vim
index 5a381c7cd6..03d813c99f 100644
--- a/runtime/syntax/gnuplot.vim
+++ b/runtime/syntax/gnuplot.vim
@@ -1,176 +1,505 @@
 " Vim syntax file
-" Language:	gnuplot 3.8i.0
-" Maintainer:	John Hoelzel johnh51@users.sourceforge.net
-" Last Change:	Mon May 26 02:33:33 UTC 2003
-" Filenames:	*.gpi  *.gih   scripts: #!*gnuplot
-" URL:		http://johnh51.get.to/vim/syntax/gnuplot.vim
-"
-
-" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz> for heads up - working on more changes .
-" *.gpi      = GnuPlot Input - what I use because there is no other guideline. jeh 11/2000
-" *.gih      = makes using cut/pasting from gnuplot.gih easier ...
-" #!*gnuplot = for Linux bash shell scripts of gnuplot commands.
-"	       emacs used a suffix of '<gp?>'
-" gnuplot demo files show no preference.
-" I will post mail and newsgroup comments on a standard suffix in 'URL' directory.
-
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
+" Language:	gnuplot 4.7.0
+" Maintainer:	Andrew Rasmussen andyras@users.sourceforge.net
+" Original Maintainer:	John Hoelzel johnh51@users.sourceforge.net
+" Last Change:	2014-02-24
+" Filenames:	*.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot
+" URL:		http://www.vim.org/scripts/script.php?script_id=4873
+" Original URL:	http://johnh51.get.to/vim/syntax/gnuplot.vim
+
+" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz>
+
+" credit also to Jim Eberle <jim.eberle@fastnlight.com>
+" for the script http://www.vim.org/scripts/script.php?script_id=1737
+
+" some shortened names to make demo files look clean... jeh. 11/2000
+" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
+" added current commands, keywords, variables, todos, macros... amr 2014-02-24
+
+" For vim version 5.x: Clear all syntax items
+" For vim version 6.x: Quit when a syntax file was already loaded
+
 if version < 600
   syntax clear
 elseif exists("b:current_syntax")
   finish
 endif
 
-" some shortened names to make demo files look clean... jeh. 11/2000
-" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
+" ---- Special characters ---- "
+
+" no harm in just matching any \[char] within double quotes, right?
+syn match gnuplotSpecial	"\\." contained
+" syn match gnuplotSpecial	"\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[a-z\\]" contained
+
+" measurements in the units in, cm and pt are special
+syn match gnuplotUnit		"[0-9]+in"
+syn match gnuplotUnit		"[0-9]+cm"
+syn match gnuplotUnit		"[0-9]+pt"
+
+" external (shell) commands are special
+syn region gnuplotExternal	start="!" end="$"
+
+" ---- Comments ---- "
+
+syn region gnuplotComment	start="#" end="$" contains=gnuplotTodo
 
-" commands
+" ---- Constants ---- "
 
-syn keyword gnuplotStatement	cd call clear exit set unset plot splot help
-syn keyword gnuplotStatement	load pause quit fit rep[lot] if
-syn keyword gnuplotStatement	FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
-syn keyword gnuplotStatement	FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
-syn keyword gnuplotStatement	print pwd reread reset save show test ! functions var
-syn keyword gnuplotConditional	if
-" if is cond + stmt - ok?
+" strings
+syn region gnuplotString	start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial
+syn region gnuplotString	start="'" end="'"
 
-" numbers fm c.vim
+" built-in variables
+syn keyword gnuplotNumber	GNUTERM GPVAL_TERM GPVAL_TERMOPTIONS GPVAL_SPLOT
+syn keyword gnuplotNumber	GPVAL_OUTPUT GPVAL_ENCODING GPVAL_VERSION
+syn keyword gnuplotNumber	GPVAL_PATCHLEVEL GPVAL_COMPILE_OPTIONS
+syn keyword gnuplotNumber	GPVAL_MULTIPLOT GPVAL_PLOT GPVAL_VIEW_ZSCALE
+syn keyword gnuplotNumber	GPVAL_TERMINALS GPVAL_pi GPVAL_NaN
+syn keyword gnuplotNumber	GPVAL_ERRNO GPVAL_ERRMSG GPVAL_PWD
+syn keyword gnuplotNumber	pi NaN GPVAL_LAST_PLOT GPVAL_TERM_WINDOWID
+syn keyword gnuplotNumber	GPVAL_X_MIN GPVAL_X_MAX GPVAL_X_LOG
+syn keyword gnuplotNumber	GPVAL_DATA_X_MIN GPVAL_DATA_X_MAX GPVAL_Y_MIN
+syn keyword gnuplotNumber	GPVAL_Y_MAX GPVAL_Y_LOG GPVAL_DATA_Y_MIN
+syn keyword gnuplotNumber	GPVAL_DATA_Y_MAX GPVAL_X2_MIN GPVAL_X2_MAX
+syn keyword gnuplotNumber	GPVAL_X2_LOG GPVAL_DATA_X2_MIN GPVAL_DATA_X2_MAX
+syn keyword gnuplotNumber	GPVAL_Y2_MIN GPVAL_Y2_MAX GPVAL_Y2_LOG
+syn keyword gnuplotNumber	GPVAL_DATA_Y2_MIN GPVAL_DATA_Y2_MAX GPVAL_Z_MIN
+syn keyword gnuplotNumber	GPVAL_Z_MAX GPVAL_Z_LOG GPVAL_DATA_Z_MIN
+syn keyword gnuplotNumber	GPVAL_DATA_Z_MAX GPVAL_CB_MIN GPVAL_CB_MAX
+syn keyword gnuplotNumber	GPVAL_CB_LOG GPVAL_DATA_CB_MIN GPVAL_DATA_CB_MAX
+syn keyword gnuplotNumber	GPVAL_T_MIN GPVAL_T_MAX GPVAL_T_LOG GPVAL_U_MIN
+syn keyword gnuplotNumber	GPVAL_U_MAX GPVAL_U_LOG GPVAL_V_MIN GPVAL_V_MAX
+syn keyword gnuplotNumber	GPVAL_V_LOG GPVAL_R_MIN GPVAL_R_LOG
+syn keyword gnuplotNumber	GPVAL_TERM_XMIN GPVAL_TERM_XMAX GPVAL_TERM_YMIN
+syn keyword gnuplotNumber	GPVAL_TERM_YMAX GPVAL_TERM_XSIZE
+syn keyword gnuplotNumber	GPVAL_TERM_YSIZE GPVAL_VIEW_MAP GPVAL_VIEW_ROT_X
+syn keyword gnuplotNumber	GPVAL_VIEW_ROT_Z GPVAL_VIEW_SCALE
 
-"	integer number, or floating point number without a dot and with "f".
+" function name variables
+syn match gnuplotNumber		"GPFUN_[a-zA-Z_]*"
+
+" stats variables
+syn keyword gnuplotNumber	STATS_records STATS_outofrange STATS_invalid
+syn keyword gnuplotNumber	STATS_blank STATS_blocks STATS_columns STATS_min
+syn keyword gnuplotNumber	STATS_max STATS_index_min STATS_index_max
+syn keyword gnuplotNumber	STATS_lo_quartile STATS_median STATS_up_quartile
+syn keyword gnuplotNumber	STATS_mean STATS_stddev STATS_sum STATS_sumsq
+syn keyword gnuplotNumber	STATS_correlation STATS_slope STATS_intercept
+syn keyword gnuplotNumber	STATS_sumxy STATS_pos_min_y STATS_pos_max_y
+syn keyword gnuplotNumber	STATS_mean STATS_stddev STATS_mean_x STATS_sum_x
+syn keyword gnuplotNumber	STATS_stddev_x STATS_sumsq_x STATS_min_x
+syn keyword gnuplotNumber	STATS_max_x STATS_median_x STATS_lo_quartile_x
+syn keyword gnuplotNumber	STATS_up_quartile_x STATS_index_min_x
+syn keyword gnuplotNumber	STATS_index_max_x STATS_mean_y STATS_stddev_y
+syn keyword gnuplotNumber	STATS_sum_y STATS_sumsq_y STATS_min_y
+syn keyword gnuplotNumber	STATS_max_y STATS_median_y STATS_lo_quartile_y
+syn keyword gnuplotNumber	STATS_up_quartile_y STATS_index_min_y
+syn keyword gnuplotNumber	STATS_index_max_y STATS_correlation STATS_sumxy
+
+" deprecated fit variables
+syn keyword gnuplotError	FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
+syn keyword gnuplotError	FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
+
+" numbers, from c.vim
+
+" integer number, or floating point number without a dot and with "f".
 syn case    ignore
 syn match   gnuplotNumber	"\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
-"	floating point number, with dot, optional exponent
+
+" floating point number, with dot, optional exponent
 syn match   gnuplotFloat	"\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
-"	floating point number, starting with a dot, optional exponent
+
+" floating point number, starting with a dot, optional exponent
 syn match   gnuplotFloat	"\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
-"	floating point number, without dot, with exponent
+
+" floating point number, without dot, with exponent
 syn match   gnuplotFloat	"\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
-"	hex number
+
+" hex number
 syn match   gnuplotNumber	"\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
 syn case    match
-"	flag an octal number with wrong digits by not hilighting
+
+" flag an octal number with wrong digits by not highlighting
 syn match   gnuplotOctalError	"\<0[0-7]*[89]"
 
-" plot args
-
-syn keyword gnuplotType		u[sing] tit[le] notit[le] wi[th] steps fs[teps]
-syn keyword gnuplotType		title notitle t
-syn keyword gnuplotType		with w
-syn keyword gnuplotType		li[nes] l
-" t - too much?  w - too much?  l - too much?
-syn keyword gnuplotType		linespoints via
-
-" funcs
-
-syn keyword gnuplotFunc		abs acos acosh arg asin asinh atan atanh atan2
-syn keyword gnuplotFunc		besj0 besj1 besy0 besy1
-syn keyword gnuplotFunc		ceil column cos cosh erf erfc exp floor gamma
-syn keyword gnuplotFunc		ibeta inverf igamma imag invnorm int lgamma
-syn keyword gnuplotFunc		log log10 norm rand real sgn sin sinh sqrt tan
-syn keyword gnuplotFunc		lambertw
-syn keyword gnuplotFunc		tanh valid
-syn keyword gnuplotFunc		tm_hour tm_mday tm_min tm_mon tm_sec
-syn keyword gnuplotFunc		tm_wday tm_yday tm_year
-
-" set vars
-
-syn keyword gnuplotType		xdata timefmt grid noytics ytics fs
-syn keyword gnuplotType		logscale time notime mxtics nomxtics style mcbtics
-syn keyword gnuplotType		nologscale
-syn keyword gnuplotType		axes x1y2 unique acs[plines]
-syn keyword gnuplotType		size origin multiplot xtics xr[ange] yr[ange] square nosquare ratio noratio
-syn keyword gnuplotType		binary matrix index every thru sm[ooth]
-syn keyword gnuplotType		all angles degrees radians
-syn keyword gnuplotType		arrow noarrow autoscale noautoscale arrowstyle
-" autoscale args = x y xy z t ymin ... - too much?
-" needs code to: using title vs autoscale t
-syn keyword gnuplotType		x y z zcb
-syn keyword gnuplotType		linear  cubicspline  bspline order level[s]
-syn keyword gnuplotType		auto disc[rete] incr[emental] from to head nohead
-syn keyword gnuplotType		graph base both nosurface table out[put] data
-syn keyword gnuplotType		bar border noborder boxwidth
-syn keyword gnuplotType		clabel noclabel clip noclip cntrp[aram]
-syn keyword gnuplotType		contour nocontour
-syn keyword gnuplotType		dgrid3d nodgrid3d dummy encoding format
-" set encoding args not included - yet.
-syn keyword gnuplotType		function grid nogrid hidden[3d] nohidden[3d] isosample[s] key nokey
-syn keyword gnuplotType		historysize nohistorysize
-syn keyword gnuplotType		defaults offset nooffset trianglepattern undefined noundefined altdiagonal bentover noaltdiagonal nobentover
-syn keyword gnuplotType		left right top bottom outside below samplen spacing width height box nobox linestyle ls linetype lt linewidth lw
-syn keyword gnuplotType		Left Right autotitles noautotitles enhanced noenhanced
-syn keyword gnuplotType		isosamples
-syn keyword gnuplotType		label nolabel logscale nolog[scale] missing center font locale
-syn keyword gnuplotType		mapping margin bmargin lmargin rmargin tmargin spherical cylindrical cartesian
-syn keyword gnuplotType		linestyle nolinestyle linetype lt linewidth lw pointtype pt pointsize ps
-syn keyword gnuplotType		mouse nomouse
-syn keyword gnuplotType		nooffsets data candlesticks financebars linespoints lp vector nosurface
-syn keyword gnuplotType		term[inal] linux aed767 aed512 gpic
-syn keyword gnuplotType		regis tek410x tek40 vttek kc-tek40xx
-syn keyword gnuplotType		km-tek40xx selanar bitgraph xlib x11 X11
-" x11 args
-syn keyword gnuplotType		aifm cgm dumb fig gif small large size nofontlist winword6 corel dxf emf
-syn keyword gnuplotType		hpgl
-" syn keyword gnuplotType	transparent hp2623a hp2648 hp500c pcl5				      why jeh
-syn keyword gnuplotType		hp2623a hp2648 hp500c pcl5
-syn match gnuplotType		"\<transparent\>"
-syn keyword gnuplotType		hpljii hpdj hppj imagen mif pbm png svg
-syn keyword gnuplotType		postscript enhanced_postscript qms table
-" postscript editing values?
-syn keyword gnuplotType		tgif tkcanvas epson-180dpi epson-60dpi
-syn keyword gnuplotType		epson-lx800 nec-cp6 okidata starc
-syn keyword gnuplotType		tandy-60dpi latex emtex pslatex pstex epslatex
-syn keyword gnuplotType		eepic tpic pstricks texdraw mf metafont mpost mp
-syn keyword gnuplotType		timestamp notimestamp
-syn keyword gnuplotType		variables version
-syn keyword gnuplotType		x2data y2data ydata zdata
-syn keyword gnuplotType		reverse writeback noreverse nowriteback
-syn keyword gnuplotType		axis mirror autofreq nomirror rotate autofreq norotate
-syn keyword gnuplotType		update
-syn keyword gnuplotType		multiplot nomultiplot mytics
-syn keyword gnuplotType		nomytics mztics nomztics mx2tics nomx2tics
-syn keyword gnuplotType		my2tics nomy2tics offsets origin output
-syn keyword gnuplotType		para[metric] nopara[metric] pointsize polar nopolar
-syn keyword gnuplotType		zrange x2range y2range rrange cbrange
-syn keyword gnuplotType		trange urange vrange sample[s] size
-syn keyword gnuplotType		bezier boxerrorbars boxes bargraph bar[s]
-syn keyword gnuplotType		boxxy[errorbars] csplines dots fsteps histeps impulses
-syn keyword gnuplotType		line[s] linesp[oints] points poiinttype sbezier splines steps
-" w lt lw ls	      = optional
-syn keyword gnuplotType		vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
-syn keyword gnuplotType		errorb[ars] surface
-syn keyword gnuplotType		filledcurve[s] pm3d   x1 x2 y1 y2 xy closed
-syn keyword gnuplotType		at pi front
-syn keyword gnuplotType		errorlines xerrorlines yerrorlines xyerrorlines
-syn keyword gnuplotType		tics ticslevel ticscale time timefmt view
-syn keyword gnuplotType		xdata xdtics noxdtics ydtics noydtics
-syn keyword gnuplotType		zdtics nozdtics x2dtics nox2dtics y2dtics noy2dtics
-syn keyword gnuplotType		xlab[el] ylab[el] zlab[el] cblab[el] x2label y2label xmtics
-syn keyword gnuplotType		xmtics noxmtics ymtics noymtics zmtics nozmtics
-syn keyword gnuplotType		x2mtics nox2mtics y2mtics noy2mtics
-syn keyword gnuplotType		cbdtics nocbdtics cbmtics nocbmtics cbtics nocbtics
-syn keyword gnuplotType		xtics noxtics ytics noytics
-syn keyword gnuplotType		ztics noztics x2tics nox2tics
-syn keyword gnuplotType		y2tics noy2tics zero nozero zeroaxis nozeroaxis
-syn keyword gnuplotType		xzeroaxis noxzeroaxis yzeroaxis noyzeroaxis
-syn keyword gnuplotType		x2zeroaxis nox2zeroaxis y2zeroaxis noy2zeroaxis
-syn keyword gnuplotType		angles one two fill empty solid pattern
-syn keyword gnuplotType		default
-syn keyword gnuplotType		scansautomatic flush b[egin] noftriangles implicit
-" b too much? - used in demo
-syn keyword gnuplotType		palette positive negative ps_allcF nops_allcF maxcolors
-syn keyword gnuplotType		push fontfile pop
-syn keyword gnuplotType		rgbformulae defined file color model gradient colornames
-syn keyword gnuplotType		RGB HSV CMY YIQ XYZ
-syn keyword gnuplotType		colorbox vertical horizontal user bdefault
-syn keyword gnuplotType		loadpath fontpath decimalsign in out
-
-" comments + strings
-syn region gnuplotComment	start="#" end="$"
-syn region gnuplotComment	start=+"+ skip=+\\"+ end=+"+
-syn region gnuplotComment	start=+'+	     end=+'+
-
-" Define the default highlighting.
+" ---- Identifiers: Functions ---- "
+
+" numerical functions
+syn keyword gnuplotFunc		abs acos acosh airy arg asin asinh atan atan2
+syn keyword gnuplotFunc		atanh EllipticK EllipticE EllipticPi besj0 besj1
+syn keyword gnuplotFunc		besy0 besy1 ceil cos cosh erf erfc exp expint
+syn keyword gnuplotFunc		floor gamma ibeta inverf igamma imag invnorm int
+syn keyword gnuplotFunc		lambertw lgamma log log10 norm rand real sgn sin
+syn keyword gnuplotFunc		sin sinh sqrt tan tanh voigt
+
+" string functions
+syn keyword gnuplotFunc		gprintf sprintf strlen strstrt substr strftime
+syn keyword gnuplotFunc		strptime system word words
+
+" other functions
+syn keyword gnuplotFunc		column columnhead columnheader defined exists
+syn keyword gnuplotFunc		hsv2rgb stringcolumn timecolumn tm_hour tm_mday
+syn keyword gnuplotFunc		tm_min tm_mon tm_sec tm_wday tm_yday tm_year
+syn keyword gnuplotFunc		time valid value
+
+" ---- Statements ---- "
+
+" common (builtin) variable names
+syn keyword gnuplotKeyword	x y t u v z s
+
+" conditionals
+syn keyword gnuplotConditional	if else
+
+" repeats
+syn keyword gnuplotRepeat	do for while
+
+" operators
+syn match gnuplotOperator	"[-+*/^|&?:]"
+syn match gnuplotOperator	"\*\*"
+syn match gnuplotOperator	"&&"
+syn match gnuplotOperator	"||"
+
+" Keywords
+
+" keywords for 'fit' command
+syn keyword gnuplotKeyword	via z x:z x:z:s x:y:z:s
+syn keyword gnuplotKeyword	x:y:t:z:s x:y:t:u:z:s x:y:t:u:v:z:s
+
+" keywords for 'plot' command
+" 'axes' keyword
+syn keyword gnuplotKeyword	axes x1y1 x1y2 x2y1 x2y2
+" 'binary' keyword
+syn keyword gnuplotKeyword	binary matrix general array record format endian
+syn keyword gnuplotKeyword	filetype avs edf png scan transpose dx dy dz
+syn keyword gnuplotKeyword	flipx flipy flipz origin center rotate using
+syn keyword gnuplotKeyword	perpendicular skip every
+" datafile keywords
+syn keyword gnuplotKeyword	binary nonuniform matrix index every using
+syn keyword gnuplotKeyword	smooth volatile noautoscale every index
+" 'smooth' keywords
+syn keyword gnuplotKeyword	unique frequency cumulative cnormal kdensity
+syn keyword gnuplotKeyword	csplines acsplines bezer sbezier
+" deprecated 'thru' keyword
+syn keyword gnuplotError	thru
+" 'using' keyword
+syn keyword gnuplotKeyword	using u xticlabels yticlabels zticlabels
+syn keyword gnuplotKeyword	x2ticlabels y2ticlabels xtic ytic ztic
+" 'errorbars' keywords
+syn keyword gnuplotKeyword	errorbars xerrorbars yerrorbars xyerrorbars
+" 'errorlines' keywords
+syn keyword gnuplotKeyword	errorlines xerrorlines yerrorlines xyerrorlines
+" 'title' keywords
+syn keyword gnuplotKeyword	title t tit notitle columnheader at beginning
+syn keyword gnuplotKeyword	end
+" 'with' keywords
+syn keyword gnuplotKeyword	with w linestyle ls linetype lt linewidth
+syn keyword gnuplotKeyword	lw linecolor lc pointtype pt pointsize ps
+syn keyword gnuplotKeyword	fill fs nohidden3d nocontours nosurface palette
+" styles for 'with'
+syn keyword gnuplotKeyword	lines l points p linespoints lp surface dots
+syn keyword gnuplotKeyword	impulses labels vectors steps fsteps histeps
+syn keyword gnuplotKeyword	errorbars errorlines financebars xerrorbars
+syn keyword gnuplotKeyword	xerrorlines xyerrorbars yerrorbars yerrorlines
+syn keyword gnuplotKeyword	boxes boxerrorbars boxxyerrorbars boxplot
+syn keyword gnuplotKeyword	candlesticks circles ellipses filledcurves
+syn keyword gnuplotKeyword	histogram image rgbimage rgbalpha pm3d variable
+
+" keywords for 'save' command
+syn keyword gnuplotKeyword	save functions func variables all var terminal
+syn keyword gnuplotKeyword	term set
+
+" keywords for 'set/show' command
+" set angles
+syn keyword gnuplotKeyword	angles degrees deg radians rad
+" set arrow
+syn keyword gnuplotKeyword	arrow from to rto length angle arrowstyle as
+syn keyword gnuplotKeyword	nohead head backhead heads size filled empty
+syn keyword gnuplotKeyword	nofilled front back linestyle linetype linewidth
+" set autoscale
+" TODO regexp here
+syn keyword gnuplotKeyword	autoscale x y z cb x2 y2 zy min max fixmin
+syn keyword gnuplotKeyword	fixmax fix keepfix noextend
+" set bars
+syn keyword gnuplotKeyword	bars small large fullwidth front back
+" set bind
+syn keyword gnuplotKeyword	bind
+" set margins
+" TODO regexp
+syn keyword gnuplotKeyword	margin bmargin lmargin rmargin tmargin
+" set border
+syn keyword gnuplotKeyword	border front back
+" set boxwidth
+syn keyword gnuplotKeyword	boxwidth absolute relative
+" deprecated set clabel
+syn keyword gnuplotError	clabel
+" set clip
+syn keyword gnuplotKeyword	clip points one two
+" set cntrlabel
+syn keyword gnuplotKeyword	cntrlabel format font start interval onecolor
+" set cntrparam
+syn keyword gnuplotKeyword	cntrparam linear cubicspline bspline points
+syn keyword gnuplotKeyword	order levels auto discrete incremental
+" set colorbox
+syn keyword gnuplotKeyword	colorbox vertical horizontal default user origin
+syn keyword gnuplotKeyword	size front back noborder bdefault border
+" show colornames
+syn keyword gnuplotKeyword	colornames
+" set contour
+syn keyword gnuplotKeyword	contour base surface both
+" set datafile
+syn keyword gnuplotKeyword	datafile fortran nofpe_trap missing separator
+syn keyword gnuplotKeyword	whitespace tab comma commentschars binary
+" set decimalsign
+syn keyword gnuplotKeyword	decimalsign locale
+" set dgrid3d
+syn keyword gnuplotKeyword	dgrid3d splines qnorm gauss cauchy exp box hann
+syn keyword gnuplotKeyword	kdensity
+" set dummy
+syn keyword gnuplotKeyword	dummy
+" set encoding
+syn keyword gnuplotKeyword	encoding default iso_8859_1 iso_8859_15
+syn keyword gnuplotKeyword	iso_8859_2 iso_8859_9 koi8r koi8u cp437 cp850
+syn keyword gnuplotKeyword	cp852 cp950 cp1250 cp1251 cp1254 sjis utf8
+" set fit
+syn keyword gnuplotKeyword	fit logfile default quiet noquiet results brief
+syn keyword gnuplotKeyword	verbose errorvariables noerrorvariables
+syn keyword gnuplotKeyword	errorscaling noerrorscaling prescale noprescale
+syn keyword gnuplotKeyword	maxiter none limit limit_abs start-lambda script
+syn keyword gnuplotKeyword	lambda-factor
+" set fontpath
+syn keyword gnuplotKeyword	fontpath
+" set format
+syn keyword gnuplotKeyword	format
+" show functions
+syn keyword gnuplotKeyword	functions
+" set grid
+syn keyword gnuplotKeyword	grid polar layerdefault xtics ytics ztics x2tics
+syn keyword gnuplotKeyword	y2tics cbtics mxtics mytics mztics mx2tics
+syn keyword gnuplotKeyword	my2tics mcbtics xmtics ymtics zmtics x2mtics
+syn keyword gnuplotKeyword	y2mtics cbmtics noxtics noytics noztics nox2tics
+syn keyword gnuplotKeyword	noy2tics nocbtics nomxtics nomytics nomztics
+syn keyword gnuplotKeyword	nomx2tics nomy2tics nomcbtics
+" set hidden3d
+syn keyword gnuplotKeyword	hidden3d offset trianglepattern undefined
+syn keyword gnuplotKeyword	altdiagonal noaltdiagonal bentover nobentover
+syn keyword gnuplotKeyword	noundefined
+" set historysize
+syn keyword gnuplotKeyword	historysize
+" set isosamples
+syn keyword gnuplotKeyword	isosamples
+" set key
+syn keyword gnuplotKeyword	key on off inside outside at left right center
+syn keyword gnuplotKeyword	top bottom vertical horizontal Left Right
+syn keyword gnuplotKeyword	opaque noopaque reverse noreverse invert maxrows
+syn keyword gnuplotKeyword	noinvert samplen spacing width height autotitle
+syn keyword gnuplotKeyword	noautotitle title enhanced noenhanced font
+syn keyword gnuplotKeyword	textcolor box nobox linetype linewidth maxcols
+" set label
+syn keyword gnuplotKeyword	label left center right rotate norotate by font
+syn keyword gnuplotKeyword	front back textcolor point nopoint offset boxed
+syn keyword gnuplotKeyword	hypertext
+" set linetype
+syn keyword gnuplotKeyword	linetype
+" set link
+syn keyword gnuplotKeyword	link via inverse
+" set loadpath
+syn keyword gnuplotKeyword	loadpath
+" set locale
+syn keyword gnuplotKeyword	locale
+" set logscale
+syn keyword gnuplotKeyword	logscale log
+" set macros
+syn keyword gnuplotKeyword	macros
+" set mapping
+syn keyword gnuplotKeyword	mapping cartesian spherical cylindrical
+" set mouse
+syn keyword gnuplotKeyword	mouse doubleclick nodoubleclick zoomcoordinates
+syn keyword gnuplotKeyword	nozoomcoordinates ruler noruler at polardistance
+syn keyword gnuplotKeyword	nopolardistance deg tan format clipboardformat
+syn keyword gnuplotKeyword	mouseformat labels nolabels zoomjump nozoomjump
+syn keyword gnuplotKeyword	verbose noverbose
+" set multiplot
+syn keyword gnuplotKeyword	multiplot title font layout rowsfirst downwards
+syn keyword gnuplotKeyword	downwards upwards scale offset
+" set object
+syn keyword gnuplotKeyword	object behind fillcolor fc fs rectangle ellipse
+syn keyword gnuplotKeyword	circle polygon at center size units xy xx yy to
+syn keyword gnuplotKeyword	from
+" set offsets
+syn keyword gnuplotKeyword	offsets
+" set origin
+syn keyword gnuplotKeyword	origin
+" set output
+syn keyword gnuplotKeyword	output
+" set parametric
+syn keyword gnuplotKeyword	parametric
+" show plot
+syn keyword gnuplotKeyword	plot add2history
+" set pm3d
+syn keyword gnuplotKeyword	hidden3d interpolate scansautomatic scansforward
+syn keyword gnuplotKeyword	scansbackward depthorder flush begin center end
+syn keyword gnuplotKeyword	ftriangles noftriangles clip1in clip4in mean map
+syn keyword gnuplotKeyword	corners2color geomean harmean rms median min max
+syn keyword gnuplotKeyword	c1 c2 c3 c4 pm3d at nohidden3d implicit explicit
+" set palette
+syn keyword gnuplotKeyword	palette gray color gamma rgbformulae defined
+syn keyword gnuplotKeyword	file functions cubehelix start cycles saturation
+syn keyword gnuplotKeyword	model RGB HSV CMY YIQ XYZ positive negative
+syn keyword gnuplotKeyword	nops_allcF ps_allcF maxcolors float int gradient
+syn keyword gnuplotKeyword	fit2rgbformulae rgbformulae
+" set pointintervalbox
+syn keyword gnuplotKeyword	pointintervalbox
+" set pointsize
+syn keyword gnuplotKeyword	pointsize
+" set polar
+syn keyword gnuplotKeyword	polar
+" set print
+syn keyword gnuplotKeyword	print append
+" set psdir
+syn keyword gnuplotKeyword	psdir
+" set raxis
+syn keyword gnuplotKeyword	raxis rrange rtics
+" set samples
+syn keyword gnuplotKeyword	samples
+" set size
+syn keyword gnuplotKeyword	size square nosquare ratio noratio
+" set style
+syn keyword gnuplotKeyword	style function data noborder rectangle arrow
+syn keyword gnuplotKeyword	default nohead head heads size filled empty
+syn keyword gnuplotKeyword	nofilled front back boxplot range fraction
+syn keyword gnuplotKeyword	outliers nooutliers pointtype candlesticks
+syn keyword gnuplotKeyword	separation labels off auto x x2 sorted unsorted
+syn keyword gnuplotKeyword	fill empty transparent solid pattern border
+syn keyword gnuplotKeyword	increment userstyles financebars line default
+syn keyword gnuplotKeyword	linetype lt linecolor lc linewidth lw pointtype
+syn keyword gnuplotKeyword	pt pointsize ps pointinterval pi palette circle
+syn keyword gnuplotKeyword	radius graph screen wedge nowedge ellipse size
+syn keyword gnuplotKeyword	units xx xy yy histogram line textbox opaque
+syn keyword gnuplotKeyword	border noborder
+" set surface
+syn keyword gnuplotKeyword	surface implicit explicit
+" set table
+syn keyword gnuplotKeyword	table
+" set terminal (list of terminals)
+syn keyword gnuplotKeyword	terminal term push pop aed512 aed767 aifm aqua
+syn keyword gnuplotKeyword	be cairo cairolatex canvas cgm context corel
+syn keyword gnuplotKeyword	debug dumb dxf dxy800a eepic emf emxvga epscairo
+syn keyword gnuplotKeyword	epslatex epson_180dpi excl fig ggi gif gpic hpgl
+syn keyword gnuplotKeyword	grass hp2623a hp2648 hp500c hpljii hppj imagen
+syn keyword gnuplotKeyword	jpeg kyo latex linux lua mf mif mp next openstep
+syn keyword gnuplotKeyword	pbm pdf pdfcairo pm png pngcairo postscript
+syn keyword gnuplotKeyword	pslatex pstex pstricks qms qt regis sun svg svga
+syn keyword gnuplotKeyword	tek40 tek410x texdraw tgif tikz tkcanvas tpic
+syn keyword gnuplotKeyword	vgagl vws vx384 windows wx wxt x11 xlib
+" keywords for 'set terminal'
+syn keyword gnuplotKeyword	color monochrome dashlength dl eps pdf fontscale
+syn keyword gnuplotKeyword	standalone blacktext colortext colourtext header
+syn keyword gnuplotKeyword	noheader mono color solid dashed notransparent
+syn keyword gnuplotKeyword	crop crop background input rounded butt square
+syn keyword gnuplotKeyword	size fsize standalone name jsdir defaultsize
+syn keyword gnuplotKeyword	timestamp notimestamp colour mitered beveled
+syn keyword gnuplotKeyword	round squared palfuncparam blacktext nec_cp6
+syn keyword gnuplotKeyword	mppoints inlineimages externalimages defaultfont
+syn keyword gnuplotKeyword	aspect feed nofeed rotate small tiny standalone
+syn keyword gnuplotKeyword	oldstyle newstyle level1 leveldefault level3
+syn keyword gnuplotKeyword	background nobackground solid clip noclip
+syn keyword gnuplotKeyword	colortext colourtext epson_60dpi epson_lx800
+syn keyword gnuplotKeyword	okidata starc tandy_60dpi dpu414 nec_cp6 draft
+syn keyword gnuplotKeyword	medium large normal landscape portrait big
+syn keyword gnuplotKeyword	inches pointsmax textspecial texthidden
+syn keyword gnuplotKeyword	thickness depth version acceleration giant
+syn keyword gnuplotKeyword	delay loop optimize nooptimize pspoints
+syn keyword gnuplotKeyword	FNT9X17 FNT13X25 interlace nointerlace courier
+syn keyword gnuplotKeyword	originreset nooriginreset gparrows nogparrows
+syn keyword gnuplotKeyword	picenvironment nopicenvironment tightboundingbox
+syn keyword gnuplotKeyword	notightboundingbox charsize gppoints nogppoints
+syn keyword gnuplotKeyword	fontscale textscale fulldoc nofulldoc standalone
+syn keyword gnuplotKeyword	preamble header tikzplot tikzarrows notikzarrows
+syn keyword gnuplotKeyword	cmykimages externalimages noexternalimages
+syn keyword gnuplotKeyword	polyline vectors magnification psnfss nopsnfss
+syn keyword gnuplotKeyword	psnfss-version7 prologues a4paper amstex fname
+syn keyword gnuplotKeyword	fsize server persist widelines interlace
+syn keyword gnuplotKeyword	truecolor notruecolor defaultplex simplex duplex
+syn keyword gnuplotKeyword	nofontfiles adobeglyphnames noadobeglyphnames
+syn keyword gnuplotKeyword	nostandalone metric textrigid animate nopspoints
+syn keyword gnuplotKeyword	hpdj FNT5X9 roman emtex rgbimages bitmap
+syn keyword gnuplotKeyword	nobitmap providevars nointerlace add delete
+syn keyword gnuplotKeyword	auxfile hacktext unit raise palfuncparam
+syn keyword gnuplotKeyword	noauxfile nohacktext nounit noraise ctrl noctrl
+syn keyword gnuplotKeyword	close widget fixed dynamic tek40xx vttek
+syn keyword gnuplotKeyword	kc-tek40xx km-tek40xx bitgraph perltk
+syn keyword gnuplotKeyword	interactive red green blue interpolate mode
+syn keyword gnuplotKeyword	position ctrlq replotonresize position noctrlq
+syn keyword gnuplotKeyword	noreplotonresize
+" set termoption
+syn keyword gnuplotKeyword	termoption font fontscale solid dashed
+" set tics
+syn keyword gnuplotKeyword	tics add axis border mirror nomirror in out
+syn keyword gnuplotKeyword	scale rotate norotate by offset nooffset left
+syn keyword gnuplotKeyword	autojustify format font textcolor right center
+" deprecated set ticslevel
+syn keyword gnuplotError	ticslevel ticscale
+" set timestamp
+syn keyword gnuplotKeyword	timestamp top bottom offset font
+" set timefmt
+syn keyword gnuplotKeyword	timefmt
+" set title
+syn keyword gnuplotKeyword	title offset font textcolor tc
+" set ranges
+syn keyword gnuplotKeyword	trange urange vrange
+" show variables
+syn keyword gnuplotKeyword	variables
+" show version
+syn keyword gnuplotKeyword	version
+" set view
+syn keyword gnuplotKeyword	view map equal noequal xy xyz
+" set x2data
+syn keyword gnuplotKeyword	xdata ydata zdata x2data y2data cbdata xdtics
+syn keyword gnuplotKeyword	ydtics zdtics x2dtics y2dtics cbdtics xzeroaxis
+syn keyword gnuplotKeyword	yzeroaxis zzeroaxis x2zeroaxis y2zeroaxis
+syn keyword gnuplotKeyword	cbzeroaxis time geographic
+" set label
+syn keyword gnuplotKeyword	xlabel ylabel zlabel x2label y2label cblabel
+syn keyword gnuplotKeyword	offset font textcolor by parallel
+" set range
+syn keyword gnuplotKeyword	xrange yrange zrange x2range y2range cbrange
+" set xyplane
+syn keyword gnuplotKeyword	xyplane
+" set zeroaxis
+" set zero
+syn keyword gnuplotKeyword	zero
+" set zeroaxis
+syn keyword gnuplotKeyword	zeroaxis
+
+" keywords for 'stats' command
+syn keyword gnuplotKeyword	nooutput
+
+" keywords for 'test' command
+syn keyword gnuplotKeyword	terminal palette rgb rbg grb gbr brg bgr
+
+" ---- Macros ---- "
+
+syn region gnuplotMacro		start="@" end=" "
+
+" ---- Todos ---- "
+
+syn keyword gnuplotTodo		contained TODO FIXME XXX
+
+" ---- Types: gnuplot commands ---- "
+
+" I set the commands as Types to distinguish them visually from keywords for the
+" commands.  This comes at the end of the syntax file because some commands
+" are redundant with keywords.  It's probably too much trouble to go and
+" create special regions for each redundant keyword/command pair, which means
+" that some keywords (e.g. 'p') will be highlighted as commands.
+
+syn keyword gnuplotStatement	cd call clear evaluate exit fit help history
+syn keyword gnuplotStatement	load lower pause plot p print pwd quit raise
+syn keyword gnuplotStatement	refresh replot rep reread reset save set show
+syn keyword gnuplotStatement	shell splot spstats system test undefine unset
+syn keyword gnuplotStatement	update
+
+" ---- Define the default highlighting ---- "
 " For version 5.7 and earlier: only when not done already
 " For version 5.8 and later: only when an item doesn't have highlighting yet
 if version >= 508 || !exists("did_gnuplot_syntax_inits")
@@ -181,14 +510,41 @@ if version >= 508 || !exists("did_gnuplot_syntax_inits")
     command -nargs=+ HiLink hi def link <args>
   endif
 
-  HiLink gnuplotStatement	Statement
-  HiLink gnuplotConditional	Conditional
+  " ---- Comments ---- "
+  HiLink gnuplotComment		Comment
+
+  " ---- Constants ---- "
+  HiLink gnuplotString		String
   HiLink gnuplotNumber		Number
   HiLink gnuplotFloat		Float
+
+  " ---- Identifiers ---- "
+  HiLink gnuplotIdentifier	Identifier
+
+  " ---- Statements ---- "
+  HiLink gnuplotConditional	Conditional
+  HiLink gnuplotRepeat		Repeat
+  HiLink gnuplotKeyword		Keyword
+  HiLink gnuplotOperator	Operator
+
+  " ---- PreProcs ---- "
+  HiLink gnuplotMacro		Macro
+
+  " ---- Types ---- "
+  HiLink gnuplotStatement	Type
+  HiLink gnuplotFunc		Identifier
+
+  " ---- Specials ---- "
+  HiLink gnuplotSpecial		Special
+  HiLink gnuplotUnit		Special
+  HiLink gnuplotExternal	Special
+
+  " ---- Errors ---- "
+  HiLink gnuplotError		Error
   HiLink gnuplotOctalError	Error
-  HiLink gnuplotFunc		Type
-  HiLink gnuplotType		Type
-  HiLink gnuplotComment	Comment
+
+  " ---- Todos ---- "
+  HiLink gnuplotTodo		Todo
 
   delcommand HiLink
 endif
diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim
new file mode 100644
index 0000000000..e78f8cf27c
--- /dev/null
+++ b/runtime/syntax/go.vim
@@ -0,0 +1,208 @@
+" Vim syntax file
+" Language:	Go
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-go)
+" Last Change:	2014 Aug 16
+
+" Options:
+"   There are some options for customizing the highlighting; the recommended
+"   settings are the default values, but you can write:
+"     let OPTION_NAME = 0
+"   in your ~/.vimrc file to disable particular options. You can also write:
+"     let OPTION_NAME = 1
+"   to enable particular options. At present, all options default to on.
+"
+"   - g:go_highlight_array_whitespace_error
+"     Highlights white space after "[]".
+"   - g:go_highlight_chan_whitespace_error
+"     Highlights white space around the communications operator that don't
+"     follow the standard style.
+"   - g:go_highlight_extra_types
+"     Highlights commonly used library types (io.Reader, etc.).
+"   - g:go_highlight_space_tab_error
+"     Highlights instances of tabs following spaces.
+"   - g:go_highlight_trailing_whitespace_error
+"     Highlights trailing white space.
+
+" Quit when a (custom) syntax file was already loaded
+if exists('b:current_syntax')
+  finish
+endif
+
+if !exists('g:go_highlight_array_whitespace_error')
+  let g:go_highlight_array_whitespace_error = 1
+endif
+if !exists('g:go_highlight_chan_whitespace_error')
+  let g:go_highlight_chan_whitespace_error = 1
+endif
+if !exists('g:go_highlight_extra_types')
+  let g:go_highlight_extra_types = 1
+endif
+if !exists('g:go_highlight_space_tab_error')
+  let g:go_highlight_space_tab_error = 1
+endif
+if !exists('g:go_highlight_trailing_whitespace_error')
+  let g:go_highlight_trailing_whitespace_error = 1
+endif
+
+syn case match
+
+syn keyword     goDirective         package import
+syn keyword     goDeclaration       var const type
+syn keyword     goDeclType          struct interface
+
+hi def link     goDirective         Statement
+hi def link     goDeclaration       Keyword
+hi def link     goDeclType          Keyword
+
+" Keywords within functions
+syn keyword     goStatement         defer go goto return break continue fallthrough
+syn keyword     goConditional       if else switch select
+syn keyword     goLabel             case default
+syn keyword     goRepeat            for range
+
+hi def link     goStatement         Statement
+hi def link     goConditional       Conditional
+hi def link     goLabel             Label
+hi def link     goRepeat            Repeat
+
+" Predefined types
+syn keyword     goType              chan map bool string error
+syn keyword     goSignedInts        int int8 int16 int32 int64 rune
+syn keyword     goUnsignedInts      byte uint uint8 uint16 uint32 uint64 uintptr
+syn keyword     goFloats            float32 float64
+syn keyword     goComplexes         complex64 complex128
+
+hi def link     goType              Type
+hi def link     goSignedInts        Type
+hi def link     goUnsignedInts      Type
+hi def link     goFloats            Type
+hi def link     goComplexes         Type
+
+" Treat func specially: it's a declaration at the start of a line, but a type
+" elsewhere. Order matters here.
+syn match       goType              /\<func\>/
+syn match       goDeclaration       /^func\>/
+
+" Predefined functions and values
+syn keyword     goBuiltins          append cap close complex copy delete imag len
+syn keyword     goBuiltins          make new panic print println real recover
+syn keyword     goConstants         iota true false nil
+
+hi def link     goBuiltins          Keyword
+hi def link     goConstants         Keyword
+
+" Comments; their contents
+syn keyword     goTodo              contained TODO FIXME XXX BUG
+syn cluster     goCommentGroup      contains=goTodo
+syn region      goComment           start="/\*" end="\*/" contains=@goCommentGroup,@Spell
+syn region      goComment           start="//" end="$" contains=@goCommentGroup,@Spell
+
+hi def link     goComment           Comment
+hi def link     goTodo              Todo
+
+" Go escapes
+syn match       goEscapeOctal       display contained "\\[0-7]\{3}"
+syn match       goEscapeC           display contained +\\[abfnrtv\\'"]+
+syn match       goEscapeX           display contained "\\x\x\{2}"
+syn match       goEscapeU           display contained "\\u\x\{4}"
+syn match       goEscapeBigU        display contained "\\U\x\{8}"
+syn match       goEscapeError       display contained +\\[^0-7xuUabfnrtv\\'"]+
+
+hi def link     goEscapeOctal       goSpecialString
+hi def link     goEscapeC           goSpecialString
+hi def link     goEscapeX           goSpecialString
+hi def link     goEscapeU           goSpecialString
+hi def link     goEscapeBigU        goSpecialString
+hi def link     goSpecialString     Special
+hi def link     goEscapeError       Error
+
+" Strings and their contents
+syn cluster     goStringGroup       contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
+syn region      goString            start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
+syn region      goRawString         start=+`+ end=+`+
+
+hi def link     goString            String
+hi def link     goRawString         String
+
+" Characters; their contents
+syn cluster     goCharacterGroup    contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
+syn region      goCharacter         start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
+
+hi def link     goCharacter         Character
+
+" Regions
+syn region      goBlock             start="{" end="}" transparent fold
+syn region      goParen             start='(' end=')' transparent
+
+" Integers
+syn match       goDecimalInt        "\<\d\+\([Ee]\d\+\)\?\>"
+syn match       goHexadecimalInt    "\<0x\x\+\>"
+syn match       goOctalInt          "\<0\o\+\>"
+syn match       goOctalError        "\<0\o*[89]\d*\>"
+
+hi def link     goDecimalInt        Integer
+hi def link     goHexadecimalInt    Integer
+hi def link     goOctalInt          Integer
+hi def link     Integer             Number
+
+" Floating point
+syn match       goFloat             "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
+syn match       goFloat             "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
+syn match       goFloat             "\<\d\+[Ee][-+]\d\+\>"
+
+hi def link     goFloat             Float
+
+" Imaginary literals
+syn match       goImaginary         "\<\d\+i\>"
+syn match       goImaginary         "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
+syn match       goImaginary         "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
+syn match       goImaginary         "\<\d\+[Ee][-+]\d\+i\>"
+
+hi def link     goImaginary         Number
+
+" Spaces after "[]"
+if go_highlight_array_whitespace_error != 0
+  syn match goSpaceError display "\(\[\]\)\@<=\s\+"
+endif
+
+" Spacing errors around the 'chan' keyword
+if go_highlight_chan_whitespace_error != 0
+  " receive-only annotation on chan type
+  syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
+  " send-only annotation on chan type
+  syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
+  " value-ignoring receives in a few contexts
+  syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
+endif
+
+" Extra types commonly seen
+if go_highlight_extra_types != 0
+  syn match goExtraType /\<bytes\.\(Buffer\)\>/
+  syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
+  syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
+  syn match goExtraType /\<unsafe\.Pointer\>/
+endif
+
+" Space-tab error
+if go_highlight_space_tab_error != 0
+  syn match goSpaceError display " \+\t"me=e-1
+endif
+
+" Trailing white space error
+if go_highlight_trailing_whitespace_error != 0
+  syn match goSpaceError display excludenl "\s\+$"
+endif
+
+hi def link     goExtraType         Type
+hi def link     goSpaceError        Error
+
+" Search backwards for a global declaration to start processing the syntax.
+"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
+
+" There's a bug in the implementation of grouphere. For now, use the
+" following as a more expensive/less precise workaround.
+syn sync minlines=500
+
+let b:current_syntax = 'go'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/syntax/godoc.vim b/runtime/syntax/godoc.vim
new file mode 100644
index 0000000000..3a07903a77
--- /dev/null
+++ b/runtime/syntax/godoc.vim
@@ -0,0 +1,21 @@
+" Vim syntax file
+" Language:	Godoc (generated documentation for go)
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-go)
+" Last Change:	2014 Aug 16
+
+if exists('b:current_syntax')
+  finish
+endif
+
+syn case match
+syn match godocTitle "^\([A-Z][A-Z ]*\)$"
+
+command -nargs=+ HiLink hi def link <args>
+
+HiLink godocTitle Title
+
+delcommand HiLink
+
+let b:current_syntax = 'godoc'
+
+" vim: sw=2 sts=2 et
diff --git a/runtime/syntax/vroom.vim b/runtime/syntax/vroom.vim
index 29860a8ac7..0cd6ccce1d 100644
--- a/runtime/syntax/vroom.vim
+++ b/runtime/syntax/vroom.vim
@@ -1,6 +1,6 @@
 " Vim syntax file
 " Language:	Vroom (vim testing and executable documentation)
-" Maintainer:	David Barnett (https://github.com/google/vim-ft.vroom)
+" Maintainer:	David Barnett (https://github.com/google/vim-ft-vroom)
 " Last Change:	2014 Jul 23
 
 " For version 5.x: Clear all syntax items.
diff --git a/runtime/tutor/tutor.es.utf-8 b/runtime/tutor/tutor.es.utf-8
index 84db8fda97..b7561e4759 100644
--- a/runtime/tutor/tutor.es.utf-8
+++ b/runtime/tutor/tutor.es.utf-8
@@ -121,7 +121,7 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar,
 	 h (izquierda)	   j (abajo)	  k (arriba)	  l (derecha)
 
   2. Para acceder a Vim (desde el símbolo del sistema %) escriba:
-     vin FILENAME <INTRO>
+     vim FILENAME <INTRO>
 
   3. Para salir de Vim escriba: <ESC> :q! <INTRO> para eliminar todos
      los cambios.
diff --git a/runtime/tutor/tutor.fr b/runtime/tutor/tutor.fr
index ec85235847..e35d4914aa 100644
--- a/runtime/tutor/tutor.fr
+++ b/runtime/tutor/tutor.fr
@@ -1029,10 +1029,10 @@ NOTE : Le compl
   des Mines du Colorado et reprend des id�es fournies par Charles Smith,
   Universit� d'�tat du Colorado. E-mail : bware@mines.colorado.edu.
 
-  Modifi� pour Vim par Bram Moolenar.
+  Modifi� pour Vim par Bram Moolenaar.
   Traduit en fran�ais par Adrien Beau, en avril 2001.
   Derni�res mises � jour par Dominique Pell�.
 
   E-mail :      dominique.pelle@gmail.com
-  Last Change : 2013 May 10
+  Last Change : 2014 Aug 18
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.fr.utf-8 b/runtime/tutor/tutor.fr.utf-8
index d07d1bafaa..ac01cfa538 100644
--- a/runtime/tutor/tutor.fr.utf-8
+++ b/runtime/tutor/tutor.fr.utf-8
@@ -1029,10 +1029,10 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
   des Mines du Colorado et reprend des idées fournies par Charles Smith,
   Université d'État du Colorado. E-mail : bware@mines.colorado.edu.
 
-  Modifié pour Vim par Bram Moolenar.
+  Modifié pour Vim par Bram Moolenaar.
   Traduit en français par Adrien Beau, en avril 2001.
   Dernières mises à jour par Dominique Pellé.
 
   E-mail :      dominique.pelle@gmail.com
-  Last Change : 2013 May 10
+  Last Change : 2014 Aug 18
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ja.euc b/runtime/tutor/tutor.ja.euc
index 2160e00e10..e19505ee75 100644
--- a/runtime/tutor/tutor.ja.euc
+++ b/runtime/tutor/tutor.ja.euc
@@ -55,8 +55,7 @@ NOTE: 
   2. ���Τ褦�˥�����:		:q! <ENTER>
      ����ˤ���Խ��������Ƥ���¸�����˥��ǥ�������λ���ޤ���
 
-  3. ������ץ���ץȤ��ФƤ����顢���Υ��塼�ȥꥢ���Ϥ��٤ˤ˥��ޥ��
-     �򥿥��פ��ޤ���
+  3. ���Υ��塼�ȥꥢ���Ϥ��٤Υ��ޥ�ɤ�¹Ԥ���ȡ����������ޤ���
      ���Υ��ޥ�ɤ�:		vimtutor <ENTER>
 
   4. ����ޤǤΥ��ƥåפ�Ф��������Ĥ����ʤ�С����ƥå� 1 ���� 3 �ޤǤ��
@@ -904,7 +903,7 @@ NOTE: 1
 
 	       ** CTRL-D �� <TAB> �ǥ��ޥ�ɥ饤����䴰���� **
 
-  1. ����ѥ��⡼�ɤǤʤ����Ȥ��ǧ���ޤ�:  :set nocp
+  1. �ߴ��⡼�ɤǤʤ����Ȥ��ǧ���ޤ�:  :set nocp
 
   2. ���ߤΥǥ��쥯�ȥ�˺ߤ�ե������ :!ls �� :!dir �dz�ǧ���ޤ���
 
@@ -949,7 +948,7 @@ NOTE: 
   ����ˤ� Vim �Υ��塼�ȥꥢ��򽪤��ޤ������ǥ������ñ�ˡ������⽼ʬ��
   �Ȥ����Ȥ��Ǥ���褦�ˤȡ�Vim �λ��ij�ǰ�������Τߤ������褦�Ȥ��ޤ�����
   Vim �ˤϤ����¿���Υ��ޥ�ɤ����ꡢ���������Ƥ��������뤳�ȤϤǤ��ޤ���
-  �ʹߤϥ桼���ޥ˥奢��򻲾Ȥ�������: ":help user-manual"
+  �ʹߤϥ桼�����ޥ˥奢��򻲾Ȥ�������: ":help user-manual"
 
   ����ʸ�γؽ��Τ���ˡ������ܤ�������ޤ���
 	Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.ja.sjis b/runtime/tutor/tutor.ja.sjis
index 2a6de3ad78..132af31bf2 100644
--- a/runtime/tutor/tutor.ja.sjis
+++ b/runtime/tutor/tutor.ja.sjis
@@ -55,8 +55,7 @@ NOTE: 
   2. ���̂悤�Ƀ^�C�v:		:q! <ENTER>
      ����ɂ��ҏW�������e��ۑ������ɃG�f�B�^���I�����܂��B
 
-  3. �V�F���v�����v�g���o�Ă�����A���̃`���[�g���A�����n�߂�ׂɂɃR�}���h
-     ���^�C�v���܂��B
+  3. ���̃`���[�g���A�����n�߂�ׂ̃R�}���h�����s����ƁA�����ɖ߂�܂��B
      ���̃R�}���h��:		vimtutor <ENTER>
 
   4. ����܂ł̃X�e�b�v���o�����M���‚����Ȃ�΁A�X�e�b�v 1 ���� 3 �܂ł���
@@ -904,7 +903,7 @@ NOTE: 1
 
 	       ** CTRL-D �� <TAB> �ŃR�}���h���C����⊮���� **
 
-  1. �R���p�`���[�h�łȂ����Ƃ��m�F���܂�:  :set nocp
+  1. �݊����[�h�łȂ����Ƃ��m�F���܂�:  :set nocp
 
   2. ���݂̃f�B���N�g���ɍ݂�t�@�C���� :!ls �� :!dir �Ŋm�F���܂��B
 
@@ -949,7 +948,7 @@ NOTE: 
   ����ɂ� Vim �̃`���[�g���A�����I���܂��B�G�f�B�^���ȒP�ɁA�������[����
   �g�����Ƃ��ł���悤�ɂƁAVim �̎��ŠT�O�̗v�_�݂̂�`���悤�Ƃ��܂����B
   Vim �ɂ͂���ɑ����̃R�}���h������A�����őS�Ă�������邱�Ƃ͂ł��܂���B
-  �ȍ~�̓��[�U�}�j���A�����Q�Ƃ�������: ":help user-manual"
+  �ȍ~�̓��[�U�[�}�j���A�����Q�Ƃ�������: ":help user-manual"
 
   ����Ȍ�̊w�K�̂��߂ɁA���̖{�𐄑E���܂��B
 	Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.ja.utf-8 b/runtime/tutor/tutor.ja.utf-8
index 66a818ad90..99cc7d4634 100644
--- a/runtime/tutor/tutor.ja.utf-8
+++ b/runtime/tutor/tutor.ja.utf-8
@@ -55,8 +55,7 @@ NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣
   2. 次のようにタイプ:		:q! <ENTER>
      これにより編集した内容を保存せずにエディタが終了します。
 
-  3. シェルプロンプトが出てきたら、このチュートリアルを始める為ににコマンド
-     をタイプします。
+  3. このチュートリアルを始める為のコマンドを実行すると、ここに戻れます。
      そのコマンドは:		vimtutor <ENTER>
 
   4. これまでのステップを覚え自信がついたならば、ステップ 1 から 3 までを実
@@ -904,7 +903,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい
 
 	       ** CTRL-D と <TAB> でコマンドラインを補完する **
 
-  1. コンパチモードでないことを確認します:  :set nocp
+  1. 互換モードでないことを確認します:  :set nocp
 
   2. 現在のディレクトリに在るファイルを :!ls か :!dir で確認します。
 
@@ -949,7 +948,7 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と <T
   これにて Vim のチュートリアルを終わります。エディタを簡単に、しかも充分に
   使うことができるようにと、Vim の持つ概念の要点のみを伝えようとしました。
   Vim にはさらに多くのコマンドがあり、ここで全てを説明することはできません。
-  以降はユーザマニュアルを参照ください: ":help user-manual"
+  以降はユーザーマニュアルを参照ください: ":help user-manual"
 
   これ以後の学習のために、次の本を推薦します。
 	Vim - Vi Improved - by Steve Oualline
diff --git a/runtime/tutor/tutor.pt b/runtime/tutor/tutor.pt
index 57b4462ef9..b7c74f5709 100644
--- a/runtime/tutor/tutor.pt
+++ b/runtime/tutor/tutor.pt
@@ -572,7 +572,7 @@ Nota: Isso 
      digite  :#,#s/velho/novo/g   onde #,# s�o os n�meros das duas linhas.
      Digite  :%s/velho/novo/g     para mudar todas as ocorr�ncias no arquivo
                                   inteiro.
-     Digite  :%/velho/novo/gc     para mudar todas as ocorr�ncia no arquivo
+     Digite  :%s/velho/novo/gc    para mudar todas as ocorr�ncia no arquivo
                                   inteiro, com a op��o de confirmar cada
 				  substitui��o.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA:  A completa
   Colorado School of Mines, usando id�ias fornecidas por Charles Smith,
   Colorado State University.  E-mail: bware@mines.colorado.edu.
 
-  Modificado para o Vim por Bram Moolenar.
+  Modificado para o Vim por Bram Moolenaar.
 
   Vers�o 1.4 traduzida para o portugu�s por Marcelo Drudi Miranda, Escola
   Polit�cnica da Universidade de S�o Paulo.
diff --git a/runtime/tutor/tutor.pt.utf-8 b/runtime/tutor/tutor.pt.utf-8
index fecbcfa630..1309404b44 100644
--- a/runtime/tutor/tutor.pt.utf-8
+++ b/runtime/tutor/tutor.pt.utf-8
@@ -572,7 +572,7 @@ Nota: Isso é muito útil para corrigir um programa com parênteses não-casados
      digite  :#,#s/velho/novo/g   onde #,# são os números das duas linhas.
      Digite  :%s/velho/novo/g     para mudar todas as ocorrências no arquivo
                                   inteiro.
-     Digite  :%/velho/novo/gc     para mudar todas as ocorrência no arquivo
+     Digite  :%s/velho/novo/gc    para mudar todas as ocorrência no arquivo
                                   inteiro, com a opção de confirmar cada
 				  substituição.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA:  A completação funciona com muitos comandos. Basta pressionar CTRL-D e
   Colorado School of Mines, usando idéias fornecidas por Charles Smith,
   Colorado State University.  E-mail: bware@mines.colorado.edu.
 
-  Modificado para o Vim por Bram Moolenar.
+  Modificado para o Vim por Bram Moolenaar.
 
   Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola
   Politécnica da Universidade de São Paulo.
diff --git a/runtime/tutor/tutor.utf-8 b/runtime/tutor/tutor.utf-8
index da28a15313..64a27d1c0d 100644
--- a/runtime/tutor/tutor.utf-8
+++ b/runtime/tutor/tutor.utf-8
@@ -55,8 +55,8 @@ NOTE: The cursor keys should also work.  But using hjkl you will be able to
   2. Type:	:q! <ENTER>.
      This exits the editor, DISCARDING any changes you have made.
 
-  3. When you see the shell prompt, type the command that got you into this
-     tutor.  That would be:	vimtutor <ENTER>
+  3. Get back here by executing the command that got you into this tutor. That
+     might be:  vimtutor <ENTER>
 
   4. If you have these steps memorized and are confident, execute steps
      1 through 3 to exit and re-enter the editor.
diff --git a/runtime/tutor/tutor.zh.big5 b/runtime/tutor/tutor.zh.big5
index 4daad64703..9da8b1a352 100644
--- a/runtime/tutor/tutor.zh.big5
+++ b/runtime/tutor/tutor.zh.big5
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
       �P�� xuandong@sh163.net �������A�N��B���O�r�ץ��C
 
       2002�~03��18�� ����� <linuxrat@gnuchina.org>
-      �ھ�Bram Molenaar���ͦb2002�~03��16�骺�ӫH�n�D�A�Nvimtutor1.4��Ķ
+      �ھ�Bram Moolenaar���ͦb2002�~03��16�骺�ӫH�n�D�A�Nvimtutor1.4��Ķ
       ���ɯŨ�vimtutor1.5�C
 
       2001�~11��15�� ����� <linuxrat@gnuchina.org>
-      �Nvimtutor1.4��Ķ�����浹Bram Molenaar�MSven Guckes�C
+      �Nvimtutor1.4��Ķ�����浹Bram Moolenaar�MSven Guckes�C
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh.euc b/runtime/tutor/tutor.zh.euc
index df59c32089..50852f8105 100644
--- a/runtime/tutor/tutor.zh.euc
+++ b/runtime/tutor/tutor.zh.euc
@@ -988,9 +988,9 @@
       ��л xuandong@sh163.net ��ָ����������������������
 
       2002��03��18�� ����̩ <linuxrat@gnuchina.org>
-      ����Bram Molenaar������2002��03��16�յ�����Ҫ�󣬽�vimtutor1.4����
+      ����Bram Moolenaar������2002��03��16�յ�����Ҫ�󣬽�vimtutor1.4����
       ��������vimtutor1.5��
 
       2001��11��15�� ����̩ <linuxrat@gnuchina.org>
-      ��vimtutor1.4������ύ��Bram Molenaar��Sven Guckes��
+      ��vimtutor1.4������ύ��Bram Moolenaar��Sven Guckes��
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh.utf-8 b/runtime/tutor/tutor.zh.utf-8
index 21d702051d..d1fabc236d 100644
--- a/runtime/tutor/tutor.zh.utf-8
+++ b/runtime/tutor/tutor.zh.utf-8
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
       感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
 
       2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
-      根據Bram Molenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
+      根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
       版升級到vimtutor1.5。
 
       2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
-      將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
+      將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh_cn.utf-8 b/runtime/tutor/tutor.zh_cn.utf-8
index 3ff031f7c5..d986ab2645 100644
--- a/runtime/tutor/tutor.zh_cn.utf-8
+++ b/runtime/tutor/tutor.zh_cn.utf-8
@@ -988,9 +988,9 @@
       感谢 xuandong@sh163.net 的指正,将两处错别字修正。
 
       2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
-      根据Bram Molenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译
+      根据Bram Moolenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译
       版升级到vimtutor1.5。
 
       2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
-      将vimtutor1.4中译版提交给Bram Molenaar和Sven Guckes。
+      将vimtutor1.4中译版提交给Bram Moolenaar和Sven Guckes。
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.zh_tw.utf-8 b/runtime/tutor/tutor.zh_tw.utf-8
index 21d702051d..d1fabc236d 100644
--- a/runtime/tutor/tutor.zh_tw.utf-8
+++ b/runtime/tutor/tutor.zh_tw.utf-8
@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
       感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
 
       2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
-      根據Bram Molenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
+      根據Bram Moolenaar先生在2002年03月16日的來信要求,將vimtutor1.4中譯
       版升級到vimtutor1.5。
 
       2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
-      將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
+      將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From 0ee3352a53012f8950ed57d554e509df723dc188 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 23:05:54 +0200
Subject: [PATCH 063/473] updated for version 7.4.414 Problem:    Cannot define
 a command only when it's used. Solution:   Add the CmdUndefined autocommand
 event. (partly by Yasuhiro 	    Matsumoto)

---
 runtime/doc/autocmd.txt | 13 +++++++++++++
 src/ex_docmd.c          | 20 ++++++++++++++++++++
 src/fileio.c            | 19 +++++++++++++++++++
 src/proto/fileio.pro    |  2 ++
 src/version.c           |  2 ++
 5 files changed, 56 insertions(+)

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 2a8becebff..079b916770 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -278,6 +278,7 @@ Name			triggered by ~
 |ShellCmdPost|		after executing a shell command
 |ShellFilterPost|	after filtering with a shell command
 
+|CmdUndefined|		a user command is used but it isn't defined
 |FuncUndefined|		a user function is used but it isn't defined
 |SpellFileMissing|	a spell file is used but it can't be found
 |SourcePre|		before sourcing a Vim script
@@ -465,6 +466,16 @@ BufWriteCmd			Before writing the whole buffer to a file.
 							*BufWritePost*
 BufWritePost			After writing the whole buffer to a file
 				(should undo the commands for BufWritePre).
+							*CmdUndefined*
+CmdUndefined			When a user command is used but it isn't
+				defined.  Useful for defining a command only
+				when it's used.  The pattern is matched
+				against the command name.  Both <amatch> and
+				<afile> are set to the name of the command.
+				NOTE: Autocompletion won't work until the
+				command is defined.  An alternative is to
+				always define the user command and have it
+				invoke an autoloaded function.  See |autoload|.
 							*CmdwinEnter*
 CmdwinEnter			After entering the command-line window.
 				Useful for setting options specifically for
@@ -670,6 +681,8 @@ FuncUndefined			When a user function is used but it isn't
 				when it's used.  The pattern is matched
 				against the function name.  Both <amatch> and
 				<afile> are set to the name of the function.
+				NOTE: When writing Vim scripts a better
+				alternative is to use an autoloaded function.
 				See |autoload-functions|.
 							*GUIEnter*
 GUIEnter			After starting the GUI successfully, and after
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fecb653b54..6826951737 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2143,6 +2143,26 @@ do_one_cmd(cmdlinep, sourcing,
     /* Find the command and let "p" point to after it. */
     p = find_command(&ea, NULL);
 
+#ifdef FEAT_AUTOCMD
+    /* If this looks like an undefined user command and there are CmdUndefined
+     * autocommands defined, trigger the matching autocommands. */
+    if (p != NULL && ea.cmdidx == CMD_SIZE && !ea.skip
+	    && ASCII_ISUPPER(*ea.cmd)
+	    && has_cmdundefined())
+    {
+	char_u *p = ea.cmd;
+	int ret;
+
+	while (ASCII_ISALNUM(*p))
+	    ++p;
+	p = vim_strnsave(ea.cmd, p - ea.cmd);
+	ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
+	vim_free(p);
+	if (ret && !aborting())
+	    p = find_command(&ea, NULL);
+    }
+#endif
+
 #ifdef FEAT_USR_CMDS
     if (p == NULL)
     {
diff --git a/src/fileio.c b/src/fileio.c
index 17490ac21a..f2d2040786 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7641,6 +7641,7 @@ static struct event_name
     {"BufWriteCmd",	EVENT_BUFWRITECMD},
     {"CmdwinEnter",	EVENT_CMDWINENTER},
     {"CmdwinLeave",	EVENT_CMDWINLEAVE},
+    {"CmdUndefined",	EVENT_CMDUNDEFINED},
     {"ColorScheme",	EVENT_COLORSCHEME},
     {"CompleteDone",	EVENT_COMPLETEDONE},
     {"CursorHold",	EVENT_CURSORHOLD},
@@ -9159,6 +9160,24 @@ has_insertcharpre()
     return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
 }
 
+/*
+ * Return TRUE when there is an CmdUndefined autocommand defined.
+ */
+    int
+has_cmdundefined()
+{
+    return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
+}
+
+/*
+ * Return TRUE when there is an FuncUndefined autocommand defined.
+ */
+    int
+has_funcundefined()
+{
+    return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
+}
+
     static int
 apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
     event_T	event;
diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro
index 0d532f4ce2..5b71d0aadc 100644
--- a/src/proto/fileio.pro
+++ b/src/proto/fileio.pro
@@ -47,6 +47,8 @@ int has_cursormovedI __ARGS((void));
 int has_textchanged __ARGS((void));
 int has_textchangedI __ARGS((void));
 int has_insertcharpre __ARGS((void));
+int has_cmdundefined __ARGS((void));
+int has_funcundefined __ARGS((void));
 void block_autocmds __ARGS((void));
 void unblock_autocmds __ARGS((void));
 int is_autocmd_blocked __ARGS((void));
diff --git a/src/version.c b/src/version.c
index e742d187c1..ae87bb5a04 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    414,
 /**/
     413,
 /**/

From 0ce08db493bd90d6dcef92779a49427c939156b9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 22 Aug 2014 23:05:54 +0200
Subject: [PATCH 064/473] Added tag v7-4-414 for changeset 67edf731a240

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5b3ad613ec..e3488afbda 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3136,3 +3136,4 @@ de35e123e63c326be4a576f8e678ed9e63ed1f48 v7-4-409
 d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 4c845a1600d28db8edabd211e6d7a9cd03883ea6 v7-4-412
 121613e72e397db495f5e9b640b249aead5a61c1 v7-4-413
+67edf731a2403a8023440184872159ddc073093c v7-4-414

From 51b236c6ad0357324c59bd25c72e2ae067e74762 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 23 Aug 2014 14:16:20 +0200
Subject: [PATCH 065/473] updated for version 7.4.415 Problem:    Cannot build.
  Warning for shadowed variable. (John Little) Solution:   Add missing change.
  Remove declaration.

---
 src/ex_docmd.c | 2 +-
 src/vim.h      | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 6826951737..c4cf1f9e1b 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2150,9 +2150,9 @@ do_one_cmd(cmdlinep, sourcing,
 	    && ASCII_ISUPPER(*ea.cmd)
 	    && has_cmdundefined())
     {
-	char_u *p = ea.cmd;
 	int ret;
 
+	p = ea.cmd;
 	while (ASCII_ISALNUM(*p))
 	    ++p;
 	p = vim_strnsave(ea.cmd, p - ea.cmd);
diff --git a/src/vim.h b/src/vim.h
index 887a76d1f4..cb2a9e5b3b 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1326,6 +1326,7 @@ enum auto_event
     EVENT_SHELLFILTERPOST,	/* after ":1,2!cmd", ":w !cmd", ":r !cmd". */
     EVENT_TEXTCHANGED,		/* text was modified */
     EVENT_TEXTCHANGEDI,		/* text was modified in Insert mode*/
+    EVENT_CMDUNDEFINED,		/* command undefined */
     NUM_EVENTS			/* MUST be the last one */
 };
 

From 51894ab1782d8fe0f8600bc5b343ed2ec667ff4a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 23 Aug 2014 14:16:20 +0200
Subject: [PATCH 066/473] Added tag v7-4-415 for changeset 20dbceb6f471

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e3488afbda..9ee6e19571 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3137,3 +3137,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 4c845a1600d28db8edabd211e6d7a9cd03883ea6 v7-4-412
 121613e72e397db495f5e9b640b249aead5a61c1 v7-4-413
 67edf731a2403a8023440184872159ddc073093c v7-4-414
+20dbceb6f4713ccd01be45dc531abc269fbb7579 v7-4-415

From 3f46d71d530c998c0278bf479d474251cf1a7e49 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 23 Aug 2014 14:18:52 +0200
Subject: [PATCH 067/473] Update version number to 7.4.415

---
 src/version.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/version.c b/src/version.c
index ae87bb5a04..15b676c1d1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    415,
 /**/
     414,
 /**/

From fd2995bea16cbfe29503b25167c458f6e9a7ca23 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 23 Aug 2014 15:31:19 +0200
Subject: [PATCH 068/473] Runtime file updates.

---
 runtime/doc/autocmd.txt |   2 +-
 runtime/doc/tags        |   1 +
 runtime/doc/todo.txt    |   8 +--
 runtime/filetype.vim    |   4 +-
 runtime/indent/html.vim |   6 +-
 runtime/syntax/json.vim | 151 ++++++++++++++++++++++++++++++++++++----
 runtime/syntax/rst.vim  |  28 ++++----
 7 files changed, 163 insertions(+), 37 deletions(-)

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 079b916770..03f95cac6d 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 7.4.  Last change: 2014 May 02
+*autocmd.txt*   For Vim version 7.4.  Last change: 2014 Aug 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 55f221f480..c0df15d3b1 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -3454,6 +3454,7 @@ CTRL-^	editing.txt	/*CTRL-^*
 CTRL-{char}	intro.txt	/*CTRL-{char}*
 Chinese	mbyte.txt	/*Chinese*
 Cmd-event	autocmd.txt	/*Cmd-event*
+CmdUndefined	autocmd.txt	/*CmdUndefined*
 Cmdline	cmdline.txt	/*Cmdline*
 Cmdline-mode	cmdline.txt	/*Cmdline-mode*
 CmdwinEnter	autocmd.txt	/*CmdwinEnter*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 4be7867ef6..4b2a3db8d8 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 22
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 23
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -54,10 +54,6 @@ Regexp problems:
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
 More info Jul 24.  Not clear why.
 
-Patch for:
-    CmdUndefined    - Like FuncUndefined but for user commands.
-Yasuhiro Matsumoto, 2014 Aug 18
-
 Patch to make getregtype() return the right size for non-linux systems.
 (Yasuhiro Matsumoto, 2014 Jul 8)
 Breaks test_eval.  Inefficient, can we only compute y_width when needed?
@@ -265,7 +261,7 @@ Issue 28.
 Go through more coverity reports.
 
 Patch to add ":undorecover", get as much text out of the undo file as
-possible. (Christian Brabandt, 2014 Mar 12, update Aug 16)
+possible. (Christian Brabandt, 2014 Mar 12, update Aug 22)
 
 Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
 
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 91afa65a80..68b795ad47 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Aug 22
+" Last Change:	2014 Aug 23
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1011,7 +1011,7 @@ au BufNewFile,BufRead *.jgr			setf jgraph
 au BufNewFile,BufRead *.jov,*.j73,*.jovial	setf jovial
 
 " JSON
-au BufNewFile,BufRead *.json			setf json
+au BufNewFile,BufRead *.json,*.jsonp		setf json
 
 " Kixtart
 au BufNewFile,BufRead *.kix			setf kix
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index b5374bd68a..d64a0e5cd3 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
 " Header: "{{{
 " Maintainer:	Bram Moolenaar
 " Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change:	2014 Jul 04
+" Last Change:	2014 Aug 23
 " Version:	1.0
 " Description:	HTML indent script with cached state for faster indenting on a
 "		range of lines.
@@ -497,7 +497,7 @@ func! s:FreshState(lnum)
   " If previous line ended in a closing tag, line up with the opening tag.
   if !swendtag && text =~ '</\w\+\s*>\s*$'
     call cursor(state.lnum, 99999)
-    normal F<
+    normal! F<
     let start_lnum = HtmlIndent_FindStartTag()
     if start_lnum > 0
       let state.baseindent = indent(start_lnum)
@@ -898,7 +898,7 @@ func! HtmlIndent()
   " a tag works very differently. Do not do this when the line starts with
   " "<", it gets the "htmlTag" ID but we are not inside a tag then.
   if curtext !~ '^\s*<'
-    normal ^
+    normal! ^
     let stack = synstack(v:lnum, col('.'))  " assumes there are no tabs
     let foundHtmlString = 0
     for synid in reverse(stack)
diff --git a/runtime/syntax/json.vim b/runtime/syntax/json.vim
index f2d880b1d0..1fdfea2d09 100644
--- a/runtime/syntax/json.vim
+++ b/runtime/syntax/json.vim
@@ -1,16 +1,143 @@
 " Vim syntax file
-" Language:		JSON
-" Maintainer:		David Barnett <daviebdawg+vim@gmail.com>
-" Last Change:		2014 Jul 16
-
-" For version 5.x: Clear all syntax items.
-" For version 6.x and later: Quit when a syntax file was already loaded.
-if exists('b:current_syntax')
-  finish
+" Language:	JSON
+" Maintainer:	Eli Parra <eli@elzr.com>
+" Last Change:	2014 Aug 23
+" Version:      0.12
+
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  let main_syntax = 'json'
+endif
+
+syntax match   jsonNoise           /\%(:\|,\)/
+
+" NOTE that for the concealing to work your conceallevel should be set to 2
+
+" Syntax: Strings
+" Separated into a match and region because a region by itself is always greedy
+syn match  jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
+if has('conceal')
+	syn region  jsonString oneline matchgroup=jsonQuote start=/"/  skip=/\\\\\|\\"/  end=/"/ concealends contains=jsonEscape contained
+else
+	syn region  jsonString oneline matchgroup=jsonQuote start=/"/  skip=/\\\\\|\\"/  end=/"/ contains=jsonEscape contained
+endif
+
+" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
+syn region  jsonStringSQError oneline  start=+'+  skip=+\\\\\|\\"+  end=+'+
+
+" Syntax: JSON Keywords
+" Separated into a match and region because a region by itself is always greedy
+syn match  jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
+if has('conceal')
+   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
+else
+   syn region  jsonKeyword matchgroup=jsonQuote start=/"/  end=/"\ze[[:blank:]\r\n]*\:/ contained
+endif
+
+" Syntax: Escape sequences
+syn match   jsonEscape    "\\["\\/bfnrt]" contained
+syn match   jsonEscape    "\\u\x\{4}" contained
+
+" Syntax: Numbers
+syn match   jsonNumber    "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
+
+" ERROR WARNINGS **********************************************
+if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
+	" Syntax: Strings should always be enclosed with quotes.
+	syn match   jsonNoQuotesError  "\<[[:alpha:]][[:alnum:]]*\>"
+	syn match   jsonTripleQuotesError  /"""/
+
+	" Syntax: An integer part of 0 followed by other digits is not allowed.
+	syn match   jsonNumError  "-\=\<0\d\.\d*\>"
+
+	" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
+	syn match   jsonNumError  "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
+
+	" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
+	syn match   jsonCommentError  "//.*"
+	syn match   jsonCommentError  "\(/\*\)\|\(\*/\)"
+
+	" Syntax: No semicolons in JSON
+	syn match   jsonSemicolonError  ";"
+
+	" Syntax: No trailing comma after the last element of arrays or objects
+	syn match   jsonTrailingCommaError  ",\_s*[}\]]"
+
+	" Syntax: Watch out for missing commas between elements
+	syn match   jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
+	syn match   jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
+	syn match   jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
+	syn match   jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
+endif
+
+" ********************************************** END OF ERROR WARNINGS
+" Allowances for JSONP: function call at the beginning of the file,
+" parenthesis and semicolon at the end.
+" Function name validation based on
+" http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444
+syn match  jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*("
+syn match  jsonPadding ");[[:blank:]\r\n]*\%$"
+
+" Syntax: Boolean
+syn match  jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/
+
+" Syntax: Null
+syn keyword  jsonNull      null
+
+" Syntax: Braces
+syn region  jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold
+syn region  jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_json_syn_inits")
+  if version < 508
+    let did_json_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+  HiLink jsonPadding         Operator
+  HiLink jsonString          String
+  HiLink jsonTest          Label
+  HiLink jsonEscape          Special
+  HiLink jsonNumber          Number
+  HiLink jsonBraces          Delimiter
+  HiLink jsonNull            Function
+  HiLink jsonBoolean         Boolean
+  HiLink jsonKeyword         Label
+
+	if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
+	  HiLink jsonNumError        Error
+	  HiLink jsonCommentError    Error
+	  HiLink jsonSemicolonError  Error
+	  HiLink jsonTrailingCommaError     Error
+	  HiLink jsonMissingCommaError      Error
+	  HiLink jsonStringSQError        	Error
+	  HiLink jsonNoQuotesError        	Error
+	  HiLink jsonTripleQuotesError     	Error
+  endif
+  HiLink jsonQuote           Quote
+  HiLink jsonNoise           Noise
+  delcommand HiLink
+endif
+
+let b:current_syntax = "json"
+if main_syntax == 'json'
+  unlet main_syntax
 endif
 
-" Use JavaScript syntax. JSON is a subset of JavaScript.
-runtime! syntax/javascript.vim
-unlet b:current_syntax
+" Vim settings
+" vim: ts=8 fdm=marker
 
-let b:current_syntax = 'json'
+" MIT License
+" Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra
+"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+"THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"See https://twitter.com/elzr/status/294964017926119424
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
index 425d225113..fce9e5dd3e 100644
--- a/runtime/syntax/rst.vim
+++ b/runtime/syntax/rst.vim
@@ -1,7 +1,8 @@
 " Vim syntax file
 " Language:         reStructuredText documentation format
-" Maintainer:       Nikolai Weibull <now@bitwi.se>
-" Latest Revision:  2013-11-26
+" Maintainer:       Marshall Ward <marshall.ward@gmail.com>
+" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision:  2014-08-23
 
 if exists("b:current_syntax")
   finish
@@ -47,7 +48,7 @@ syn match   rstSimpleTableLines     contained display
 syn cluster rstDirectives           contains=rstFootnote,rstCitation,
       \ rstHyperlinkTarget,rstExDirective
 
-syn match   rstExplicitMarkup       '^\.\.\_s'
+syn match   rstExplicitMarkup       '^\s*\.\.\_s'
       \ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition
 
 let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*'
@@ -99,11 +100,11 @@ function! s:DefineInlineMarkup(name, start, middle, end)
         \ ""
 
   call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"') 
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')') 
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]') 
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}') 
-  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>') 
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
+  call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
 
   call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '')
 
@@ -136,23 +137,24 @@ syn match   rstStandaloneHyperlink  contains=@NoSpell
       \ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
 
 syn region rstCodeBlock contained matchgroup=rstDirective
-      \ start=+\%(sourcecode\|code\%(-block\)\=\)::\s+
+      \ start=+\%(sourcecode\|code\%(-block\)\=\)::\_s*\n\ze\z(\s\+\)+
       \ skip=+^$+
-      \ end=+^\s\@!+ 
+      \ end=+^\z1\@!+
       \ contains=@NoSpell
 syn cluster rstDirectives add=rstCodeBlock
 
 if !exists('g:rst_syntax_code_list')
-    let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', 'python', 'perl']
+    let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php',
+                                \ 'python', 'perl', 'sh']
 endif
 
 for code in g:rst_syntax_code_list
     unlet! b:current_syntax
     exe 'syn include @rst'.code.' syntax/'.code.'.vim'
     exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold '
-                \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\s*$# '
+                \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)# '
                 \.'skip=#^$# '
-                \.'end=#^\s\@!# contains=@NoSpell,@rst'.code.' keepend'
+                \.'end=#^\z1\@!# contains=@NoSpell,@rst'.code
     exe 'syn cluster rstDirectives add=rstDirective'.code
 endfor
 

From 9c25923d010496042dd86cf1da1f26e3cff2bb55 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 24 Aug 2014 21:19:25 +0200
Subject: [PATCH 069/473] updated for version 7.4.416 Problem:    Problem with
 breakindent/showbreak and tabs. Solution:   Handle tabs differently.
 (Christian Brabandt)

---
 src/charset.c                   |  5 +----
 src/testdir/test_breakindent.in | 17 +++++++++++++++++
 src/testdir/test_breakindent.ok |  3 +++
 src/version.c                   |  2 ++
 4 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/charset.c b/src/charset.c
index e7aabe7ed5..fcc41ec334 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1195,10 +1195,7 @@ win_lbr_chartabsize(wp, line, s, col, headp)
 	    if (wp->w_p_bri)
 		added += get_breakindent_win(wp, line);
 
-	    if (tab_corr)
-		size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
-	    else
-		size += added;
+	    size += added;
 	    if (col != 0)
 		added = 0;
 	}
diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index 8f40e4f7e5..79e25f79de 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -73,6 +73,23 @@ STARTTEST
 :let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3 " text wraps 3 times
 :$put =g:test
 :$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width)
+:"
+:" Test, that the string "    a\tb\tc\td\te" is correctly
+:" displayed in a 20 column wide window (see bug report
+:" https://groups.google.com/d/msg/vim_dev/ZOdg2mc9c9Y/TT8EhFjEy0IJ
+:only
+:vert 20new
+:set all& nocp breakindent briopt=min:10
+:call setline(1, ["    a\tb\tc\td\te", "    z   y       x       w       v"])
+:/^\s*a
+fbgjyl:let line1 = @0
+:?^\s*z
+fygjyl:let line2 = @0
+:quit!
+:$put ='Test 12: breakindent with wrapping Tab'
+:$put =line1
+:$put =line2
+:"
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_breakindent.ok b/src/testdir/test_breakindent.ok
index 723cb25012..d89d424fb3 100644
--- a/src/testdir/test_breakindent.ok
+++ b/src/testdir/test_breakindent.ok
@@ -53,3 +53,6 @@ Test 4: Simple breakindent + min width: 18
 
  Test 11: strdisplaywidth when breakindent is on
 strdisplaywidth: 46 == calculated: 64
+Test 12: breakindent with wrapping Tab
+d
+w
diff --git a/src/version.c b/src/version.c
index 15b676c1d1..01b9082aa6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    416,
 /**/
     415,
 /**/

From 47bad303c6aa8b1b4c52f5766b9953f508fce19e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 24 Aug 2014 21:19:25 +0200
Subject: [PATCH 070/473] Added tag v7-4-416 for changeset 735bd597a8ff

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9ee6e19571..e2c96237a2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3138,3 +3138,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 121613e72e397db495f5e9b640b249aead5a61c1 v7-4-413
 67edf731a2403a8023440184872159ddc073093c v7-4-414
 20dbceb6f4713ccd01be45dc531abc269fbb7579 v7-4-415
+735bd597a8ffcb00edff68b34a26573b8f3cad9a v7-4-416

From ece4c79bacab30760cff4b4dfced5853058c12ec Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 24 Aug 2014 21:39:49 +0200
Subject: [PATCH 071/473] updated for version 7.4.417 Problem:    After
 splitting a window and setting 'breakindent' the default 	    minimum
 with is not respected. Solution:   Call briopt_check() when copying options
 to a new window.

---
 src/option.c                    | 23 +++++++++++++++--------
 src/proto/option.pro            |  1 -
 src/testdir/test_breakindent.in |  1 +
 src/version.c                   |  2 ++
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/option.c b/src/option.c
index f928b3ba94..855539b584 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3097,6 +3097,9 @@ static void fill_breakat_flags __ARGS((void));
 static int opt_strings_flags __ARGS((char_u *val, char **values, unsigned *flagp, int list));
 static int check_opt_strings __ARGS((char_u *val, char **values, int));
 static int check_opt_wim __ARGS((void));
+#ifdef FEAT_LINEBREAK
+static int briopt_check __ARGS((win_T *wp));
+#endif
 
 /*
  * Initialize the options, first part.
@@ -5289,7 +5292,7 @@ didset_options()
     (void)check_cedit();
 #endif
 #ifdef FEAT_LINEBREAK
-    briopt_check();
+    briopt_check(curwin);
 #endif
 }
 
@@ -5748,7 +5751,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
     /* 'breakindentopt' */
     else if (varp == &curwin->w_p_briopt)
     {
-	if (briopt_check() == FAIL)
+	if (briopt_check(curwin) == FAIL)
 	    errmsg = e_invarg;
     }
 #endif
@@ -10232,6 +10235,9 @@ win_copy_options(wp_from, wp_to)
     wp_to->w_farsi = wp_from->w_farsi;
 #  endif
 # endif
+#if defined(FEAT_LINEBREAK)
+    briopt_check(wp_to);
+#endif
 }
 #endif
 
@@ -12002,15 +12008,16 @@ find_mps_values(initc, findc, backwards, switchit)
  * This is called when 'breakindentopt' is changed and when a window is
  * initialized.
  */
-    int
-briopt_check()
+    static int
+briopt_check(wp)
+    win_T *wp;
 {
     char_u	*p;
     int		bri_shift = 0;
     long	bri_min = 20;
     int		bri_sbr = FALSE;
 
-    p = curwin->w_p_briopt;
+    p = wp->w_p_briopt;
     while (*p != NUL)
     {
 	if (STRNCMP(p, "shift:", 6) == 0
@@ -12035,9 +12042,9 @@ briopt_check()
 	    ++p;
     }
 
-    curwin->w_p_brishift = bri_shift;
-    curwin->w_p_brimin   = bri_min;
-    curwin->w_p_brisbr   = bri_sbr;
+    wp->w_p_brishift = bri_shift;
+    wp->w_p_brimin   = bri_min;
+    wp->w_p_brisbr   = bri_sbr;
 
     return OK;
 }
diff --git a/src/proto/option.pro b/src/proto/option.pro
index e426e6cfac..3da74e62d0 100644
--- a/src/proto/option.pro
+++ b/src/proto/option.pro
@@ -62,5 +62,4 @@ int check_ff_value __ARGS((char_u *p));
 long get_sw_value __ARGS((buf_T *buf));
 long get_sts_value __ARGS((void));
 void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
-int briopt_check __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index 79e25f79de..150c9430db 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -27,6 +27,7 @@ STARTTEST
 :	$put =g:line1
 :	wincmd p
 :endfu
+:set briopt=min:0
 :let g:test="Test 1: Simple breakindent"
 :let line1=ScreenChar(8)
 :call DoRecordScreen()
diff --git a/src/version.c b/src/version.c
index 01b9082aa6..ee2598d8b2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    417,
 /**/
     416,
 /**/

From 934e1774cc8ad8add98a2a6bf8ff252ce897350f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 24 Aug 2014 21:39:49 +0200
Subject: [PATCH 072/473] Added tag v7-4-417 for changeset e60327caf909

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e2c96237a2..1e4191596c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3139,3 +3139,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 67edf731a2403a8023440184872159ddc073093c v7-4-414
 20dbceb6f4713ccd01be45dc531abc269fbb7579 v7-4-415
 735bd597a8ffcb00edff68b34a26573b8f3cad9a v7-4-416
+e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417

From 2b5c8fc50617a98d6e079b5f40d678e72b4c3d87 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 09:02:27 +0200
Subject: [PATCH 073/473] updated for version 7.4.418 Problem:    When leaving
 ":append" the cursor shape is like in Insert mode. 	    (Jacob Niehus)
 Solution:   Do not have State set to INSERT when calling getline().

---
 src/ex_cmds.c | 8 ++++++++
 src/version.c | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index df6700d64b..2a81eb7398 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4011,11 +4011,19 @@ ex_append(eap)
 	    eap->nextcmd = p;
 	}
 	else
+	{
+	    int save_State = State;
+
+	    /* Set State to avoid the cursor shape to be set to INSERT mode
+	     * when getline() returns. */
+	    State = CMDLINE;
 	    theline = eap->getline(
 #ifdef FEAT_EVAL
 		    eap->cstack->cs_looplevel > 0 ? -1 :
 #endif
 		    NUL, eap->cookie, indent);
+	    State = save_State;
+	}
 	lines_left = Rows - 1;
 	if (theline == NULL)
 	    break;
diff --git a/src/version.c b/src/version.c
index ee2598d8b2..b2c3289c65 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    418,
 /**/
     417,
 /**/

From 5f59cbfaac599ca626f46d9fcf696a0238b8d4a7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 09:02:28 +0200
Subject: [PATCH 074/473] Added tag v7-4-418 for changeset 00f58478e38b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1e4191596c..ae44489568 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3140,3 +3140,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 20dbceb6f4713ccd01be45dc531abc269fbb7579 v7-4-415
 735bd597a8ffcb00edff68b34a26573b8f3cad9a v7-4-416
 e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
+00f58478e38b68faf783d8fe70c1439fe9dd732d v7-4-418

From e415e355c486b4bb9fc0cf8903edf5eeb41224a3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 09:46:10 +0200
Subject: [PATCH 075/473] updated for version 7.4.419 Problem:    Whan part of
 a list is locked it's possible to make changes. Solution:   Check if any of
 the list items is locked before make a change. 	    (ZyX)

---
 src/eval.c            | 28 ++++++++++++++++++++++++++++
 src/testdir/test55.in | 15 +++++++++++++++
 src/testdir/test55.ok |  5 +++++
 src/version.c         |  2 ++
 4 files changed, 50 insertions(+)

diff --git a/src/eval.c b/src/eval.c
index 654e4187d5..a8e94639df 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2945,6 +2945,23 @@ set_var_lval(lp, endp, rettv, copy, op)
 	;
     else if (lp->ll_range)
     {
+	listitem_T *ll_li = lp->ll_li;
+	int ll_n1 = lp->ll_n1;
+
+	/*
+	 * Check whether any of the list items is locked
+	 */
+	for (ri = rettv->vval.v_list->lv_first; ri != NULL; )
+	{
+	    if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
+		return;
+	    ri = ri->li_next;
+	    if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == ll_n1))
+		break;
+	    ll_li = ll_li->li_next;
+	    ++ll_n1;
+	}
+
 	/*
 	 * Assign the List values to the list items.
 	 */
@@ -3646,6 +3663,17 @@ do_unlet_var(lp, name_end, forceit)
     else if (lp->ll_range)
     {
 	listitem_T    *li;
+	listitem_T    *ll_li = lp->ll_li;
+	int           ll_n1 = lp->ll_n1;
+
+	while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1))
+	{
+	    li = ll_li->li_next;
+	    if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
+		return FAIL;
+	    ll_li = li;
+	    ++ll_n1;
+	}
 
 	/* Delete a range of List items. */
 	while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1))
diff --git a/src/testdir/test55.in b/src/testdir/test55.in
index 8e073f30f2..140cb7c0e5 100644
--- a/src/testdir/test55.in
+++ b/src/testdir/test55.in
@@ -282,6 +282,21 @@ let l = [0, 1, 2, 3]
 :    $put =ps
 :  endfor
 :endfor
+:unlet l
+:let l = [1, 2, 3, 4]
+:lockvar! l
+:$put =string(l)
+:unlockvar l[1]
+:unlet l[0:1]
+:$put =string(l)
+:unlet l[1:2]
+:$put =string(l)
+:unlockvar l[1]
+:let l[0:1] = [0, 1]
+:$put =string(l)
+:let l[1:2] = [0, 1]
+:$put =string(l)
+:unlet l
 :" :lockvar/islocked() triggering script autoloading
 :set rtp+=./sautest
 :lockvar g:footest#x
diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok
index dfd8060db7..e8560de401 100644
--- a/src/testdir/test55.ok
+++ b/src/testdir/test55.ok
@@ -86,6 +86,11 @@ FFFFFFF
 FFpFFpp
 0000-000
 ppppppp
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
+[1, 2, 3, 4]
 locked g:footest#x:-1
 exists g:footest#x:0
 g:footest#x: 1
diff --git a/src/version.c b/src/version.c
index b2c3289c65..d2ea613407 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    419,
 /**/
     418,
 /**/

From 3a2725501744f975515fbeff18d51d6c9231aa71 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 09:46:10 +0200
Subject: [PATCH 076/473] Added tag v7-4-419 for changeset 0a42938f449c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ae44489568..51557579a1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3141,3 +3141,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 735bd597a8ffcb00edff68b34a26573b8f3cad9a v7-4-416
 e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 00f58478e38b68faf783d8fe70c1439fe9dd732d v7-4-418
+0a42938f449cf306a429db373106d5e29d8d4312 v7-4-419

From 8b9cc0771f70c307c661d852e90c879d958b6725 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 10:04:47 +0200
Subject: [PATCH 077/473] updated for version 7.4.420 Problem:    It's not
 obvious how to add a new test. Solution:   Add a README file. (Christian
 Brabandt)

---
 src/testdir/README.txt | 18 ++++++++++++++++++
 src/version.c          |  2 ++
 2 files changed, 20 insertions(+)
 create mode 100644 src/testdir/README.txt

diff --git a/src/testdir/README.txt b/src/testdir/README.txt
new file mode 100644
index 0000000000..d42c7c9bc7
--- /dev/null
+++ b/src/testdir/README.txt
@@ -0,0 +1,18 @@
+This directory contains tests for various Vim features.
+
+If it makes sense, try to add a new test to an already existing file.  You may
+want to separate it from other tests in that file using :" (that's an Ex
+command comment).
+
+The numbered tests are older, we have switched to named tests.
+
+To add a new test:
+1) Create test_<subject>.in and test_<subject>.ok files.
+2) Add them to all Makefiles (Make*) in alphabetical order (search for an
+   existing test_file.out to see where to add the new one).
+3) Use make test_<subject>.out to run a single test file in src/testdir/.
+4) Also add an entry in src/Makefile.
+
+Keep in mind that the files are used as if everything was typed.
+A line break is like pressing Enter.  If that happens on the last line you'll
+hear a beep.
diff --git a/src/version.c b/src/version.c
index d2ea613407..a34bef22b2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    420,
 /**/
     419,
 /**/

From 709de6959926f69f6bd2fa916dd4d731d1d34802 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 10:04:47 +0200
Subject: [PATCH 078/473] Added tag v7-4-420 for changeset 93aa03401309

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 51557579a1..cfec6486c3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3142,3 +3142,4 @@ d4e0c197e97968050596f4c441552383e31db63b v7-4-411
 e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 00f58478e38b68faf783d8fe70c1439fe9dd732d v7-4-418
 0a42938f449cf306a429db373106d5e29d8d4312 v7-4-419
+93aa0340130912c69d4093fc626a3cbb0cc7ad68 v7-4-420

From 584f4087aa8503f6fc9ce6a3492d790c7015b7d4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 11:56:32 +0200
Subject: [PATCH 079/473] updated for version 7.4.421 Problem:    Crash when
 searching for "\ze*". (Urtica Dioica) Solution:   Disallow a multi after \ze
 and \zs.

---
 src/regexp_nfa.c      | 17 +++++++++++++++++
 src/testdir/test64.in | 13 ++++++++++++-
 src/testdir/test64.ok |  2 ++
 src/version.c         |  2 ++
 4 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index a7fbe7b254..4ccb05a2b3 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -291,6 +291,7 @@ static int nfa_regpiece __ARGS((void));
 static int nfa_regconcat __ARGS((void));
 static int nfa_regbranch __ARGS((void));
 static int nfa_reg __ARGS((int paren));
+static int re_mult_next __ARGS((char *what));
 #ifdef DEBUG
 static void nfa_set_code __ARGS((int c));
 static void nfa_postfix_dump __ARGS((char_u *expr, int retval));
@@ -1323,10 +1324,14 @@ nfa_regatom()
 	    {
 		case 's':
 		    EMIT(NFA_ZSTART);
+		    if (re_mult_next("\\zs") == FAIL)
+			return FAIL;
 		    break;
 		case 'e':
 		    EMIT(NFA_ZEND);
 		    nfa_has_zend = TRUE;
+		    if (re_mult_next("\\ze") == FAIL)
+			return FAIL;
 		    break;
 #ifdef FEAT_SYN_HL
 		case '1':
@@ -2276,6 +2281,18 @@ nfa_reg(paren)
     return OK;
 }
 
+/*
+ * Used in a place where no * or \+ can follow.
+ */
+    static int
+re_mult_next(what)
+    char *what;
+{
+    if (re_multi_type(peekchr()) == MULTI_MULT)
+	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
+    return OK;
+}
+
 #ifdef DEBUG
 static char_u code[50];
 
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index 2abdcd1c08..f2452fc0f3 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -459,7 +459,7 @@ STARTTEST
 :  let text = t[2]
 :  let matchidx = 3
 :  for engine in [0, 1, 2]
-:    if engine == 2 && re == 0 || engine == 1 && re ==1
+:    if engine == 2 && re == 0 || engine == 1 && re == 1
 :      continue
 :    endif
 :    let &regexpengine = engine
@@ -608,6 +608,17 @@ yeGopA END:"
 "ayb20gg/..\%$
 "bybGo"apo"bp:"
 :"
+:" Check for detecting error
+:set regexpengine=2
+:for pat in [' \ze*', ' \zs*']
+:  try
+:    let l = matchlist('x x', pat)
+:    $put ='E888 NOT detected for ' . pat
+:  catch
+:    $put ='E888 detected for ' . pat
+:  endtry
+:endfor
+:"
 :""""" Write the results """""""""""""
 :/\%#=1^Results/,$wq! test.out
 ENDTEST
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index e7d173141a..ffc0b5341f 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -1097,3 +1097,5 @@ Test
 Test END
 EN
 E
+E888 detected for  \ze*
+E888 detected for  \zs*
diff --git a/src/version.c b/src/version.c
index a34bef22b2..d047c9b8db 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    421,
 /**/
     420,
 /**/

From be06c96d82a676a79d62a2c02dd899741f861bf2 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 11:56:32 +0200
Subject: [PATCH 080/473] Added tag v7-4-421 for changeset 3ee39fe2df7d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index cfec6486c3..bec9d6f49c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3143,3 +3143,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 00f58478e38b68faf783d8fe70c1439fe9dd732d v7-4-418
 0a42938f449cf306a429db373106d5e29d8d4312 v7-4-419
 93aa0340130912c69d4093fc626a3cbb0cc7ad68 v7-4-420
+3ee39fe2df7d60d6376b3429383c5c5e3f9bb3fe v7-4-421

From 03329b04aadde58e32888804436b08d956ed39b3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 12:08:43 +0200
Subject: [PATCH 081/473] =?UTF-8?q?updated=20for=20version=207.4.422=20Pro?=
 =?UTF-8?q?blem:=20=20=20=20When=20using=20conceal=20with=20linebreak=20so?=
 =?UTF-8?q?me=20text=20is=20not=20displayed=20=09=20=20=20=20correctly.=20?=
 =?UTF-8?q?(Gr=C3=BCner=20Gimpel)=20Solution:=20=20=20Check=20for=20concea?=
 =?UTF-8?q?l=20mode=20when=20using=20linebreak.=20(Christian=20Brabandt)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/screen.c                | 11 +++++++++++
 src/testdir/test_listlbr.in | 10 ++++++++++
 src/testdir/test_listlbr.ok |  7 +++++++
 src/version.c               |  2 ++
 4 files changed, 30 insertions(+)

diff --git a/src/screen.c b/src/screen.c
index 4c134f0e6d..7a9311a453 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4514,6 +4514,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
 			int	i;
 			int	saved_nextra = n_extra;
 
+#ifdef FEAT_CONCEAL
+			if (is_concealing && vcol_off > 0)
+			    /* there are characters to conceal */
+			    tab_len += vcol_off;
+#endif
 			/* if n_extra > 0, it gives the number of chars, to
 			 * use for a tab, else we need to calculate the width
 			 * for a tab */
@@ -4539,6 +4544,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
 #endif
 			}
 			p_extra = p_extra_free;
+#ifdef FEAT_CONCEAL
+			/* n_extra will be increased by FIX_FOX_BOGUSCOLS
+			 * macro below, so need to adjust for that here */
+			if (is_concealing && vcol_off > 0)
+			    n_extra -= vcol_off;
+#endif
 		    }
 #endif
 #ifdef FEAT_CONCEAL
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
index 0cce4c23a5..2f28126554 100644
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -46,6 +46,16 @@ STARTTEST
 :redraw!
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
+:let line="_S_\t bla"
+:$put =line
+:$
+:norm! zt
+:let g:test ="Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)"
+:set cpo&vim list linebreak conceallevel=2 concealcursor=nv listchars=tab:ab
+:syn match ConcealVar contained /_/ conceal
+:syn match All /.*/ contains=ConcealVar
+:let line=ScreenChar(winwidth(0))
+:call DoRecordScreen()
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
index be323d4dc7..9b8037f4d3 100644
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -25,3 +25,10 @@ Test 4: set linebreak with tab and 1 line as long as screen: should break!
 +aaaaaaaaaaaaaaaaaa 
 ~                   
 ~                   
+_S_	 bla
+
+Test 5: set linebreak with conceal and set list and tab displayed by different char (line may not be truncated)
+Sabbbbbb bla        
+~                   
+~                   
+~                   
diff --git a/src/version.c b/src/version.c
index d047c9b8db..31d1b34d59 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    422,
 /**/
     421,
 /**/

From df78eccff1c4d37af2cfb3c8081b763c7063d3e1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 12:08:43 +0200
Subject: [PATCH 082/473] Added tag v7-4-422 for changeset 69da1498ce89

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bec9d6f49c..e7055cf90c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3144,3 +3144,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 0a42938f449cf306a429db373106d5e29d8d4312 v7-4-419
 93aa0340130912c69d4093fc626a3cbb0cc7ad68 v7-4-420
 3ee39fe2df7d60d6376b3429383c5c5e3f9bb3fe v7-4-421
+69da1498ce89dd093935c0e5013e1df8060a4e80 v7-4-422

From f8ad89d65ac9a61502068db56d6ebecaa7438f82 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 12:58:44 +0200
Subject: [PATCH 083/473] updated for version 7.4.423 Problem:   
 expand("$shell") does not work as documented. Solution:   Do not escape the $
 when expanding environment variables.

---
 src/misc1.c   | 5 +++--
 src/os_unix.c | 8 +++++---
 src/version.c | 2 ++
 src/vim.h     | 1 +
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/misc1.c b/src/misc1.c
index 6ae72cfbba..e3e7da8245 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -78,7 +78,8 @@ get_indent_str(ptr, ts, list)
 	    if (!list || lcs_tab1)    /* count a tab for what it is worth */
 		count += ts - (count % ts);
 	    else
-	/* in list mode, when tab is not set, count screen char width for Tab: ^I */
+		/* In list mode, when tab is not set, count screen char width
+		 * for Tab, displays: ^I */
 		count += ptr2cells(ptr);
 	}
 	else if (*ptr == ' ')
@@ -10767,7 +10768,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
 		    vim_free(p);
 		    ga_clear_strings(&ga);
 		    i = mch_expand_wildcards(num_pat, pat, num_file, file,
-								       flags);
+							 flags|EW_KEEPDOLLAR);
 		    recursive = FALSE;
 		    return i;
 		}
diff --git a/src/os_unix.c b/src/os_unix.c
index 124c2693bc..b49afc3f8a 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5939,10 +5939,12 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
 			*p++ = '\\';
 		    ++j;
 		}
-		else if (!intick && vim_strchr(SHELL_SPECIAL,
-							   pat[i][j]) != NULL)
+		else if (!intick
+			 && ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
+			      && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL)
 		    /* Put a backslash before a special character, but not
-		     * when inside ``. */
+		     * when inside ``. And not for $var when EW_KEEPDOLLAR is
+		     * set. */
 		    *p++ = '\\';
 
 		/* Copy one character. */
diff --git a/src/version.c b/src/version.c
index 31d1b34d59..d8ed2a03a0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    423,
 /**/
     422,
 /**/
diff --git a/src/vim.h b/src/vim.h
index cb2a9e5b3b..2a6d9a0445 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -835,6 +835,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define EW_ICASE	0x100	/* ignore case */
 #define EW_NOERROR	0x200	/* no error for bad regexp */
 #define EW_NOTWILD	0x400	/* add match with literal name if exists */
+#define EW_KEEPDOLLAR	0x800	/* do not escape $, $var is expanded */
 /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
  * is used when executing commands and EW_SILENT for interactive expanding. */
 

From bb577252865cbaabf07a486d6cc90d873a50006f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 12:58:44 +0200
Subject: [PATCH 084/473] Added tag v7-4-423 for changeset 96a4fa8e530c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e7055cf90c..447b704698 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3145,3 +3145,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 93aa0340130912c69d4093fc626a3cbb0cc7ad68 v7-4-420
 3ee39fe2df7d60d6376b3429383c5c5e3f9bb3fe v7-4-421
 69da1498ce89dd093935c0e5013e1df8060a4e80 v7-4-422
+96a4fa8e530c12137af235a9aaad57d578f9eebd v7-4-423

From 3e23be3b811cee864b31cab3e702f319f6cca89e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 13:49:52 +0200
Subject: [PATCH 085/473] updated for version 7.4.424 Problem:    Get ml_get
 error when using Python to delete lines in a buffer 	    that is not in a
 window.  issue 248. Solution:   Do not try adjusting the cursor for a
 different buffer.

---
 src/if_py_both.h | 4 +++-
 src/version.c    | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/if_py_both.h b/src/if_py_both.h
index bf5ea4cf38..5044afbeff 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -4196,7 +4196,9 @@ SetBufferLineList(
 		    break;
 		}
 	    }
-	    if (buf == curbuf)
+	    if (buf == curbuf && (save_curwin != NULL || save_curbuf == NULL))
+		/* Using an existing window for the buffer, adjust the cursor
+		 * position. */
 		py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)-n);
 	    if (save_curbuf == NULL)
 		/* Only adjust marks if we managed to switch to a window that
diff --git a/src/version.c b/src/version.c
index d8ed2a03a0..a3e113961f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    424,
 /**/
     423,
 /**/

From e68cb8ab76c3827052f2914b8ec330a5edb52e98 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 13:49:52 +0200
Subject: [PATCH 086/473] Added tag v7-4-424 for changeset 85a1802ae810

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 447b704698..4a2fb16886 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3146,3 +3146,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 3ee39fe2df7d60d6376b3429383c5c5e3f9bb3fe v7-4-421
 69da1498ce89dd093935c0e5013e1df8060a4e80 v7-4-422
 96a4fa8e530c12137af235a9aaad57d578f9eebd v7-4-423
+85a1802ae810f0e840f8b5d8f2827b4199b39750 v7-4-424

From 76a41dcbf20dc6832203ba255f6cf9f08afa555f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 14:20:51 +0200
Subject: [PATCH 087/473] updated for version 7.4.425 Problem:    When
 'showbreak' is used "gj" may move to the wrong position. 	    (Nazri
 Ramliy) Solution:   Adjust virtcol when 'showbreak' is set. (Christian
 Brabandt)

---
 src/normal.c  | 8 +++++++-
 src/version.c | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/normal.c b/src/normal.c
index fc9e94480e..7479ac7891 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4509,13 +4509,19 @@ nv_screengo(oap, dir, dist)
 #if defined(FEAT_LINEBREAK) || defined(FEAT_MBYTE)
     if (curwin->w_cursor.col > 0 && curwin->w_p_wrap)
     {
+	colnr_T virtcol;
+
 	/*
 	 * Check for landing on a character that got split at the end of the
 	 * last line.  We want to advance a screenline, not end up in the same
 	 * screenline or move two screenlines.
 	 */
 	validate_virtcol();
-	if (curwin->w_virtcol > curwin->w_curswant
+	virtcol = curwin->w_virtcol;
+	if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
+	    virtcol -= vim_strsize(p_sbr);
+
+	if (virtcol > curwin->w_curswant
 		&& (curwin->w_curswant < (colnr_T)width1
 		    ? (curwin->w_curswant > (colnr_T)width1 / 2)
 		    : ((curwin->w_curswant - width1) % width2
diff --git a/src/version.c b/src/version.c
index a3e113961f..32a6b3bd0c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    425,
 /**/
     424,
 /**/

From e0db335021f25b307a437021b70f804df2a83f23 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 14:20:51 +0200
Subject: [PATCH 088/473] Added tag v7-4-425 for changeset 2e804ebb3ee8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 4a2fb16886..70f8877c1b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3147,3 +3147,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 69da1498ce89dd093935c0e5013e1df8060a4e80 v7-4-422
 96a4fa8e530c12137af235a9aaad57d578f9eebd v7-4-423
 85a1802ae810f0e840f8b5d8f2827b4199b39750 v7-4-424
+2e804ebb3ee8cd59451f8f1c1be2f09ebce0d77a v7-4-425

From 41c83538a06e1bc8ae78445b43ea8a5d5b9df925 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 15:12:19 +0200
Subject: [PATCH 089/473] Update runtime files.

---
 runtime/doc/eval.txt            |  17 ++--
 runtime/doc/os_vms.txt          |   4 +-
 runtime/doc/os_win32.txt        |   4 +-
 runtime/doc/pattern.txt         |   4 +-
 runtime/doc/syntax.txt          |   4 +-
 runtime/doc/tags                |   2 +
 runtime/doc/todo.txt            |  36 ++++---
 runtime/doc/usr_04.txt          |   4 +-
 runtime/doc/version6.txt        |   4 +-
 runtime/doc/version7.txt        |  20 ++--
 runtime/filetype.vim            |   5 +-
 runtime/ftplugin/dockerfile.vim |  16 +++
 runtime/indent/json.vim         | 169 ++++++++++++++++++++++++++++++--
 runtime/scripts.vim             |   6 +-
 runtime/syntax/asciidoc.vim     |   4 +-
 runtime/syntax/dockerfile.vim   |  24 +++++
 16 files changed, 268 insertions(+), 55 deletions(-)
 create mode 100644 runtime/ftplugin/dockerfile.vim
 create mode 100644 runtime/syntax/dockerfile.vim

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 28cbb927b9..9aa97b7f76 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Aug 16
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1102,9 +1102,9 @@ are known inside the current Vim session.  Using expand() will first try using
 the environment variables known inside the current Vim session.  If that
 fails, a shell will be used to expand the variable.  This can be slow, but it
 does expand all variables that the shell knows about.  Example: >
-	:echo $version
-	:echo expand("$version")
-The first one probably doesn't echo anything, the second echoes the $version
+	:echo $shell
+	:echo expand("$shell")
+The first one probably doesn't echo anything, the second echoes the $shell
 variable (if your shell supports it).
 
 
@@ -2622,7 +2622,7 @@ cursor({list})
 		line.
 		If {col} is zero, the cursor will stay in the current column.
 		If {curswant} is given it is used to set the preferred column
-		for vertical movment.  Otherwise {col} is used.
+		for vertical movement.  Otherwise {col} is used.
 		When 'virtualedit' is used {off} specifies the offset in
 		screen columns from the start of the character.  E.g., a
 		position within a <Tab> or after the last character.
@@ -2913,7 +2913,8 @@ expand({expr} [, {nosuf} [, {list}]])				*expand()*
 <
 		Expand() can also be used to expand variables and environment
 		variables that are only known in a shell.  But this can be
-		slow, because a shell must be started.	See |expr-env-expand|.
+		slow, because a shell may be used to do the expansion.  See
+		|expr-env-expand|.
 		The expanded variable is still handled like a list of file
 		names.	When an environment variable cannot be expanded, it is
 		left unchanged.  Thus ":echo expand('$FOOBAR')" results in
@@ -5490,7 +5491,7 @@ setreg({regname}, {value} [,{options}])
 		Returns zero for success, non-zero for failure.
 
 							*E883*
-		Note: you may not use |List| containing more then one item to 
+		Note: you may not use |List| containing more than one item to 
 		      set search and expression registers. Lists containing no 
 		      items act like empty strings.
 
@@ -5640,7 +5641,7 @@ sort({list} [, {func} [, {dict}]])			*sort()* *E702*
 		after Strings, |Lists| after Numbers.  For sorting text in the
 		current buffer use |:sort|.
 
-		When {func} is given and it is is '1' or 'i' then case is
+		When {func} is given and it is '1' or 'i' then case is
 		ignored.
 		
 		When {func} is given and it is 'n' then all items will be
diff --git a/runtime/doc/os_vms.txt b/runtime/doc/os_vms.txt
index 03b11ba87e..3e5c05c69b 100644
--- a/runtime/doc/os_vms.txt
+++ b/runtime/doc/os_vms.txt
@@ -1,4 +1,4 @@
-*os_vms.txt*    For Vim version 7.4.  Last change: 2014 Feb 24
+*os_vms.txt*    For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL
@@ -774,7 +774,7 @@ Version 7.4
 - correct RealWaitForChar 
 - after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
   G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
-- guard agains crashes that are caused by mixed filenames
+- guard against crashes that are caused by mixed filenames
 - [TESTDIR]make_vms.mms changed to see the output files
 - Improve tests, update known issues
 - minor compiler warnings fixed
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index a01a06c8ec..80085a8ed0 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt*  For Vim version 7.4.  Last change: 2012 May 18
+*os_win32.txt*  For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL    by George Reilly
@@ -334,7 +334,7 @@ A. You have two possible solutions depending on what you want:
         :!start /min ctags -R .
 <  When it has finished you should see file named "tags" in your current
    directory.  You should notice the window title blinking on your taskbar.
-   This is more noticable for commands that take longer.
+   This is more noticeable for commands that take longer.
    Now delete the "tags" file and run this command: >
         :!start /b ctags -R .
 <  You should have the same "tags" file, but this time there will be no
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index f66ac170ae..205d2d8bf7 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.4.  Last change: 2014 Jul 30
+*pattern.txt*   For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -829,6 +829,7 @@ $	At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
 	branch is used.  Example: >
 		/\(.\{-}\zsFab\)\{3}
 <	Finds the third occurrence of "Fab".
+	This cannot be followed by a multi. *E888*
 	{not in Vi} {not available when compiled without the |+syntax| feature}
 							*/\ze*
 \ze	Matches at any position, and sets the end of the match there: The
@@ -837,6 +838,7 @@ $	At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
 	branch is used.
 	Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
 	"endfor".
+	This cannot be followed by a multi. *E888*
 	{not in Vi} {not available when compiled without the |+syntax| feature}
 
 						*/\%^* *start-of-file*
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 35ea3ad7bc..d47b09a5dd 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.4.  Last change: 2014 Jun 27
+*syntax.txt*	For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -501,7 +501,7 @@ inserted for that purpose if no line numbers are shown. This ID attribute
 takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view
 pages, and is used to jump to a specific line (in a specific window of a diff
 view). Javascript is inserted to open any closed dynamic folds
-(|g:html_dynamic_folds|) containing the specificed line before jumping. The
+(|g:html_dynamic_folds|) containing the specified line before jumping. The
 javascript also allows omitting the window ID in the url, and the leading L.
 For example: >
 
diff --git a/runtime/doc/tags b/runtime/doc/tags
index c0df15d3b1..ae78930886 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4329,6 +4329,8 @@ E884	eval.txt	/*E884*
 E885	sign.txt	/*E885*
 E886	starting.txt	/*E886*
 E887	if_pyth.txt	/*E887*
+E888	pattern.txt	/*E888*
+E888	pattern.txt	/*E888*
 E89	message.txt	/*E89*
 E90	message.txt	/*E90*
 E91	options.txt	/*E91*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 4b2a3db8d8..40caa2ed93 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 23
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -58,15 +58,9 @@ Patch to make getregtype() return the right size for non-linux systems.
 (Yasuhiro Matsumoto, 2014 Jul 8)
 Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 
-Patch to fix a problem with breakindent. (Christian Brabandt, 2014 Aug 17)
-It's actually not a breakindent problem. With test: Aug 19.
-With renamed test: Aug 20
-
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-ml_get error when using Python, issue 248.
-
 Patch to fix typos in help files. (Dominique, 2014 Aug 9)
 
 Way to reproduce problem that characters are put on the screen twice in Insert
@@ -75,11 +69,21 @@ Related to setting TMODE_COOK.  Perhaps we can omit that for system()?
 
 Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13)
 
+exepath() may return the wrong value.  Patch by Yasuhiro Matsumoto, 2014 Aug
+26.
+
+Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
+Also fixes wrong result from executable().
+Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
+
 Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show
 up. (Paul Moore, 2014 Jul 30)
 Should it depend on the Windows version?  Waiting for feedback.
 No longer needed after including DirectX patch?
 
+Fix for ":set all&" not taking care of side effect. (Yukihiro Nakadaira, 2014
+Aug 28)
+
 Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
 14)
     Make ":1close" close the first window.
@@ -104,6 +108,8 @@ Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
 Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
 Prefer the second solution.
 
+Issue 252.  Patch by Christian, 2014 Aug 26.
+
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
@@ -118,7 +124,7 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
 Value returned by virtcol() changes depending on how lines wrap.  This is
-inconsistant with the documentation.
+inconsistent with the documentation.
 
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
@@ -141,20 +147,18 @@ Spell files use a latin single quote. Unicode also has another single quote:
 New OpenOffice spell files support this with ICONV.  But they are not
 compatible with Vim spell files.  The old files can no longer be downloaded.
 
-Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
-Also fixes wrong result from executable().
-Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
-
 Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
 More tests May 14. Update May 29.  Update Aug 10.
 
 The garbage collector may use too much stack.  Make set_ref_in_item()
 iterative instead of recursive.   Test program by Marc Weber (2013 Dec 10)
 Patch by Ben Fritz, 2014 Jun 22.
+Related: Vim hangs when freeing a lot of objects.  Patch by Yasuhiro
+Matsumoto, 2014 Aug 26.
 
 Idea: For a window in the middle (has window above and below it), use
 right-mouse-drag on the status line to move a window up/down without changing
-it's height?  It's like dragging the status bar above it at the same time.
+its height?  It's like dragging the status bar above it at the same time.
 
 Can we make ":unlet $VAR" use unsetenv() to delete the env var?
 What for systems that don't have unsetenv()?
@@ -239,7 +243,7 @@ instead. (Samuel Ferencik, 2013 Sep 28)
 Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
 Remark on the docs.  Should not be a compile time feature.  But then what?
 
-Completion of ":e" is ":earlier", whould be ":edit".  Complete to the matching
+Completion of ":e" is ":earlier", should be ":edit".  Complete to the matching
 command instead of doing this alphabetically. (Mikel Jorgensen)
 
 Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
@@ -1447,8 +1451,8 @@ files with "foo/**" in 'path'.  (Kalisiak, 2006 July 15)
 Additional info: When using the |wildcards| ** globing, vim hangs
 indefinitely on lots of directories. The |file-searching| globing, like in
 ":set path=/**" does not hang as often as with globing with |wildcards|, like
-in ":1find /**/file".  This is for a files that unix "find" can find very
-quick. Merging the 2 kinds of globing might make this an easier fix. (Ian
+in ":1find /**/file".  This is for files that unix "find" can find very
+quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
 Kelling, 2008 July 4)
 
 When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the
diff --git a/runtime/doc/usr_04.txt b/runtime/doc/usr_04.txt
index c09cb204c5..5f24c8c6f5 100644
--- a/runtime/doc/usr_04.txt
+++ b/runtime/doc/usr_04.txt
@@ -1,4 +1,4 @@
-*usr_04.txt*	For Vim version 7.4.  Last change: 2008 Sep 06
+*usr_04.txt*	For Vim version 7.4.  Last change: 2014 Aug 29
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -186,7 +186,7 @@ commands:
 	/four<Enter>	find the first string "four"
 	cwfive<Esc>	change the word to "five"
 	n		find the next "four"
-	.		repeat the change to "five'
+	.		repeat the change to "five"
 	n		find the next "four"
 	.		repeat the change
 			etc.
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index f18fea8705..2e6fd73237 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -1,4 +1,4 @@
-*version6.txt*  For Vim version 7.4.  Last change: 2013 Jul 28
+*version6.txt*  For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -7816,7 +7816,7 @@ Files:	    src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c,
 Patch 6.1.212
 Problem:    When Vim was started with "-R" ":new" creates a buffer
 	    'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg)
-Solution:   Don't set 'readonly in a new empty buffer for ":enew".
+Solution:   Don't set 'readonly' in a new empty buffer for ":enew".
 Files:	    src/ex_docmd.c
 
 Patch 6.1.213
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 1bff5b5da9..833bf9e4ab 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.4.  Last change: 2013 Nov 18
+*version7.txt*  For Vim version 7.4.  Last change: 2014 Aug 29
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1626,10 +1626,10 @@ and merge it back in.
 When running the tests and one of them fails to produce "test.out" the
 following tests are still executed.  This helps when running out of memory.
 
-When compiling with EXITFREE defined and the ccmalloc library it is possible
-to detect memory leaks.  Some memory will always reported as leaked, such as
-allocated by X11 library functions and the memory allocated in alloc_cmdbuff()
-to store the ":quit" command.
+When compiling with EXITFREE defined and the ccmalloc library, it is possible
+to detect memory leaks.  Some memory will always be reported as leaked, such
+as allocated by X11 library functions and the memory allocated in
+alloc_cmdbuff() to store the ":quit" command.
 
 Moved the code for printing to src/hardcopy.c.
 
@@ -2038,8 +2038,8 @@ Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like
 
 Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US".
 
-Added backslashes before dashes in the vim.1 manual page to make the appear as
-real dashes. (Pierr Habouzit)
+Added backslashes before dashes in the vim.1 manual page to make them appear
+as real dashes. (Pierr Habouzit)
 
 Where "gq" left the cursor depended on the value of 'formatprg'.  Now "gq"
 always leaves the cursor at the last line of the formatted text.
@@ -2049,7 +2049,7 @@ detection may try to check the contents of the file while it's still
 compressed.  Skip setting 'filetype' for compressed files until they have been
 decompressed.  Required for patterns that end in a "*".
 
-Starting with an argument "+cmd" or "-S script" causes the cursor the be moved
+Starting with an argument "+cmd" or "-S script" causes the cursor to be moved
 to the first line.  That breaks a BufReadPost autocommand that uses g`".
 Don't move the cursor if it's somewhere past the first line.
 
@@ -6485,7 +6485,7 @@ Patch 7.1.282 (extra)
 Problem:    Win64: Edit with Vim context menu isn't installed correctly.
 	    Compiler warnings and a few other things.
 Solution:   Add [ and ] to entry of class name.  Use UINT_PTR instead of UINT.
-	    And a fixes for the other things. (George V.  Reilly)
+	    And fixes for other things. (George V.  Reilly)
 Files:	    src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h,
 	    src/if_ole.idl, src/INSTALLpc.txt,  src/Make_mvc.mak,
 	    src/os_win32.c,
@@ -15783,7 +15783,7 @@ Files:	    src/if_py_both.h, src/if_python3.c, src/testdir/test86.in,
 	    src/testdir/test87.ok
 
 Patch 7.3.944
-Problem:    External program receives the termrespone.
+Problem:    External program receives the termresponse.
 Solution:   Insert a delay and discard input. (Hayaki Saito)
 Files:	    src/term.c
 
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 68b795ad47..896ccc1211 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Aug 23
+" Last Change:	2014 Aug 29
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -530,6 +530,9 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
 " CUDA  Cumpute Unified Device Architecture
 au BufNewFile,BufRead *.cu			setf cuda
 
+" Dockerfile
+au BufNewFile,BufRead Dockerfile		setf=dockerfile
+
 " WildPackets EtherPeek Decoder
 au BufNewFile,BufRead *.dcd			setf dcd
 
diff --git a/runtime/ftplugin/dockerfile.vim b/runtime/ftplugin/dockerfile.vim
new file mode 100644
index 0000000000..2e3c447b59
--- /dev/null
+++ b/runtime/ftplugin/dockerfile.vim
@@ -0,0 +1,16 @@
+" Vim filetype plugin
+" Language:	Dockerfile
+" Maintainer:   Honza Pokorny <http://honza.ca>
+" Last Change:	2014 Aug 29
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl commentstring<"
+
+setlocal commentstring=#\ %s
diff --git a/runtime/indent/json.vim b/runtime/indent/json.vim
index d50112b934..649f2b8aa5 100644
--- a/runtime/indent/json.vim
+++ b/runtime/indent/json.vim
@@ -1,13 +1,168 @@
 " Vim indent file
 " Language:		JSON
-" Maintainer:		David Barnett <daviebdawg+vim@gmail.com>
-" Last Change:		2014 Jul 16
+" Mantainer:		Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
+" Last Change:          2014 Aug 29
+"   https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
+" Original Author:	Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
+" Acknowledgement:      Based off of vim-javascript maintained by Darrick Wiebe 
+"                       http://www.vim.org/scripts/script.php?script_id=2765
 
-if exists('b:did_indent')
-   finish
+" 0. Initialization {{{1
+" =================
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
 endif
+let b:did_indent = 1
 
-" JSON is a subset of JavaScript. JavaScript indenting should work fine.
-runtime! indent/javascript.vim
+setlocal nosmartindent
 
-let b:did_indent = 1
+" Now, set up our indentation expression and keys that trigger it.
+setlocal indentexpr=GetJSONIndent()
+setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
+
+" Only define the function once.
+if exists("*GetJSONIndent")
+  finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" 1. Variables {{{1
+" ============
+
+let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
+" Regex that defines blocks.
+let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
+
+" 2. Auxiliary Functions {{{1
+" ======================
+
+" Check if the character at lnum:col is inside a string.
+function s:IsInString(lnum, col)
+  return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
+endfunction
+
+" Find line above 'lnum' that isn't empty, or in a string.
+function s:PrevNonBlankNonString(lnum)
+  let lnum = prevnonblank(a:lnum)
+  while lnum > 0
+    " If the line isn't empty or in a string, end search.
+    let line = getline(lnum)
+    if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
+      break
+    endif
+    let lnum = prevnonblank(lnum - 1)
+  endwhile
+  return lnum
+endfunction
+
+" Check if line 'lnum' has more opening brackets than closing ones.
+function s:LineHasOpeningBrackets(lnum)
+  let open_0 = 0
+  let open_2 = 0
+  let open_4 = 0
+  let line = getline(a:lnum)
+  let pos = match(line, '[][(){}]', 0)
+  while pos != -1
+    let idx = stridx('(){}[]', line[pos])
+    if idx % 2 == 0
+      let open_{idx} = open_{idx} + 1
+    else
+      let open_{idx - 1} = open_{idx - 1} - 1
+    endif
+    let pos = match(line, '[][(){}]', pos + 1)
+  endwhile
+  return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
+endfunction
+
+function s:Match(lnum, regex)
+  let col = match(getline(a:lnum), a:regex) + 1
+  return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
+endfunction
+
+" 3. GetJSONIndent Function {{{1
+" =========================
+
+function GetJSONIndent()
+  " 3.1. Setup {{{2
+  " ----------
+
+  " Set up variables for restoring position in file.  Could use v:lnum here.
+  let vcol = col('.')
+
+  " 3.2. Work on the current line {{{2
+  " -----------------------------
+
+  " Get the current line.
+  let line = getline(v:lnum)
+  let ind = -1
+
+  " If we got a closing bracket on an empty line, find its match and indent
+  " according to it.
+  let col = matchend(line, '^\s*[]}]')
+
+  if col > 0 && !s:IsInString(v:lnum, col)
+    call cursor(v:lnum, col)
+    let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
+
+    let pairstart = escape(bs[0], '[')
+    let pairend = escape(bs[1], ']')
+    let pairline = searchpair(pairstart, '', pairend, 'bW')
+
+    if pairline > 0 
+      let ind = indent(pairline)
+    else
+      let ind = virtcol('.') - 1
+    endif
+
+    return ind
+  endif
+
+  " If we are in a multi-line string, don't do anything to it.
+  if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
+    return indent('.')
+  endif
+
+  " 3.3. Work on the previous line. {{{2
+  " -------------------------------
+
+  let lnum = prevnonblank(v:lnum - 1)
+
+  if lnum == 0
+    return 0
+  endif
+
+  " Set up variables for current line.
+  let line = getline(lnum)
+  let ind = indent(lnum)
+
+  " If the previous line ended with a block opening, add a level of indent.
+  " if s:Match(lnum, s:block_regex)
+    " return indent(lnum) + &sw
+  " endif
+
+  " If the previous line contained an opening bracket, and we are still in it,
+  " add indent depending on the bracket type.
+  if line =~ '[[({]'
+    let counts = s:LineHasOpeningBrackets(lnum)
+    if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
+      return ind + &sw
+    else
+      call cursor(v:lnum, vcol)
+    end
+  endif
+
+  " }}}2
+
+  return ind
+endfunction
+
+" }}}1
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim:set sw=2 sts=2 ts=8 noet:
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index 251e4c8f08..5c136abbb1 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types in scripts
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last change:	2013 May 24
+" Last change:	2014 Aug 24
 
 " This file is called by an autocommand for every file that has just been
 " loaded into a buffer.  It checks if the type of file can be recognized by
@@ -319,6 +319,10 @@ else
   elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind'
     set ft=valgrind
 
+  " Go docs
+  elseif s:line1 =~ '^PACKAGE DOCUMENTATION$'
+    set ft=godoc
+
   " Renderman Interface Bytestream
   elseif s:line1 =~ '^##RenderMan'
     set ft=rib
diff --git a/runtime/syntax/asciidoc.vim b/runtime/syntax/asciidoc.vim
index 1303db7cf2..ccb079e06b 100644
--- a/runtime/syntax/asciidoc.vim
+++ b/runtime/syntax/asciidoc.vim
@@ -5,6 +5,7 @@
 " URL:          http://asciidoc.org/
 " Licence:      GPL (http://www.gnu.org)
 " Remarks:      Vim 6 or greater
+" Last Update:  2014 Aug 29 (see Issue 240)
 " Limitations:
 " 
 " - Nested quoted text formatting is highlighted according to the outer
@@ -155,7 +156,8 @@ hi def link asciidocQuotedAttributeList Special
 hi def link asciidocQuotedBold Special
 hi def link asciidocQuotedDoubleQuoted Label
 hi def link asciidocQuotedEmphasized2 Type
-hi def link asciidocQuotedEmphasized Type
+hi asciidocQuotedEmphasizedItalic term=italic cterm=italic gui=italic
+hi def link asciidocQuotedEmphasized asciidocQuotedEmphasizedItalic
 hi def link asciidocQuotedMonospaced2 Identifier
 hi def link asciidocQuotedMonospaced Identifier
 hi def link asciidocQuotedSingleQuoted Label
diff --git a/runtime/syntax/dockerfile.vim b/runtime/syntax/dockerfile.vim
new file mode 100644
index 0000000000..d1693cba41
--- /dev/null
+++ b/runtime/syntax/dockerfile.vim
@@ -0,0 +1,24 @@
+" dockerfile.vim - Syntax highlighting for Dockerfiles
+" Maintainer:   Honza Pokorny <http://honza.ca>
+" Version:      0.5
+" Last Change:  2014 Aug 29
+" License:      BSD
+
+
+if exists("b:current_syntax")
+    finish
+endif
+
+let b:current_syntax = "dockerfile"
+
+syntax case ignore
+
+syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/
+
+syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
+
+syntax match dockerfileComment "\v^\s*#.*$"
+
+hi def link dockerfileString String
+hi def link dockerfileKeyword Keyword
+hi def link dockerfileComment Comment

From bec588c6acd5f67c7d0122e1b4a6102bd8c58adb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 15:12:54 +0200
Subject: [PATCH 090/473] updated for version 7.4.426 Problem:    README File
 missing from list of files. Solution:   Update the list of files.

---
 Filelist      | 1 +
 src/version.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/Filelist b/Filelist
index 0f4ed1d828..dd09b840ca 100644
--- a/Filelist
+++ b/Filelist
@@ -82,6 +82,7 @@ SRC_ALL =	\
 		src/xxd/xxd.c \
 		src/main.aap \
 		src/testdir/main.aap \
+		src/testdir/README.txt \
 		src/testdir/*.in \
 		src/testdir/sautest/autoload/*.vim \
 		src/testdir/test[0-9]*.ok \
diff --git a/src/version.c b/src/version.c
index 32a6b3bd0c..0d569f7f96 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    426,
 /**/
     425,
 /**/

From 734cfbfe8a70daea6f86ad589ec1c01c865f00f1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 15:12:55 +0200
Subject: [PATCH 091/473] Added tag v7-4-426 for changeset 7ab9a9cf2859

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 70f8877c1b..88930b0306 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3148,3 +3148,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 96a4fa8e530c12137af235a9aaad57d578f9eebd v7-4-423
 85a1802ae810f0e840f8b5d8f2827b4199b39750 v7-4-424
 2e804ebb3ee8cd59451f8f1c1be2f09ebce0d77a v7-4-425
+7ab9a9cf2859ae4b7c00c4fff016fd5a0869450e v7-4-426

From f9d38e5ad8416f1bd1d3a48ed16971ae1195b147 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 15:53:52 +0200
Subject: [PATCH 092/473] updated for version 7.4.427 Problem:    When an
 InsertCharPre autocommand executes system() typeahead may 	    be echoed
 and messes up the display. (Jacob Niehus) Solution:   Do not set cooked mode
 when invoked from ":silent".

---
 runtime/doc/eval.txt |  6 ++++++
 src/eval.c           | 12 ++++++++----
 src/version.c        |  2 ++
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 9aa97b7f76..688fc38eb8 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -6093,6 +6093,12 @@ system({expr} [, {input}])				*system()* *E677*
 		list items converted to NULs).  
 		Pipes are not used.
 
+		When prepended by |:silent| the shell will not be set to
+		cooked mode.  This is meant to be used for commands that do
+		not need the user to type.  It avoids stray characters showing
+		up on the screen which require |CTRL-L| to remove. >
+			:silent let f = system('ls *.vim')
+<
 		Note: Use |shellescape()| or |::S| with |expand()| or 
 		|fnamemodify()| to escape special characters in a command 
 		argument.  Newlines in {expr} may cause the command to fail.  
diff --git a/src/eval.c b/src/eval.c
index a8e94639df..7bf52c5f30 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -18594,6 +18594,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
     int		err = FALSE;
     FILE	*fd;
     list_T	*list = NULL;
+    int		flags = SHELL_SILENT;
 
     rettv->v_type = VAR_STRING;
     rettv->vval.v_string = NULL;
@@ -18643,6 +18644,11 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
 	}
     }
 
+    /* Omit SHELL_COOKED when invoked with ":silent".  Avoids that the shell
+     * echoes typeahead, that messes up the display. */
+    if (!msg_silent)
+	flags += SHELL_COOKED;
+
     if (retlist)
     {
 	int		len;
@@ -18652,8 +18658,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
 	char_u		*end;
 	int		i;
 
-	res = get_cmd_output(get_tv_string(&argvars[0]), infile,
-					   SHELL_SILENT | SHELL_COOKED, &len);
+	res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
 	if (res == NULL)
 	    goto errret;
 
@@ -18694,8 +18699,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
     }
     else
     {
-	res = get_cmd_output(get_tv_string(&argvars[0]), infile,
-					   SHELL_SILENT | SHELL_COOKED, NULL);
+	res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
 #ifdef USE_CR
 	/* translate <CR> into <NL> */
 	if (res != NULL)
diff --git a/src/version.c b/src/version.c
index 0d569f7f96..d43534a11c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    427,
 /**/
     426,
 /**/

From e5a5f55e37b629f19e9292fcd38fac565b972f48 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 15:53:52 +0200
Subject: [PATCH 093/473] Added tag v7-4-427 for changeset fca35aa9380a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 88930b0306..36de98fbe9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3149,3 +3149,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 85a1802ae810f0e840f8b5d8f2827b4199b39750 v7-4-424
 2e804ebb3ee8cd59451f8f1c1be2f09ebce0d77a v7-4-425
 7ab9a9cf2859ae4b7c00c4fff016fd5a0869450e v7-4-426
+fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427

From 7608ae6b5274a8f554757e24d6e10b9d8620f8e1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 17:45:32 +0200
Subject: [PATCH 094/473] updated for version 7.4.428 Problem:    executable()
 may return a wrong result on MS-Windows. Solution:   Change the way
 SearchPath() is called. (Yasuhiro Matsumoto, Ken 	    Takata)

---
 src/os_win32.c | 25 ++++++++++++++++++++++---
 src/version.c  |  2 ++
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/os_win32.c b/src/os_win32.c
index 0c896efc37..dd5714158c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1906,6 +1906,8 @@ executable_exists(char *name, char_u **path)
 {
     char	*dum;
     char	fname[_MAX_PATH];
+    char	*curpath, *newpath;
+    long	n;
 
 #ifdef FEAT_MBYTE
     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
@@ -1913,11 +1915,19 @@ executable_exists(char *name, char_u **path)
 	WCHAR	*p = enc_to_utf16(name, NULL);
 	WCHAR	fnamew[_MAX_PATH];
 	WCHAR	*dumw;
-	long	n;
+	WCHAR	*wcurpath, *wnewpath;
 
 	if (p != NULL)
 	{
-	    n = (long)SearchPathW(NULL, p, NULL, _MAX_PATH, fnamew, &dumw);
+	    wcurpath = _wgetenv(L"PATH");
+	    wnewpath = (WCHAR*)alloc((unsigned)(wcslen(wcurpath) + 3)
+							    * sizeof(WCHAR));
+	    if (wnewpath == NULL)
+		return FALSE;
+	    wcscpy(wnewpath, L".;");
+	    wcscat(wnewpath, wcurpath);
+	    n = (long)SearchPathW(wnewpath, p, NULL, _MAX_PATH, fnamew, &dumw);
+	    vim_free(wnewpath);
 	    vim_free(p);
 	    if (n > 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
 	    {
@@ -1933,7 +1943,16 @@ executable_exists(char *name, char_u **path)
 	}
     }
 #endif
-    if (SearchPath(NULL, name, NULL, _MAX_PATH, fname, &dum) == 0)
+
+    curpath = getenv("PATH");
+    newpath = (char*)alloc((unsigned)(STRLEN(curpath) + 3));
+    if (newpath == NULL)
+	return FALSE;
+    STRCPY(newpath, ".;");
+    STRCAT(newpath, curpath);
+    n = (long)SearchPath(newpath, name, NULL, _MAX_PATH, fname, &dum);
+    vim_free(newpath);
+    if (n == 0)
 	return FALSE;
     if (mch_isdir(fname))
 	return FALSE;
diff --git a/src/version.c b/src/version.c
index d43534a11c..17add4334c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    428,
 /**/
     427,
 /**/

From 742066536acbd25d57df212280449e08f3235866 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 29 Aug 2014 17:45:32 +0200
Subject: [PATCH 095/473] Added tag v7-4-428 for changeset 1fe61f6d5207

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 36de98fbe9..19a69545e3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3150,3 +3150,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 2e804ebb3ee8cd59451f8f1c1be2f09ebce0d77a v7-4-425
 7ab9a9cf2859ae4b7c00c4fff016fd5a0869450e v7-4-426
 fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427
+1fe61f6d52079f44f61b3e03cf9b0c300f2890d9 v7-4-428

From 0cc738ebb99564e01b7e9370b7ac27e946111f4b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 30 Aug 2014 13:32:06 +0200
Subject: [PATCH 096/473] updated for version 7.4.429 Problem:    Build fails
 with fewer features. (Elimar Riesebieter) Solution:   Add #ifdef.

---
 src/normal.c  | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/normal.c b/src/normal.c
index 7479ac7891..a8d74117c7 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4518,8 +4518,10 @@ nv_screengo(oap, dir, dist)
 	 */
 	validate_virtcol();
 	virtcol = curwin->w_virtcol;
+# if defined(FEAT_LINEBREAK)
 	if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
 	    virtcol -= vim_strsize(p_sbr);
+# endif
 
 	if (virtcol > curwin->w_curswant
 		&& (curwin->w_curswant < (colnr_T)width1
diff --git a/src/version.c b/src/version.c
index 17add4334c..8f35499241 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    429,
 /**/
     428,
 /**/

From cd6be0b4e501d708879c49c0a69ea2ecf7b02542 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 30 Aug 2014 13:32:06 +0200
Subject: [PATCH 097/473] Added tag v7-4-429 for changeset e98e415ea3b8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 19a69545e3..8f746a9560 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3151,3 +3151,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 7ab9a9cf2859ae4b7c00c4fff016fd5a0869450e v7-4-426
 fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427
 1fe61f6d52079f44f61b3e03cf9b0c300f2890d9 v7-4-428
+e98e415ea3b8c743a5ab04ad9f498ab1b11ae8cf v7-4-429

From 4ef65d61e3fd01cd790460e58b4a04a5abde9264 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 30 Aug 2014 18:10:18 +0200
Subject: [PATCH 098/473] updated for version 7.4.430 Problem:    test_listlbr
 fails when compiled with normal features. Solution:   Check for the +conceal
 feature.

---
 src/testdir/test_listlbr.in | 2 +-
 src/version.c               | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
index 2f28126554..f155f85a4b 100644
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -2,7 +2,7 @@ Test for linebreak and list option (non-utf8)
 
 STARTTEST
 :so small.vim
-:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+linebreak") || !exists("+conceal") | e! test.ok | w! test.out | qa! | endif
 :10new|:vsp|:vert resize 20
 :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
 :norm! zt
diff --git a/src/version.c b/src/version.c
index 8f35499241..b81d54781b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    430,
 /**/
     429,
 /**/

From 4cf30a6d7e71fe464190985641b55a7b8728dce5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 30 Aug 2014 18:10:19 +0200
Subject: [PATCH 099/473] Added tag v7-4-430 for changeset f4e9c65a18d4

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 8f746a9560..6eac906f9a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3152,3 +3152,4 @@ e60327caf9095d5ec067a5ab47bf4a69c0f58580 v7-4-417
 fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427
 1fe61f6d52079f44f61b3e03cf9b0c300f2890d9 v7-4-428
 e98e415ea3b8c743a5ab04ad9f498ab1b11ae8cf v7-4-429
+f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430

From b6e1bb2bc7fbe13918deded644d60774e05ec145 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 12:22:06 +0200
Subject: [PATCH 100/473] updated for version 7.4.431 Problem:    Compiler
 warning. Solution:   Add type cast. (Mike Williams)

---
 src/ex_docmd.c | 2 +-
 src/version.c  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c4cf1f9e1b..e90dfe5935 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2155,7 +2155,7 @@ do_one_cmd(cmdlinep, sourcing,
 	p = ea.cmd;
 	while (ASCII_ISALNUM(*p))
 	    ++p;
-	p = vim_strnsave(ea.cmd, p - ea.cmd);
+	p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
 	ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
 	vim_free(p);
 	if (ret && !aborting())
diff --git a/src/version.c b/src/version.c
index b81d54781b..838c1d6079 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    431,
 /**/
     430,
 /**/

From 43b3dd4cc40eff4134b6b6a976f5a9563dbf839d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 12:22:07 +0200
Subject: [PATCH 101/473] Added tag v7-4-431 for changeset 5672a06e4bd8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6eac906f9a..ee244671e6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3153,3 +3153,4 @@ fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427
 1fe61f6d52079f44f61b3e03cf9b0c300f2890d9 v7-4-428
 e98e415ea3b8c743a5ab04ad9f498ab1b11ae8cf v7-4-429
 f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
+5672a06e4bd84cae4194ff0584d487448bad8c38 v7-4-431

From 85bbe32aeaf7c34d527a9ef09a7368731e263212 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 12:25:33 +0200
Subject: [PATCH 102/473] updated for version 7.4.432 Problem:    When the
 startup code expands command line arguments, setting 	    'encoding' will
 not properly convert the arguments. Solution:   Call get_cmd_argsW() early in
 main(). (Yasuhiro Matsumoto)

---
 src/main.c     | 11 +++++++++++
 src/os_mswin.c |  4 ----
 src/os_win32.c |  5 +++++
 src/version.c  |  2 ++
 4 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/src/main.c b/src/main.c
index 2fb2edcb59..70d291171f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -178,6 +178,14 @@ main
      */
     mch_early_init();
 
+#if defined(WIN32) && defined(FEAT_MBYTE)
+    /*
+     * MingW expands command line arguments, which confuses our code to
+     * convert when 'encoding' changes.  Get the unexpanded arguments.
+     */
+    argc = get_cmd_argsW(&argv);
+#endif
+
     /* Many variables are in "params" so that we can pass them to invoked
      * functions without a lot of arguments.  "argc" and "argv" are also
      * copied, so that they can be changed. */
@@ -1496,6 +1504,9 @@ getout(exitval)
     if (garbage_collect_at_exit)
 	garbage_collect();
 #endif
+#if defined(WIN32) && defined(FEAT_MBYTE)
+    free_cmd_argsW();
+#endif
 
     mch_exit(exitval);
 }
diff --git a/src/os_mswin.c b/src/os_mswin.c
index 871afad9d2..b5786800e4 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -277,10 +277,6 @@ mch_early_init(void)
     AnsiUpperBuff(toupper_tab, 256);
     AnsiLowerBuff(tolower_tab, 256);
 #endif
-
-#if defined(FEAT_MBYTE) && !defined(FEAT_GUI)
-    (void)get_cmd_argsW(NULL);
-#endif
 }
 
 
diff --git a/src/os_win32.c b/src/os_win32.c
index dd5714158c..7192c51a03 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -6461,6 +6461,7 @@ get_cmd_argsW(char ***argvp)
     int		argc = 0;
     int		i;
 
+    free_cmd_argsW();
     ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW);
     if (ArglistW != NULL)
     {
@@ -6493,7 +6494,11 @@ get_cmd_argsW(char ***argvp)
     global_argc = argc;
     global_argv = argv;
     if (argc > 0)
+    {
+	if (used_file_indexes != NULL)
+	    free(used_file_indexes);
 	used_file_indexes = malloc(argc * sizeof(int));
+    }
 
     if (argvp != NULL)
 	*argvp = argv;
diff --git a/src/version.c b/src/version.c
index 838c1d6079..18ea863d84 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    432,
 /**/
     431,
 /**/

From d50efbd04bc9ae579040b99e2b8841aff6e06bac Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 12:25:33 +0200
Subject: [PATCH 103/473] Added tag v7-4-432 for changeset 59cd2b16f718

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ee244671e6..e17acbc0c6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3154,3 +3154,4 @@ fca35aa9380a9e3acecc78f85e05f26436e87ae1 v7-4-427
 e98e415ea3b8c743a5ab04ad9f498ab1b11ae8cf v7-4-429
 f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
 5672a06e4bd84cae4194ff0584d487448bad8c38 v7-4-431
+59cd2b16f71846dec2e842491e509385beeda5e9 v7-4-432

From e11d8c193886f0d94f1b7e0375549b53e1409570 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 13:52:58 +0200
Subject: [PATCH 104/473] updated for version 7.4.433 Problem:    Test 75 fails
 on MS-Windows. Solution:   Use ":normal" instead of feedkeys(). (Michael
 Soyka)

---
 src/testdir/test75.in | 8 ++++----
 src/version.c         | 2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/testdir/test75.in b/src/testdir/test75.in
index b7f2783f54..8fabccdf52 100644
--- a/src/testdir/test75.in
+++ b/src/testdir/test75.in
@@ -23,16 +23,16 @@ STARTTEST
 Go:"
 :" Outside of the range, minimum
 :inoremap <Char-0x1040> a
-:call feedkeys("a\u1040\<Esc>")
+:execute "normal a\u1040\<Esc>"
 :" Inside of the range, minimum
 :inoremap <Char-0x103f> b
-:call feedkeys("a\u103f\<Esc>")
+:execute "normal a\u103f\<Esc>"
 :" Inside of the range, maximum
 :inoremap <Char-0xf03f> c
-:call feedkeys("a\uf03f\<Esc>")
+:execute "normal a\uf03f\<Esc>"
 :" Outside of the range, maximum
 :inoremap <Char-0xf040> d
-:call feedkeys("a\uf040\<Esc>")
+:execute "normal a\uf040\<Esc>"
 :"
 :/^eof/+1,$w! test.out
 :qa!
diff --git a/src/version.c b/src/version.c
index 18ea863d84..4d9fb1ee31 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    433,
 /**/
     432,
 /**/

From c62f2b77cd95b5d89a053eaf91d091ffb9a90704 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 13:52:58 +0200
Subject: [PATCH 105/473] Added tag v7-4-433 for changeset dd3dac42cb9b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e17acbc0c6..09b40b6219 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3155,3 +3155,4 @@ e98e415ea3b8c743a5ab04ad9f498ab1b11ae8cf v7-4-429
 f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
 5672a06e4bd84cae4194ff0584d487448bad8c38 v7-4-431
 59cd2b16f71846dec2e842491e509385beeda5e9 v7-4-432
+dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433

From 71a635433af5b6915da1685a4595c1369f6440bf Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:13:08 +0200
Subject: [PATCH 106/473] updated for version 7.4.434 Problem:    gettabvar()
 is not consistent with getwinvar() and getbufvar(). Solution:   Return a dict
 with all variables when the varname is empty. 	    (Yasuhiro Matsumoto)

---
 runtime/doc/eval.txt  |  2 ++
 src/eval.c            | 13 +++++++++++--
 src/testdir/test91.in |  1 +
 src/testdir/test91.ok |  4 ++--
 src/version.c         |  2 ++
 5 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 688fc38eb8..e5aa09c8a5 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -3575,6 +3575,8 @@ gettabvar({tabnr}, {varname} [, {def}])				*gettabvar()*
 		Get the value of a tab-local variable {varname} in tab page
 		{tabnr}. |t:var|
 		Tabs are numbered starting with one.
+		When {varname} is empty a dictionary with all tab-local
+		variables is returned.
 		Note that the name without "t:" must be used.
 		When the tab or variable doesn't exist {def} or an empty
 		string is returned, there is no error message.
diff --git a/src/eval.c b/src/eval.c
index 7bf52c5f30..8303bd3759 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -12071,7 +12071,8 @@ f_gettabvar(argvars, rettv)
     typval_T	*argvars;
     typval_T	*rettv;
 {
-    tabpage_T	*tp;
+    win_T	*win, *oldcurwin;
+    tabpage_T	*tp, *oldtabpage;
     dictitem_T	*v;
     char_u	*varname;
     int		done = FALSE;
@@ -12083,13 +12084,21 @@ f_gettabvar(argvars, rettv)
     tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
     if (tp != NULL && varname != NULL)
     {
+	/* Set curwin to be our win, temporarily.  Also set the tabpage,
+	 * otherwise the window is not valid. */
+	switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
+
 	/* look up the variable */
-	v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 0, varname, FALSE);
+	/* Let gettabvar({nr}, "") return the "t:" dictionary. */
+	v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
 	if (v != NULL)
 	{
 	    copy_tv(&v->di_tv, rettv);
 	    done = TRUE;
 	}
+
+	/* restore previous notion of curwin */
+	restore_win(oldcurwin, oldtabpage, TRUE);
     }
 
     if (!done && argvars[2].v_type != VAR_UNKNOWN)
diff --git a/src/testdir/test91.in b/src/testdir/test91.in
index e900a522df..b66776b1e4 100644
--- a/src/testdir/test91.in
+++ b/src/testdir/test91.in
@@ -55,6 +55,7 @@ STARTTEST
 :tabnew
 :tabnew
 :let t:var_list = [1, 2, 3]
+:let t:other = 777
 :let def_list = [4, 5, 6, 7]
 :tabrewind
 :$put =string(gettabvar(3, 'var_list'))
diff --git a/src/testdir/test91.ok b/src/testdir/test91.ok
index 22e1572209..809952b69d 100644
--- a/src/testdir/test91.ok
+++ b/src/testdir/test91.ok
@@ -26,8 +26,8 @@ iso-8859-2
 0
 [1, 2, 3]
 [1, 2, 3]
-''
-[4, 5, 6, 7]
+{'var_list': [1, 2, 3], 'other': 777}
+{'var_list': [1, 2, 3], 'other': 777}
 [4, 5, 6, 7]
 ''
 [4, 5, 6, 7]
diff --git a/src/version.c b/src/version.c
index 4d9fb1ee31..1e68b49e9f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    434,
 /**/
     433,
 /**/

From 5507de1b79e4a66be697b8bd212634ca0bbd696a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:13:08 +0200
Subject: [PATCH 107/473] Added tag v7-4-434 for changeset 4176c48c7dd5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 09b40b6219..073ae726d7 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3156,3 +3156,4 @@ f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
 5672a06e4bd84cae4194ff0584d487448bad8c38 v7-4-431
 59cd2b16f71846dec2e842491e509385beeda5e9 v7-4-432
 dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433
+4176c48c7dd51d0fcdb7403cbfb489a75b0d819d v7-4-434

From d7ece7c78bec918f54406aa3d6adbfe0c17a8d1b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:32:39 +0200
Subject: [PATCH 108/473] updated for version 7.4.435 Problem:    Line
 formatting behaves differently when 'linebreak' is set. 	    (mvxxc)
 Solution:   Disable 'linebreak' temporarily. (Christian Brabandt)

---
 src/edit.c    | 9 +++++++++
 src/version.c | 2 ++
 2 files changed, 11 insertions(+)

diff --git a/src/edit.c b/src/edit.c
index 29721afa33..7e5e29ee91 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -6131,6 +6131,12 @@ internal_format(textwidth, second_indent, flags, format_only, c)
     int		no_leader = FALSE;
     int		do_comments = (flags & INSCHAR_DO_COM);
 #endif
+#ifdef FEAT_LINEBREAK
+    int		has_lbr = curwin->w_p_lbr;
+
+    /* make sure win_lbr_chartabsize() counts correctly */
+    curwin->w_p_lbr = FALSE;
+#endif
 
     /*
      * When 'ai' is off we don't want a space under the cursor to be
@@ -6483,6 +6489,9 @@ internal_format(textwidth, second_indent, flags, format_only, c)
     if (save_char != NUL)		/* put back space after cursor */
 	pchar_cursor(save_char);
 
+#ifdef FEAT_LINEBREAK
+    curwin->w_p_lbr = has_lbr;
+#endif
     if (!format_only && haveto_redraw)
     {
 	update_topline();
diff --git a/src/version.c b/src/version.c
index 1e68b49e9f..5025c68875 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    435,
 /**/
     434,
 /**/

From e4c0217fa453412b49f26933c16318f1ad962c75 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:32:39 +0200
Subject: [PATCH 109/473] Added tag v7-4-435 for changeset b98af9af378e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 073ae726d7..b45241d821 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3157,3 +3157,4 @@ f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
 59cd2b16f71846dec2e842491e509385beeda5e9 v7-4-432
 dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433
 4176c48c7dd51d0fcdb7403cbfb489a75b0d819d v7-4-434
+b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435

From f46d1f42b3a5291a5f7931fc32f74240e8e2ef8b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:59:38 +0200
Subject: [PATCH 110/473] updated for version 7.4.436 Problem:    ml_get error
 for autocommand that moves the cursor of the current 	    window. Solution: 
  Check the cursor position after switching back to the current 	   
 buffer.  (Christian Brabandt)

---
 src/fileio.c  | 3 +++
 src/version.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/fileio.c b/src/fileio.c
index f2d2040786..b9221ed400 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -9009,6 +9009,9 @@ aucmd_restbuf(aco)
 
 	    curwin = aco->save_curwin;
 	    curbuf = curwin->w_buffer;
+	    /* In case the autocommand move the cursor to a position that that
+	     * not exist in curbuf. */
+	    check_cursor();
 	}
     }
 }
diff --git a/src/version.c b/src/version.c
index 5025c68875..521f2d88c9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    436,
 /**/
     435,
 /**/

From 785740eef0a3bbf04f072166783b44dbfeec96e4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 16:59:38 +0200
Subject: [PATCH 111/473] Added tag v7-4-436 for changeset 52fa8300ce20

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b45241d821..c2f693be12 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3158,3 +3158,4 @@ f4e9c65a18d4a5753747f327ed55c10f05d8d91c v7-4-430
 dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433
 4176c48c7dd51d0fcdb7403cbfb489a75b0d819d v7-4-434
 b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
+52fa8300ce205a8f3c45b3b1874564b7768630ea v7-4-436

From 370e057d38e0fddc142e1916a918c209979a079a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:18:49 +0200
Subject: [PATCH 112/473] updated for version 7.4.437 Problem:    New and old
 regexp engine are not consistent. Solution:   Also give an error for "\ze*"
 for the old regexp engine.

---
 src/regexp.c     | 18 ++++++++++++++++++
 src/regexp_nfa.c | 13 -------------
 src/version.c    |  2 ++
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/regexp.c b/src/regexp.c
index dcb9a3b4e8..f19e139710 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -358,6 +358,8 @@ static void	regdump __ARGS((char_u *, bt_regprog_T *));
 static char_u	*regprop __ARGS((char_u *));
 #endif
 
+static int re_mult_next __ARGS((char *what));
+
 static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
 static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
 static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
@@ -2166,9 +2168,13 @@ regatom(flagp)
 #endif
 
 		case 's': ret = regnode(MOPEN + 0);
+			  if (re_mult_next("\\zs") == FAIL)
+			      return NULL;
 			  break;
 
 		case 'e': ret = regnode(MCLOSE + 0);
+			  if (re_mult_next("\\ze") == FAIL)
+			      return NULL;
 			  break;
 
 		default:  EMSG_RET_NULL(_("E68: Invalid character after \\z"));
@@ -7005,6 +7011,18 @@ regprop(op)
 }
 #endif	    /* DEBUG */
 
+/*
+ * Used in a place where no * or \+ can follow.
+ */
+    static int
+re_mult_next(what)
+    char *what;
+{
+    if (re_multi_type(peekchr()) == MULTI_MULT)
+	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
+    return OK;
+}
+
 #ifdef FEAT_MBYTE
 static void mb_decompose __ARGS((int c, int *c1, int *c2, int *c3));
 
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 4ccb05a2b3..6531d45fd1 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -291,7 +291,6 @@ static int nfa_regpiece __ARGS((void));
 static int nfa_regconcat __ARGS((void));
 static int nfa_regbranch __ARGS((void));
 static int nfa_reg __ARGS((int paren));
-static int re_mult_next __ARGS((char *what));
 #ifdef DEBUG
 static void nfa_set_code __ARGS((int c));
 static void nfa_postfix_dump __ARGS((char_u *expr, int retval));
@@ -2281,18 +2280,6 @@ nfa_reg(paren)
     return OK;
 }
 
-/*
- * Used in a place where no * or \+ can follow.
- */
-    static int
-re_mult_next(what)
-    char *what;
-{
-    if (re_multi_type(peekchr()) == MULTI_MULT)
-	EMSG2_RET_FAIL(_("E888: (NFA regexp) cannot repeat %s"), what);
-    return OK;
-}
-
 #ifdef DEBUG
 static char_u code[50];
 
diff --git a/src/version.c b/src/version.c
index 521f2d88c9..599dd338b3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    437,
 /**/
     436,
 /**/

From 182260e78cab84e44ad7cf8415f1cc8df71c8dc7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:18:49 +0200
Subject: [PATCH 113/473] Added tag v7-4-437 for changeset 8515b42f939c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c2f693be12..7db7cd8ef6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3159,3 +3159,4 @@ dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433
 4176c48c7dd51d0fcdb7403cbfb489a75b0d819d v7-4-434
 b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
 52fa8300ce205a8f3c45b3b1874564b7768630ea v7-4-436
+8515b42f939cdf3a59fa6120e989d9f8fe6f4571 v7-4-437

From f4aacb1684702630c4874614742c8c8141d0f8e3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:33:07 +0200
Subject: [PATCH 114/473] updated for version 7.4.438 Problem:    Cached values
 for 'cino' not reset for ":set all&". Solution:   Call parse_cino().
 (Yukihiro Nakadaira)

---
 src/option.c  | 3 +++
 src/version.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/option.c b/src/option.c
index 855539b584..2007dee7db 100644
--- a/src/option.c
+++ b/src/option.c
@@ -3645,6 +3645,9 @@ set_options_default(opt_flags)
 #else
 	win_comp_scroll(curwin);
 #endif
+#ifdef FEAT_CINDENT
+    parse_cino(curbuf);
+#endif
 }
 
 /*
diff --git a/src/version.c b/src/version.c
index 599dd338b3..0ad0376f82 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    438,
 /**/
     437,
 /**/

From 37d3cbb77ea16e108a8e56af4de7453cea964c7f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:33:07 +0200
Subject: [PATCH 115/473] Added tag v7-4-438 for changeset db3b8fe8330e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7db7cd8ef6..f637f322f2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3160,3 +3160,4 @@ dd3dac42cb9b5f95ad16d5e08220b0c7adf4b024 v7-4-433
 b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
 52fa8300ce205a8f3c45b3b1874564b7768630ea v7-4-436
 8515b42f939cdf3a59fa6120e989d9f8fe6f4571 v7-4-437
+db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438

From 73b08691a66290b9678c6250f475eff20286a865 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:47:38 +0200
Subject: [PATCH 116/473] updated for version 7.4.439 Problem:    Duplicate
 message in message history.  Some quickfix messages 	    appear twice.
 (Gary Johnson) Solution:   Do not reset keep_msg too early. (Hirohito
 Higashi)

---
 src/main.c    | 4 ++--
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 70d291171f..73f6697ac6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1249,9 +1249,9 @@ main_loop(cmdwin, noexmode)
 		char_u *p;
 
 		/* msg_attr_keep() will set keep_msg to NULL, must free the
-		 * string here. */
+		 * string here. Don't reset keep_msg, msg_attr_keep() uses it
+		 * to check for duplicates. */
 		p = keep_msg;
-		keep_msg = NULL;
 		msg_attr(p, keep_msg_attr);
 		vim_free(p);
 	    }
diff --git a/src/version.c b/src/version.c
index 0ad0376f82..edc87f3548 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    439,
 /**/
     438,
 /**/

From 4dc31c7a64a7ad7ae2541325bfdb068e29ff064e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 17:47:38 +0200
Subject: [PATCH 117/473] Added tag v7-4-439 for changeset 07b28e96af8b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f637f322f2..b2609ee69f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3161,3 +3161,4 @@ b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
 52fa8300ce205a8f3c45b3b1874564b7768630ea v7-4-436
 8515b42f939cdf3a59fa6120e989d9f8fe6f4571 v7-4-437
 db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
+07b28e96af8bace1af65bac661f22716781103fd v7-4-439

From 441b356a2ca11156cd4543d5b24e6717fa3d56c8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 18:29:33 +0200
Subject: [PATCH 118/473] updated for version 7.4.440 Problem:    Omni complete
 popup drawn incorrectly. Solution:   Call validate_cursor() instead of
 check_cursor(). (Hirohito 	    Higashi)

---
 src/edit.c    | 4 ++--
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/edit.c b/src/edit.c
index 7e5e29ee91..8243890c52 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4035,7 +4035,7 @@ expand_by_function(type, base)
 	goto theend;
     }
     curwin->w_cursor = pos;	/* restore the cursor position */
-    check_cursor();
+    validate_cursor();
     if (!equalpos(curwin->w_cursor, pos))
     {
 	EMSG(_(e_compldel));
@@ -5273,7 +5273,7 @@ ins_complete(c)
 		return FAIL;
 	    }
 	    curwin->w_cursor = pos;	/* restore the cursor position */
-	    check_cursor();
+	    validate_cursor();
 	    if (!equalpos(curwin->w_cursor, pos))
 	    {
 		EMSG(_(e_compldel));
diff --git a/src/version.c b/src/version.c
index edc87f3548..2a86184d9c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    440,
 /**/
     439,
 /**/

From 48dd4bfa400cee9ad1c0f04d7a52467ab1b81f54 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 18:29:34 +0200
Subject: [PATCH 119/473] Added tag v7-4-440 for changeset 1f578cd9a657

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b2609ee69f..42e7ffa741 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3162,3 +3162,4 @@ b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
 8515b42f939cdf3a59fa6120e989d9f8fe6f4571 v7-4-437
 db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
 07b28e96af8bace1af65bac661f22716781103fd v7-4-439
+1f578cd9a65779d2597e0135a5916db621d65734 v7-4-440

From 6900e93fb30fff41f6d2b788adaaa7a326b51e7c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 18:45:49 +0200
Subject: [PATCH 120/473] updated for version 7.4.441 Problem:    Endless loop
 and other problems when 'cedit' is set to CTRL-C. Solution:   Do not call
 ex_window() when ex_normal_busy or got_int was set. 	    (Yasuhiro
 Matsumoto)

---
 src/ex_getln.c | 13 ++++++++-----
 src/version.c  |  2 ++
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/ex_getln.c b/src/ex_getln.c
index 6ca707e432..8ebcc889c3 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -759,11 +759,14 @@ getcmdline(firstc, count, indent)
 #ifdef FEAT_CMDWIN
 	if (c == cedit_key || c == K_CMDWIN)
 	{
-	    /*
-	     * Open a window to edit the command line (and history).
-	     */
-	    c = ex_window();
-	    some_key_typed = TRUE;
+	    if (ex_normal_busy == 0 && got_int == FALSE)
+	    {
+		/*
+		 * Open a window to edit the command line (and history).
+		 */
+		c = ex_window();
+		some_key_typed = TRUE;
+	    }
 	}
 # ifdef FEAT_DIGRAPHS
 	else
diff --git a/src/version.c b/src/version.c
index 2a86184d9c..5d512a3cda 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    441,
 /**/
     440,
 /**/

From 9bae563b105a5dbe4bd5401c86f728252e8345d6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 18:45:50 +0200
Subject: [PATCH 121/473] Added tag v7-4-441 for changeset e754b23b7d1c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 42e7ffa741..e163b408f3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3163,3 +3163,4 @@ b98af9af378eebe674052aa9a1b1956ad3f96487 v7-4-435
 db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
 07b28e96af8bace1af65bac661f22716781103fd v7-4-439
 1f578cd9a65779d2597e0135a5916db621d65734 v7-4-440
+e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441

From 007a19c3ac59e8e0c171995bd2f695036293e4a2 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 18:48:09 +0200
Subject: [PATCH 122/473] Update runtime files.

---
 runtime/doc/cmdline.txt  |   4 +-
 runtime/doc/eval.txt     |   3 +-
 runtime/doc/options.txt  |   5 +-
 runtime/doc/pattern.txt  |   4 +-
 runtime/doc/syntax.txt   |  26 ++++++++-
 runtime/doc/tags         |   4 +-
 runtime/doc/todo.txt     |  44 ++++++++-------
 runtime/filetype.vim     |   7 ++-
 runtime/ftplugin/vim.vim |  11 ++--
 runtime/syntax/tex.vim   | 113 +++++++++++++++++++++------------------
 10 files changed, 134 insertions(+), 87 deletions(-)

diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index a31f7107f5..d3da61ceb7 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -1,4 +1,4 @@
-*cmdline.txt*   For Vim version 7.4.  Last change: 2014 Aug 16
+*cmdline.txt*   For Vim version 7.4.  Last change: 2014 Sep 06
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -56,7 +56,7 @@ history tables:
 These are completely separate.  Each history can only be accessed when
 entering the same type of line.
 Use the 'history' option to set the number of lines that are remembered
-(default: 20).
+(default: 50).
 Notes:
 - When you enter a command-line that is exactly the same as an older one, the
   old one is removed (to avoid repeated commands moving older commands out of
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index e5aa09c8a5..c0ec1a7da5 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Aug 29
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3346,6 +3346,7 @@ getcmdtype()						*getcmdtype()*
 		    ?	backward search command
 		    @	|input()| command
 		    -	|:insert| or |:append| command
+		    =	|i_CTRL-R_=|
 		Only works when editing the command line, thus requires use of
 		|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
 		Returns an empty string otherwise.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 2dcfa19e48..291ab833ee 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.4.  Last change: 2014 Aug 09
+*options.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3369,7 +3369,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	NOTE: This option is reset when 'compatible' is set.
 
 						*'grepformat'* *'gfm'*
-'grepformat' 'gfm'	string	(default "%f:%l%m,%f  %l%m")
+'grepformat' 'gfm'	string	(default "%f:%l:%m,%f:%l%m,%f  %l%m")
 			global
 			{not in Vi}
 	Format to recognize for the ":grep" command output.
@@ -7850,6 +7850,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 			fold options
 	   options	options and mappings local to a window or buffer (not
 			global values for local options)
+	   localoptions same as "options"
 	   slash	backslashes in file names replaced with forward
 			slashes
 	   unix		with Unix end-of-line format (single <NL>), even when
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index 205d2d8bf7..322811b7cf 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt*   For Vim version 7.4.  Last change: 2014 Aug 29
+*pattern.txt*   For Vim version 7.4.  Last change: 2014 Sep 06
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -838,7 +838,7 @@ $	At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
 	branch is used.
 	Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
 	"endfor".
-	This cannot be followed by a multi. *E888*
+	This cannot be followed by a multi. |E888|
 	{not in Vi} {not available when compiled without the |+syntax| feature}
 
 						*/\%^* *start-of-file*
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index d47b09a5dd..5cd4bd5447 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.4.  Last change: 2014 Aug 29
+*syntax.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -2975,6 +2975,7 @@ TEX				*tex.vim* *ft-tex-syntax* *latex-syntax*
 	Tex: Taking Advantage of Conceal Mode		|tex-conceal|
 	Tex: Selective Conceal Mode			|g:tex_conceal|
 	Tex: Controlling iskeyword			|g:tex_isk|
+	Tex: Fine Subscript and Superscript Control	|tex-supersub|
 
 				*tex-folding* *g:tex_fold_enabled*
  Tex: Want Syntax Folding? ~
@@ -3068,6 +3069,7 @@ selectively to enable just some syntax highlighting: >
 <
 As an example, let g:tex_fast= "M" will allow math-associated highlighting
 but suppress all the other region-based syntax highlighting.
+(also see: |g:tex_conceal| and |tex-supersub|)
 
 					*tex-morecommands* *tex-package*
  Tex: Want To Highlight More Commands? ~
@@ -3169,6 +3171,28 @@ syntax highlighting script handles this with the following logic:
 	* If g:tex_isk exists, then it will be used for the local 'iskeyword'
 	* Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255
 
+			*tex-supersub* *g:tex_superscripts* *g:tex_subscripts*
+ Tex: Fine Subscript and Superscript Control~
+
+	See |tex-conceal| for how to enable concealed character replacement.
+
+	See |g:tex_conceal| for selectively concealing accents, bold/italic,
+	math, Greek, and superscripts/subscripts.
+
+	One may exert fine control over which superscripts and subscripts one
+	wants syntax-based concealment for (see |:syn-cchar|).  Since not all
+	fonts support all characters, one may override the
+	concealed-replacement lists; by default these lists are given by: >
+
+	    let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
+	    let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
+<
+	For example, I use Luxi Mono Bold; it doesn't support subscript
+	characters for "hklmnpst", so I put >
+		let g:tex_subscripts= "[0-9aeijoruvx,+-/().]"
+<	in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable
+	utf-8 glyphs appear.
+
 
 TF						*tf.vim* *ft-tf-syntax*
 
diff --git a/runtime/doc/tags b/runtime/doc/tags
index ae78930886..a8047a68e4 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -4330,7 +4330,6 @@ E885	sign.txt	/*E885*
 E886	starting.txt	/*E886*
 E887	if_pyth.txt	/*E887*
 E888	pattern.txt	/*E888*
-E888	pattern.txt	/*E888*
 E89	message.txt	/*E89*
 E90	message.txt	/*E90*
 E91	options.txt	/*E91*
@@ -6082,6 +6081,8 @@ g:tex_isk	syntax.txt	/*g:tex_isk*
 g:tex_no_error	syntax.txt	/*g:tex_no_error*
 g:tex_nospell	syntax.txt	/*g:tex_nospell*
 g:tex_stylish	syntax.txt	/*g:tex_stylish*
+g:tex_subscripts	syntax.txt	/*g:tex_subscripts*
+g:tex_superscripts	syntax.txt	/*g:tex_superscripts*
 g:tex_verbspell	syntax.txt	/*g:tex_verbspell*
 g:var	eval.txt	/*g:var*
 g:vimball_home	pi_vimball.txt	/*g:vimball_home*
@@ -8301,6 +8302,7 @@ tex-runon	syntax.txt	/*tex-runon*
 tex-slow	syntax.txt	/*tex-slow*
 tex-stopzone	syntax.txt	/*tex-stopzone*
 tex-style	syntax.txt	/*tex-style*
+tex-supersub	syntax.txt	/*tex-supersub*
 tex-sync	syntax.txt	/*tex-sync*
 tex-verb	syntax.txt	/*tex-verb*
 tex.vim	syntax.txt	/*tex.vim*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 40caa2ed93..3dffe92e6d 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Aug 29
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Sep 09
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -61,31 +61,24 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-Patch to fix typos in help files. (Dominique, 2014 Aug 9)
-
-Way to reproduce problem that characters are put on the screen twice in Insert
-mode when using system(). (Jacob Niehus, 2014 Aug 9)
-Related to setting TMODE_COOK.  Perhaps we can omit that for system()?
-
 Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13)
-
-exepath() may return the wrong value.  Patch by Yasuhiro Matsumoto, 2014 Aug
-26.
-
-Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
-Also fixes wrong result from executable().
-Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
+Still produces errors.
+Add flag to ignore fifth argument of SFX.
+Conversion from utf-8 to cp1250 can't be without errors.
 
 Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show
 up. (Paul Moore, 2014 Jul 30)
 Should it depend on the Windows version?  Waiting for feedback.
 No longer needed after including DirectX patch?
+Related to issue 255?
+
+Problem with linebreak, adds a test that fails. (Nazri Ramliy, 2014 Sep 6)
 
-Fix for ":set all&" not taking care of side effect. (Yukihiro Nakadaira, 2014
-Aug 28)
+Patch to avoid problems with encoding conversion with diff.vim.
+(Yasuhiro Matsumoto, 2014 Sep 1.
 
 Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
-14)
+14, Aug 30)
     Make ":1close" close the first window.
     Make ":+1close" close the next window.
     Make ":-1close" close the previous window.
@@ -93,9 +86,16 @@ Can't easily close the help window, like ":pc" closes the preview window and
 ":ccl" closes the quickfix window.  Add ":hclose". (Chris Gaal)
 Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
 
+Patch to fix line formatting bug. (Christian Brabandt, 2014 Sep 7)
+
+Patch to fix ml_get error. (Christian Brabandt, 2014 Sep 7)
+
 Patch by Marcin Szamotulski to add +cmd to buffer commands.
 (2014 Aug 18)
 
+Patch to fix encoding of arguments when setting 'encoding'. (Yasuhiro
+Matsumoto, 2014 Sep 4)
+
 Patch to fix that system() with empty input fails. (Olaf Dabrunz, 2014 Aug 19)
 
 When using a visual selection of multiple words and doing CTRL-W_] it jumps to
@@ -131,6 +131,9 @@ MS-Windows: Crash opening very long file name starting with "\\".
 
 Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 
+Patch to allow for a different icon on MS-Windows. (Yasuhiro Matsumoto, 2014
+Sep 7).
+
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
@@ -271,9 +274,6 @@ Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
 
 Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16)
 
-Some quickfix messages appear twice. (Gary Johnson, 2014 Feb 16)
-Patch by Christian Brabandt, 2014 Feb 17.
-
 Patch to right-align signs. (James Kolb (email james), 2013 Sep 23)
 
 Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
@@ -1906,6 +1906,10 @@ restored. (Luc St-Louis)
 Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler,
 2010 Jun 30)
 
+Add an option for a minimal text length before inserting a line break for
+'textwidth'.  Avoids very short lines when a very long word follows.
+(Kartik Agaram)
+
 
 At next release:
 -   Build a huge version by default.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 896ccc1211..67d3a88288 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Aug 29
+" Last Change:	2014 Sep 05
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -531,7 +531,7 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
 au BufNewFile,BufRead *.cu			setf cuda
 
 " Dockerfile
-au BufNewFile,BufRead Dockerfile		setf=dockerfile
+au BufNewFile,BufRead Dockerfile		setf dockerfile
 
 " WildPackets EtherPeek Decoder
 au BufNewFile,BufRead *.dcd			setf dcd
@@ -1104,6 +1104,9 @@ au BufNewFile,BufRead *.lou,*.lout		setf lout
 " Lua
 au BufNewFile,BufRead *.lua			setf lua
 
+" Luarocks
+au BufNewFile,BufRead *.rockspec		setf lua
+
 " Linden Scripting Language (Second Life)
 au BufNewFile,BufRead *.lsl			setf lsl
 
diff --git a/runtime/ftplugin/vim.vim b/runtime/ftplugin/vim.vim
index edba37b896..f355d2837d 100644
--- a/runtime/ftplugin/vim.vim
+++ b/runtime/ftplugin/vim.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin
 " Language:	Vim
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2013 Jun 26
+" Last Change:	2014 Sep 07
 
 " Only do this when not done yet for this buffer
 if exists("b:did_ftplugin")
@@ -62,9 +62,12 @@ if exists("loaded_matchit")
 	\ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
 	\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
 	\ '(:)'
-  " Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
-  let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
-	\ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
+  " Ignore syntax region commands and settings, any 'en*' would clobber
+  " if-endif.
+  " - set spl=de,en
+  " - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
+  let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
+        \ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
 endif
 
 let &cpo = s:cpo_save
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index 31114bc093..3f719e8244 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	TeX
 " Maintainer:	Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change:	Mar 20, 2014
-" Version:	81
+" Last Change:	Sep 09, 2014
+" Version:	82
 " URL:		http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
 "
 " Notes: {{{1
@@ -88,6 +88,12 @@ if !exists("g:tex_conceal")
 else
  let s:tex_conceal= g:tex_conceal
 endif
+if !exists("g:tex_superscripts")
+ let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
+endif
+if !exists("g:tex_subscripts")
+ let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
+endif
 
 " Determine whether or not to use "*.sty" mode {{{1
 " The user may override the normal determination by setting
@@ -331,22 +337,22 @@ syn match texSpaceCodeChar    "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)"	contained
 if s:tex_fast =~ 'p'
   if !exists("g:tex_nospell") || !g:tex_nospell
    if g:tex_fold_enabled && has("folding")
-    syn region texDocZone			matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											fold contains=@texFoldGroup,@texDocGroup,@Spell
+    syn region texDocZone		matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											fold contains=@texFoldGroup,@texDocGroup,@Spell
     syn region texPartZone		matchgroup=texSection start='\\part\>'			 end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)'								fold contains=@texFoldGroup,@texPartGroup,@Spell
     syn region texChapterZone		matchgroup=texSection start='\\chapter\>'		 end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)'							fold contains=@texFoldGroup,@texChapterGroup,@Spell
     syn region texSectionZone		matchgroup=texSection start='\\section\>'		 end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'					fold contains=@texFoldGroup,@texSectionGroup,@Spell
-    syn region texSubSectionZone		matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
+    syn region texSubSectionZone	matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
     syn region texSubSubSectionZone	matchgroup=texSection start='\\subsubsection\>'		 end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
     syn region texParaZone		matchgroup=texSection start='\\paragraph\>'		 end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'			fold contains=@texFoldGroup,@texParaGroup,@Spell
     syn region texSubParaZone		matchgroup=texSection start='\\subparagraph\>'		 end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'	fold contains=@texFoldGroup,@Spell
     syn region texTitle			matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}'													fold contains=@texFoldGroup,@Spell
     syn region texAbstract		matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}'											fold contains=@texFoldGroup,@Spell
    else
-    syn region texDocZone			matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											contains=@texFoldGroup,@texDocGroup,@Spell
+    syn region texDocZone		matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											contains=@texFoldGroup,@texDocGroup,@Spell
     syn region texPartZone		matchgroup=texSection start='\\part\>'			 end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)'								contains=@texFoldGroup,@texPartGroup,@Spell
     syn region texChapterZone		matchgroup=texSection start='\\chapter\>'		 end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)'							contains=@texFoldGroup,@texChapterGroup,@Spell
     syn region texSectionZone		matchgroup=texSection start='\\section\>'		 end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'					contains=@texFoldGroup,@texSectionGroup,@Spell
-    syn region texSubSectionZone		matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSectionGroup,@Spell
+    syn region texSubSectionZone	matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSectionGroup,@Spell
     syn region texSubSubSectionZone	matchgroup=texSection start='\\subsubsection\>'		 end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
     syn region texParaZone		matchgroup=texSection start='\\paragraph\>'		 end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'			contains=@texFoldGroup,@texParaGroup,@Spell
     syn region texSubParaZone		matchgroup=texSection start='\\subparagraph\>'		 end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'	contains=@texFoldGroup,@Spell
@@ -355,22 +361,22 @@ if s:tex_fast =~ 'p'
    endif
   else
    if g:tex_fold_enabled && has("folding")
-    syn region texDocZone			matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											fold contains=@texFoldGroup,@texDocGroup
+    syn region texDocZone		matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											fold contains=@texFoldGroup,@texDocGroup
     syn region texPartZone		matchgroup=texSection start='\\part\>'			 end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)'								fold contains=@texFoldGroup,@texPartGroup
     syn region texChapterZone		matchgroup=texSection start='\\chapter\>'		 end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)'							fold contains=@texFoldGroup,@texChapterGroup
     syn region texSectionZone		matchgroup=texSection start='\\section\>'		 end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'					fold contains=@texFoldGroup,@texSectionGroup
-    syn region texSubSectionZone		matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSectionGroup
+    syn region texSubSectionZone	matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSectionGroup
     syn region texSubSubSectionZone	matchgroup=texSection start='\\subsubsection\>'		 end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				fold contains=@texFoldGroup,@texSubSubSectionGroup
     syn region texParaZone		matchgroup=texSection start='\\paragraph\>'		 end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'			fold contains=@texFoldGroup,@texParaGroup
     syn region texSubParaZone		matchgroup=texSection start='\\subparagraph\>'		 end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'	fold contains=@texFoldGroup
     syn region texTitle			matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}'													fold contains=@texFoldGroup
     syn region texAbstract		matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}'											fold contains=@texFoldGroup
    else
-    syn region texDocZone			matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											contains=@texFoldGroup,@texDocGroup
+    syn region texDocZone		matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}'											contains=@texFoldGroup,@texDocGroup
     syn region texPartZone		matchgroup=texSection start='\\part\>'			 end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)'								contains=@texFoldGroup,@texPartGroup
     syn region texChapterZone		matchgroup=texSection start='\\chapter\>'		 end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)'							contains=@texFoldGroup,@texChapterGroup
     syn region texSectionZone		matchgroup=texSection start='\\section\>'		 end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'					contains=@texFoldGroup,@texSectionGroup
-    syn region texSubSectionZone		matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSectionGroup
+    syn region texSubSectionZone	matchgroup=texSection start='\\subsection\>'		 end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSectionGroup
     syn region texSubSubSectionZone	matchgroup=texSection start='\\subsubsection\>'		 end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'				contains=@texFoldGroup,@texSubSubSectionGroup
     syn region texParaZone		matchgroup=texSection start='\\paragraph\>'		 end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'			contains=@texFoldGroup,@texParaGroup
     syn region texSubParaZone		matchgroup=texSection start='\\subparagraph\>'		 end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'	contains=@texFoldGroup
@@ -620,7 +626,7 @@ if s:tex_fast =~ 'r'
   syn region texRefZone		matchgroup=texStatement start="\\\(page\|eq\)ref{"	end="}\|%stopzone\>"	contains=@texRefGroup
   syn region texRefZone		matchgroup=texStatement start="\\v\=ref{"		end="}\|%stopzone\>"	contains=@texRefGroup
   syn region texRefOption	contained	matchgroup=Delimiter start='\[' end=']'		contains=@texRefGroup,texRefZone	nextgroup=texRefOption,texCite
-  syn region texCite	contained	matchgroup=Delimiter start='{' end='}'		contains=@texRefGroup,texRefZone,texCite
+  syn region texCite		contained	matchgroup=Delimiter start='{' end='}'		contains=@texRefGroup,texRefZone,texCite
 endif
 syn match  texRefZone		'\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite
 
@@ -1045,8 +1051,11 @@ if has("conceal") && &enc == 'utf-8'
    syn region texSubscript	matchgroup=Delimiter start='_{'		skip="\\\\\|\\[{}]" end='}'	contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
   endif
   fun! s:SuperSub(group,leader,pat,cchar)
-    exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
-    exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
+    if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts)
+"     call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">")
+     exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
+     exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
+    endif
   endfun
   call s:SuperSub('texSuperscript','\^','0','⁰')
   call s:SuperSub('texSuperscript','\^','1','¹')
@@ -1170,44 +1179,44 @@ if has("conceal") && &enc == 'utf-8'
       let i= i + 1
      endfor
    endfun
-   "                    \`  \'  \^  \"  \~  \.  \=  \c  \H  \k  \r  \u  \v
-   call   s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
-   call   s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
-   call   s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
-   call   s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
-   call   s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
-   call   s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
-   call   s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
-   call   s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
-   call   s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
-   call   s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
-   call   s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
-   call   s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
-   call   s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
-   call   s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
-   call   s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
-   call   s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
-   call   s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
-   call   s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
-   call   s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
-   call   s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
-   call   s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
-   call   s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
-   call   s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
-   call   s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
-   call   s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
-   call   s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
-   call   s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
-   call   s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
-   call   s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
-   call   s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
-   call   s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
-   call   s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
-   call   s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
-   call   s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
-   call   s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
-   call   s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
-   call   s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
+   "                  \`  \'  \^  \"  \~  \.  \=  \c  \H  \k  \r  \u  \v
+   call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
+   call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
+   call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
+   call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
+   call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
+   call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
+   call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
+   call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
+   call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
+   call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
+   call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
+   call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
+   call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
+   call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
+   call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
+   call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
+   call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
+   call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
+   call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
+   call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
+   call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
+   call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
+   call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
+   call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
+   call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
+   call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
+   call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
+   call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
+   call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
+   call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
+   call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
+   call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
+   call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
+   call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
+   call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
+   call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
+   call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
    call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ')
    "                    \`  \'  \^  \"  \~  \.  \=  \c  \H  \k  \r  \u  \v
    delfun s:Accents
@@ -1252,7 +1261,7 @@ endif
 if did_tex_syntax_inits == 1
  let did_tex_syntax_inits= 2
   " TeX highlighting groups which should share similar highlighting
-  if !exists("s:tex_no_error")
+  if !exists("g:tex_no_error")
    if !exists("g:tex_no_math")
     HiLink texBadMath		texError
     HiLink texMathDelimBad	texError

From c92ab3bae94855da60988320a1483bae8d489bca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 23:11:49 +0200
Subject: [PATCH 123/473] updated for version 7.4.442 Problem:    Using
 unitinialized variable. Solution:   Pass the first window of the tabpage.

---
 src/eval.c    | 8 ++++----
 src/version.c | 2 ++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index 8303bd3759..dfcb586b10 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -12071,7 +12071,7 @@ f_gettabvar(argvars, rettv)
     typval_T	*argvars;
     typval_T	*rettv;
 {
-    win_T	*win, *oldcurwin;
+    win_T	*oldcurwin;
     tabpage_T	*tp, *oldtabpage;
     dictitem_T	*v;
     char_u	*varname;
@@ -12084,9 +12084,9 @@ f_gettabvar(argvars, rettv)
     tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
     if (tp != NULL && varname != NULL)
     {
-	/* Set curwin to be our win, temporarily.  Also set the tabpage,
-	 * otherwise the window is not valid. */
-	switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
+	/* Set tp to be our tabpage, temporarily.  Also set the window to the
+	 * first window in the tabpage, otherwise the window is not valid. */
+	switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE);
 
 	/* look up the variable */
 	/* Let gettabvar({nr}, "") return the "t:" dictionary. */
diff --git a/src/version.c b/src/version.c
index 5d512a3cda..70b4087552 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    442,
 /**/
     441,
 /**/

From 19b443469cf2e3f28b80fbe692887bbcb7fc2081 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 9 Sep 2014 23:11:50 +0200
Subject: [PATCH 124/473] Added tag v7-4-442 for changeset 8c3c067b4ae3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e163b408f3..fc570c86a1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3164,3 +3164,4 @@ db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
 07b28e96af8bace1af65bac661f22716781103fd v7-4-439
 1f578cd9a65779d2597e0135a5916db621d65734 v7-4-440
 e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441
+8c3c067b4ae3cc02ce4411042df05f97df5bc316 v7-4-442

From 2c958b73ca0cb10052dc10cfc625d26a892e3d96 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 11 Sep 2014 22:50:09 +0200
Subject: [PATCH 125/473] updated for version 7.4.443 Problem:    Error
 reported by ubsan when running test 72. Solution:   Add type cast to
 unsigned. (Dominique Pelle)

---
 src/undo.c    | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/undo.c b/src/undo.c
index db6ea29ab7..24dcf0548e 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -1019,7 +1019,7 @@ undo_read_4c(bi)
 	int	n;
 
 	undo_read(bi, buf, (size_t)4);
-	n = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
+	n = ((unsigned)buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3];
 	return n;
     }
 #endif
diff --git a/src/version.c b/src/version.c
index 70b4087552..c04cb9bc3d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    443,
 /**/
     442,
 /**/

From 61c339d9145392781c05b92595fe9f63a4d7ffbb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 11 Sep 2014 22:50:09 +0200
Subject: [PATCH 126/473] Added tag v7-4-443 for changeset f1ba154c3a12

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index fc570c86a1..fb4ee55a3d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3165,3 +3165,4 @@ db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
 1f578cd9a65779d2597e0135a5916db621d65734 v7-4-440
 e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441
 8c3c067b4ae3cc02ce4411042df05f97df5bc316 v7-4-442
+f1ba154c3a12d06cd0f40edbfc675103eb2dd7ad v7-4-443

From b27b233e82ff2507080c137a4431e8629a70eeb6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 15 Sep 2014 14:25:54 +0200
Subject: [PATCH 127/473] updated for version 7.4.444 Problem:    Reversed
 question mark not recognized as punctuation. (Issue 258) Solution:   Add the
 Supplemental Punctuation range.

---
 src/mbyte.c   | 1 +
 src/version.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/mbyte.c b/src/mbyte.c
index 10df894bec..44cbd5f82b 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -2537,6 +2537,7 @@ utf_class(c)
 	{0x2900, 0x2998, 1},		/* arrows, brackets, etc. */
 	{0x29d8, 0x29db, 1},
 	{0x29fc, 0x29fd, 1},
+	{0x2e00, 0x2e7f, 1},		/* supplemental punctuation */
 	{0x3000, 0x3000, 0},		/* ideographic space */
 	{0x3001, 0x3020, 1},		/* ideographic punctuation */
 	{0x3030, 0x3030, 1},
diff --git a/src/version.c b/src/version.c
index c04cb9bc3d..a66046a216 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    444,
 /**/
     443,
 /**/

From e2423d059dc4af8552975da069af76a9df8e9d20 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 15 Sep 2014 14:25:55 +0200
Subject: [PATCH 128/473] Added tag v7-4-444 for changeset d4cc9f48d5a4

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index fb4ee55a3d..ea65498df2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3166,3 +3166,4 @@ db3b8fe8330ea2afabd6c4856be5c76ef86d4728 v7-4-438
 e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441
 8c3c067b4ae3cc02ce4411042df05f97df5bc316 v7-4-442
 f1ba154c3a12d06cd0f40edbfc675103eb2dd7ad v7-4-443
+d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444

From 197eb78036154984662297ac6c2f40376007222d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 13:46:52 +0200
Subject: [PATCH 129/473] updated for version 7.4.445 Problem:    Clipboard may
 be cleared on startup. Solution:   Set clip_did_set_selection to -1 during
 startup. (Christian 	    Brabandt)

---
 src/main.c    | 9 +++++++++
 src/ui.c      | 4 ++--
 src/version.c | 2 ++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 73f6697ac6..fe75495828 100644
--- a/src/main.c
+++ b/src/main.c
@@ -958,8 +958,17 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
     if (p_im)
 	need_start_insertmode = TRUE;
 
+#ifdef FEAT_CLIPBOARD
+    if (clip_unnamed)
+       /* do not overwrite system clipboard while starting up */
+       clip_did_set_selection = -1;
+#endif
 #ifdef FEAT_AUTOCMD
     apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf);
+# ifdef FEAT_CLIPBOARD
+    if (clip_did_set_selection < 0)
+       clip_did_set_selection = TRUE;
+# endif
     TIME_MSG("VimEnter autocommands");
 #endif
 
diff --git a/src/ui.c b/src/ui.c
index 21d92f0b7b..b268cd78d4 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -571,7 +571,7 @@ start_global_changes()
 {
     clip_unnamed_saved = clip_unnamed;
 
-    if (clip_did_set_selection)
+    if (clip_did_set_selection > 0)
     {
 	clip_unnamed = FALSE;
 	clip_did_set_selection = FALSE;
@@ -584,7 +584,7 @@ start_global_changes()
     void
 end_global_changes()
 {
-    if (!clip_did_set_selection)
+    if (clip_did_set_selection == FALSE)  /* not when -1 */
     {
 	clip_did_set_selection = TRUE;
 	clip_unnamed = clip_unnamed_saved;
diff --git a/src/version.c b/src/version.c
index a66046a216..adff6dbd01 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    445,
 /**/
     444,
 /**/

From f4c25e0ef66dadd252596c000586b4c74ce6648d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 13:46:53 +0200
Subject: [PATCH 130/473] Added tag v7-4-445 for changeset 1138726736fb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ea65498df2..d7b1a70c05 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3167,3 +3167,4 @@ e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441
 8c3c067b4ae3cc02ce4411042df05f97df5bc316 v7-4-442
 f1ba154c3a12d06cd0f40edbfc675103eb2dd7ad v7-4-443
 d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
+1138726736fbdb92aa5259ca4b76573b8f4b3f79 v7-4-445

From 05e78655f17627a4ee5479e19930e163ee1f2686 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 14:26:36 +0200
Subject: [PATCH 131/473] updated for version 7.4.446 Problem:    In some
 situations, when setting up an environment to trigger an 	   
 autocommand, the environment is not properly restored. Solution:   Check the
 return value of switch_win() and call restore_win() 	    always.  (Daniel
 Hahler)

---
 src/eval.c    | 93 ++++++++++++++++++++++++++-------------------------
 src/misc2.c   |  3 +-
 src/version.c |  2 ++
 src/window.c  | 11 ++----
 4 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index dfcb586b10..780d8834b0 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -12086,15 +12086,17 @@ f_gettabvar(argvars, rettv)
     {
 	/* Set tp to be our tabpage, temporarily.  Also set the window to the
 	 * first window in the tabpage, otherwise the window is not valid. */
-	switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE);
-
-	/* look up the variable */
-	/* Let gettabvar({nr}, "") return the "t:" dictionary. */
-	v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
-	if (v != NULL)
+	if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE)
+									== OK)
 	{
-	    copy_tv(&v->di_tv, rettv);
-	    done = TRUE;
+	    /* look up the variable */
+	    /* Let gettabvar({nr}, "") return the "t:" dictionary. */
+	    v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
+	    if (v != NULL)
+	    {
+		copy_tv(&v->di_tv, rettv);
+		done = TRUE;
+	    }
 	}
 
 	/* restore previous notion of curwin */
@@ -12233,22 +12235,24 @@ getwinvar(argvars, rettv, off)
     {
 	/* Set curwin to be our win, temporarily.  Also set the tabpage,
 	 * otherwise the window is not valid. */
-	switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
-
-	if (*varname == '&')	/* window-local-option */
-	{
-	    if (get_option_tv(&varname, rettv, 1) == OK)
-		done = TRUE;
-	}
-	else
+	if (switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
 	{
-	    /* Look up the variable. */
-	    /* Let getwinvar({nr}, "") return the "w:" dictionary. */
-	    v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w', varname, FALSE);
-	    if (v != NULL)
+	    if (*varname == '&')	/* window-local-option */
 	    {
-		copy_tv(&v->di_tv, rettv);
-		done = TRUE;
+		if (get_option_tv(&varname, rettv, 1) == OK)
+		    done = TRUE;
+	    }
+	    else
+	    {
+		/* Look up the variable. */
+		/* Let getwinvar({nr}, "") return the "w:" dictionary. */
+		v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w',
+							      varname, FALSE);
+		if (v != NULL)
+		{
+		    copy_tv(&v->di_tv, rettv);
+		    done = TRUE;
+		}
 	    }
 	}
 
@@ -17252,34 +17256,33 @@ setwinvar(argvars, rettv, off)
     if (win != NULL && varname != NULL && varp != NULL)
     {
 #ifdef FEAT_WINDOWS
-	if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == FAIL)
-	    return;
+	if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
 #endif
-
-	if (*varname == '&')
 	{
-	    long	numval;
-	    char_u	*strval;
-	    int		error = FALSE;
-
-	    ++varname;
-	    numval = get_tv_number_chk(varp, &error);
-	    strval = get_tv_string_buf_chk(varp, nbuf);
-	    if (!error && strval != NULL)
-		set_option_value(varname, numval, strval, OPT_LOCAL);
-	}
-	else
-	{
-	    winvarname = alloc((unsigned)STRLEN(varname) + 3);
-	    if (winvarname != NULL)
+	    if (*varname == '&')
+	    {
+		long	numval;
+		char_u	*strval;
+		int		error = FALSE;
+
+		++varname;
+		numval = get_tv_number_chk(varp, &error);
+		strval = get_tv_string_buf_chk(varp, nbuf);
+		if (!error && strval != NULL)
+		    set_option_value(varname, numval, strval, OPT_LOCAL);
+	    }
+	    else
 	    {
-		STRCPY(winvarname, "w:");
-		STRCPY(winvarname + 2, varname);
-		set_var(winvarname, varp, TRUE);
-		vim_free(winvarname);
+		winvarname = alloc((unsigned)STRLEN(varname) + 3);
+		if (winvarname != NULL)
+		{
+		    STRCPY(winvarname, "w:");
+		    STRCPY(winvarname + 2, varname);
+		    set_var(winvarname, varp, TRUE);
+		    vim_free(winvarname);
+		}
 	    }
 	}
-
 #ifdef FEAT_WINDOWS
 	restore_win(save_curwin, save_curtab, TRUE);
 #endif
diff --git a/src/misc2.c b/src/misc2.c
index 1f8878f674..1fe0e87cf1 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1040,7 +1040,8 @@ free_all_mem()
     entered = TRUE;
 
 # ifdef FEAT_AUTOCMD
-    block_autocmds();	    /* don't want to trigger autocommands here */
+    /* Don't want to trigger autocommands from here on. */
+    block_autocmds();
 # endif
 
 # ifdef FEAT_WINDOWS
diff --git a/src/version.c b/src/version.c
index adff6dbd01..53fcc8f0df 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    446,
 /**/
     445,
 /**/
diff --git a/src/window.c b/src/window.c
index 5012427fae..0088e32648 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1271,7 +1271,7 @@ win_init(newp, oldp, flags)
 }
 
 /*
- * Initialize window "newp" from window"old".
+ * Initialize window "newp" from window "old".
  * Only the essential things are copied.
  */
     static void
@@ -6662,8 +6662,8 @@ restore_snapshot_rec(sn, fr)
 	|| defined(PROTO)
 /*
  * Set "win" to be the curwin and "tp" to be the current tab page.
- * restore_win() MUST be called to undo.
- * No autocommands will be executed.
+ * restore_win() MUST be called to undo, also when FAIL is returned.
+ * No autocommands will be executed until restore_win() is called.
  * When "no_display" is TRUE the display won't be affected, no redraw is
  * triggered, another tabpage access is limited.
  * Returns FAIL if switching to "win" failed.
@@ -6696,12 +6696,7 @@ switch_win(save_curwin, save_curtab, win, tp, no_display)
 	    goto_tabpage_tp(tp, FALSE, FALSE);
     }
     if (!win_valid(win))
-    {
-# ifdef FEAT_AUTOCMD
-	unblock_autocmds();
-# endif
 	return FAIL;
-    }
     curwin = win;
     curbuf = curwin->w_buffer;
 # endif

From ed856b5d8b4a0f83d0aee562e168bc411af04794 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 14:26:37 +0200
Subject: [PATCH 132/473] Added tag v7-4-446 for changeset 63121fdd093f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d7b1a70c05..73c04b0c9c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3168,3 +3168,4 @@ e754b23b7d1c3825dc2c6028867d631520a8cdca v7-4-441
 f1ba154c3a12d06cd0f40edbfc675103eb2dd7ad v7-4-443
 d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 1138726736fbdb92aa5259ca4b76573b8f4b3f79 v7-4-445
+63121fdd093ff71081725d5495337ea45d38daab v7-4-446

From 4aa3dd981a6b0ff9338d7b0e7e6846f04c0ac7ca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 16:04:11 +0200
Subject: [PATCH 133/473] updated for version 7.4.447 Problem:    Spell files
 from Hunspell may generate a lot of errors. Solution:   Add the IGNOREEXTRA
 flag.

---
 runtime/doc/spell.txt | 11 +++++++++++
 src/spell.c           | 13 ++++++++++---
 src/version.c         |  2 ++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index 3ffd8932e1..e1cc6a593c 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1058,6 +1058,9 @@ this text to start with a "#" so that mistakes don't go unnoticed.  Example:
 	SFX F 0 in   [^i]n      # Spion > Spionin  ~
 	SFX F 0 nen  in		# Bauerin > Bauerinnen ~
 
+However, to avoid lots of errors in affix files written for Myspell, you can
+add the IGNOREEXTRA flag.
+
 Apparently Myspell allows an affix name to appear more than once.  Since this
 might also be a mistake, Vim checks for an extra "S".  The affix files for
 Myspell that use this feature apparently have this flag.  Example:
@@ -1111,6 +1114,14 @@ Specifically, the affix flags can be used for:
 - CIRCUMFIX, as explained just below.
 
 
+IGNOREEXTRA						*spell-IGNOREEXTRA*
+
+Normally Vim gives an error for an extra field that does not start with '#'.
+This avoids errors going unnoticed.  However, some files created for Myspell
+or Hunspell may contain many entries with an extra field.  Use the IGNOREEXTRA
+flag to avoid lots of errors.
+
+
 CIRCUMFIX						*spell-CIRCUMFIX*
 
 The CIRCUMFIX flag means a prefix and suffix must be added at the same time.
diff --git a/src/spell.c b/src/spell.c
index 50636421ea..1e52dfb26e 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -4841,6 +4841,7 @@ typedef struct afffile_S
     unsigned	af_nosuggest;	/* NOSUGGEST ID */
     int		af_pfxpostpone;	/* postpone prefixes without chop string and
 				   without flags */
+    int		af_ignoreextra;	/* IGNOREEXTRA present */
     hashtab_T	af_pref;	/* hashtable for prefixes, affheader_T */
     hashtab_T	af_suff;	/* hashtable for suffixes, affheader_T */
     hashtab_T	af_comp;	/* hashtable for compound flags, compitem_T */
@@ -5605,6 +5606,10 @@ spell_read_aff(spin, fname)
 	    {
 		aff->af_pfxpostpone = TRUE;
 	    }
+	    else if (is_aff_rule(items, itemcnt, "IGNOREEXTRA", 1))
+	    {
+		aff->af_ignoreextra = TRUE;
+	    }
 	    else if ((STRCMP(items[0], "PFX") == 0
 					      || STRCMP(items[0], "SFX") == 0)
 		    && aff_todo == 0
@@ -5712,9 +5717,11 @@ spell_read_aff(spin, fname)
 		int		lasti = 5;
 
 		/* Myspell allows extra text after the item, but that might
-		 * mean mistakes go unnoticed.  Require a comment-starter.
-		 * Hunspell uses a "-" item. */
-		if (itemcnt > lasti && *items[lasti] != '#'
+		 * mean mistakes go unnoticed.  Require a comment-starter,
+		 * unless IGNOREEXTRA is used.  Hunspell uses a "-" item. */
+		if (itemcnt > lasti
+			&& !aff->af_ignoreextra
+			&& *items[lasti] != '#'
 			&& (STRCMP(items[lasti], "-") != 0
 						     || itemcnt != lasti + 1))
 		    smsg((char_u *)_(e_afftrailing), fname, lnum, items[lasti]);
diff --git a/src/version.c b/src/version.c
index 53fcc8f0df..4950539296 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    447,
 /**/
     446,
 /**/

From bc66d394fd5603d64146156421951bbc19724198 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 16:04:12 +0200
Subject: [PATCH 134/473] Added tag v7-4-447 for changeset 0d2c821cdc25

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 73c04b0c9c..9a2026a34c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3169,3 +3169,4 @@ f1ba154c3a12d06cd0f40edbfc675103eb2dd7ad v7-4-443
 d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 1138726736fbdb92aa5259ca4b76573b8f4b3f79 v7-4-445
 63121fdd093ff71081725d5495337ea45d38daab v7-4-446
+0d2c821cdc2505879823a551baeeb8d3c61ce758 v7-4-447

From 0bb14b3ee81a3821cc5c8971b6be43c73daefd94 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 16:13:53 +0200
Subject: [PATCH 135/473] updated for version 7.4.448 Problem:    Using
 ETO_IGNORELANGUAGE causes problems. Solution:   Remove this flag. (Paul
 Moore)

---
 src/gui_w32.c | 17 +++--------------
 src/version.c |  2 ++
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/gui_w32.c b/src/gui_w32.c
index 0368dda439..6948ab551c 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -535,10 +535,6 @@ static void dyn_imm_load(void);
 # define pImmSetConversionStatus  ImmSetConversionStatus
 #endif
 
-#ifndef ETO_IGNORELANGUAGE
-# define ETO_IGNORELANGUAGE  0x1000
-#endif
-
 /* multi monitor support */
 typedef struct _MONITORINFOstruct
 {
@@ -2500,12 +2496,6 @@ gui_mch_draw_string(
 		padding[i] = gui.char_width;
     }
 
-    /* On NT, tell the font renderer not to "help" us with Hebrew and Arabic
-     * text.  This doesn't work in 9x, so we have to deal with it manually on
-     * those systems. */
-    if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
-	foptions |= ETO_IGNORELANGUAGE;
-
     /*
      * We have to provide the padding argument because italic and bold versions
      * of fixed-width fonts are often one pixel or so wider than their normal
@@ -2641,10 +2631,9 @@ gui_mch_draw_string(
 #endif
     {
 #ifdef FEAT_RIGHTLEFT
-	/* If we can't use ETO_IGNORELANGUAGE, we can't tell Windows not to
-	 * mess up RL text, so we have to draw it character-by-character.
-	 * Only do this if RL is on, since it's slow. */
-	if (curwin->w_p_rl && !(foptions & ETO_IGNORELANGUAGE))
+	/* Windows will mess up RL text, so we have to draw it character by
+	 * character.  Only do this if RL is on, since it's slow. */
+	if (curwin->w_p_rl)
 	    RevOut(s_hdc, TEXT_X(col), TEXT_Y(row),
 			 foptions, pcliprect, (char *)text, len, padding);
 	else
diff --git a/src/version.c b/src/version.c
index 4950539296..7007e884dd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    448,
 /**/
     447,
 /**/

From e0b0c5e016aebb7144fcae482fc58b705053b4c7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 16:13:53 +0200
Subject: [PATCH 136/473] Added tag v7-4-448 for changeset 2fd96725b063

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9a2026a34c..ec7fcca994 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3170,3 +3170,4 @@ d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 1138726736fbdb92aa5259ca4b76573b8f4b3f79 v7-4-445
 63121fdd093ff71081725d5495337ea45d38daab v7-4-446
 0d2c821cdc2505879823a551baeeb8d3c61ce758 v7-4-447
+2fd96725b0632cd9183581ce13d7b2cbd734d8d4 v7-4-448

From df1f8a18809f555ec85a2f198a21135450504ada Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 19:39:34 +0200
Subject: [PATCH 137/473] updated for version 7.4.449 Problem:    Can't easily
 close the help window. (Chris Gaal) Solution:   Add ":helpclose". (Christian
 Brabandt)

---
 runtime/doc/helphelp.txt |  3 +++
 runtime/doc/index.txt    |  1 +
 src/ex_cmds.c            | 18 ++++++++++++++++++
 src/ex_cmds.h            |  2 ++
 src/proto/ex_cmds.pro    |  1 +
 src/version.c            |  2 ++
 6 files changed, 27 insertions(+)

diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index 87f095e56d..e7d281a915 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -96,6 +96,9 @@ Help on help files					*helphelp*
 			find a tag in a file with the same language as the
 			current file.  See |help-translated|.
 
+						 	*:helpc* *:helpclose*
+:helpc[lose]            Close one help window.
+
 							*:helpg* *:helpgrep*
 :helpg[rep] {pattern}[@xx]
 			Search all help text files and make a list of lines
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index cda17681fd..d16ad9a407 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1244,6 +1244,7 @@ tag	      command	      action ~
 |:gvim|		:gv[im]		start the GUI
 |:hardcopy|	:ha[rdcopy]	send text to the printer
 |:help|		:h[elp]		open a help window
+|:helpclose|	:helpc[lose]	close one help window
 |:helpfind|	:helpf[ind]	dialog to open a help window
 |:helpgrep|	:helpg[rep]	like ":grep" but searches help files
 |:helptags|	:helpt[ags]	generate help tags for a directory
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 2a81eb7398..4ae996c944 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5899,6 +5899,24 @@ ex_help(eap)
     vim_free(tag);
 }
 
+/*
+ * ":helpclose": Close the help window
+ */
+    void
+ex_helpclose(eap)
+    exarg_T	*eap UNUSED;
+{
+    win_T *win;
+
+    FOR_ALL_WINDOWS(win)
+    {
+	if (win->w_buffer->b_help)
+	{
+	    win_close(win, FALSE);
+	    break;
+	}
+    }
+}
 
 #if defined(FEAT_MULTI_LANG) || defined(PROTO)
 /*
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 41d3a642d3..f3007c9347 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -417,6 +417,8 @@ EX(CMD_gvim,		"gvim",		ex_gui,
 			BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
 EX(CMD_help,		"help",		ex_help,
 			BANG|EXTRA|NOTRLCOM),
+EX(CMD_helpclose,	"helpclose",	ex_helpclose,
+			RANGE|NOTADR|COUNT|TRLBAR),
 EX(CMD_helpfind,	"helpfind",	ex_helpfind,
 			EXTRA|NOTRLCOM),
 EX(CMD_helpgrep,	"helpgrep",	ex_helpgrep,
diff --git a/src/proto/ex_cmds.pro b/src/proto/ex_cmds.pro
index a94f5d0486..8757637c0a 100644
--- a/src/proto/ex_cmds.pro
+++ b/src/proto/ex_cmds.pro
@@ -44,6 +44,7 @@ void write_viminfo_sub_string __ARGS((FILE *fp));
 void free_old_sub __ARGS((void));
 int prepare_tagpreview __ARGS((int undo_sync));
 void ex_help __ARGS((exarg_T *eap));
+void ex_helpclose __ARGS((exarg_T *eap));
 char_u *check_help_lang __ARGS((char_u *arg));
 int help_heuristic __ARGS((char_u *matched_string, int offset, int wrong_case));
 int find_help_tags __ARGS((char_u *arg, int *num_matches, char_u ***matches, int keep_lang));
diff --git a/src/version.c b/src/version.c
index 7007e884dd..83dfeaa36d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    449,
 /**/
     448,
 /**/

From 74dc4efbd0b268ea7f581fb18f93685f5b65e557 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 19:39:34 +0200
Subject: [PATCH 138/473] Added tag v7-4-449 for changeset cb5480096f1b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ec7fcca994..a604f37fcc 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3171,3 +3171,4 @@ d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 63121fdd093ff71081725d5495337ea45d38daab v7-4-446
 0d2c821cdc2505879823a551baeeb8d3c61ce758 v7-4-447
 2fd96725b0632cd9183581ce13d7b2cbd734d8d4 v7-4-448
+cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449

From 6207f131b9e2e839ef386f9bfe9c4153a620c056 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 20:07:26 +0200
Subject: [PATCH 139/473] updated for version 7.4.450 Problem:    Not all
 commands that edit another buffer support the +cmd 	    argument.
 Solution:   Add the +cmd argument to relevant commands. (Marcin Szamotulski)

---
 runtime/doc/windows.txt | 59 ++++++++++++++++++++++++-----------------
 src/ex_cmds.h           | 34 ++++++++++++------------
 src/ex_docmd.c          | 12 +++++++++
 src/version.c           |  2 ++
 4 files changed, 66 insertions(+), 41 deletions(-)

diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 4ba28a3c08..00fe956dd4 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1042,36 +1042,41 @@ list of buffers. |unlisted-buffer|
 		a number).  Insert a backslash before a space in a buffer
 		name.
 
-:[N]b[uffer][!] [N]			*:b* *:bu* *:buf* *:buffer* *E86*
+:[N]b[uffer][!] [+cmd] [N]		*:b* *:bu* *:buf* *:buffer* *E86*
 		Edit buffer [N] from the buffer list.  If [N] is not given,
 		the current buffer remains being edited.  See |:buffer-!| for
 		[!].  This will also edit a buffer that is not in the buffer
 		list, without setting the 'buflisted' flag.
+		Also see ||+cmd|.
 
-:[N]b[uffer][!] {bufname}
+:[N]b[uffer][!] [+cmd] {bufname}
 		Edit buffer for {bufname} from the buffer list.  See
 		|:buffer-!| for [!].  This will also edit a buffer that is not
 		in the buffer list, without setting the 'buflisted' flag.
+		Also see ||+cmd|.
 
-:[N]sb[uffer] [N]					*:sb* *:sbuffer*
+:[N]sb[uffer] [+cmd] [N]				*:sb* *:sbuffer*
 		Split window and edit buffer [N] from the buffer list.  If [N]
 		is not given, the current buffer is edited.  Respects the
 		"useopen" setting of 'switchbuf' when splitting.  This will
 		also edit a buffer that is not in the buffer list, without
 		setting the 'buflisted' flag.
+		Also see ||+cmd|.
 
-:[N]sb[uffer] {bufname}
+:[N]sb[uffer] [+cmd] {bufname}
 		Split window and edit buffer for {bufname} from the buffer
 		list.  This will also edit a buffer that is not in the buffer
 		list, without setting the 'buflisted' flag.
 		Note: If what you want to do is split the buffer, make a copy
 		under another name, you can do it this way: >
 			:w foobar | sp #
+<		Also see ||+cmd|.
 
-:[N]bn[ext][!] [N]					*:bn* *:bnext* *E87*
+:[N]bn[ext][!] [+cmd] [N]				*:bn* *:bnext* *E87*
 		Go to [N]th next buffer in buffer list.  [N] defaults to one.
 		Wraps around the end of the buffer list.
 		See |:buffer-!| for [!].
+		Also see ||+cmd|.
 		If you are in a help buffer, this takes you to the next help
 		buffer (if there is one).  Similarly, if you are in a normal
 		(non-help) buffer, this takes you to the next normal buffer.
@@ -1079,55 +1084,61 @@ list of buffers. |unlisted-buffer|
 		the way when you're browsing code/text buffers.  The next three
 		commands also work like this.
 
+
 							*:sbn* *:sbnext*
-:[N]sbn[ext] [N]
+:[N]sbn[ext] [+cmd] [N]
 		Split window and go to [N]th next buffer in buffer list.
 		Wraps around the end of the buffer list.  Uses 'switchbuf'
+		Also see ||+cmd|.
 
-:[N]bN[ext][!] [N]			*:bN* *:bNext* *:bp* *:bprevious* *E88*
-:[N]bp[revious][!] [N]
+:[N]bN[ext][!] [+cmd] [N]		*:bN* *:bNext* *:bp* *:bprevious* *E88*
+:[N]bp[revious][!] [+cmd] [N]
 		Go to [N]th previous buffer in buffer list.  [N] defaults to
 		one.  Wraps around the start of the buffer list.
 		See |:buffer-!| for [!] and 'switchbuf'.
+		Also see ||+cmd|.
 
-:[N]sbN[ext] [N]			*:sbN* *:sbNext* *:sbp* *:sbprevious*
-:[N]sbp[revious] [N]
+:[N]sbN[ext] [+cmd] [N]			*:sbN* *:sbNext* *:sbp* *:sbprevious*
+:[N]sbp[revious] [+cmd] [N]
 		Split window and go to [N]th previous buffer in buffer list.
 		Wraps around the start of the buffer list.
 		Uses 'switchbuf'.
+		Also see ||+cmd|.
 
-							*:br* *:brewind*
-:br[ewind][!]	Go to first buffer in buffer list.  If the buffer list is
+:br[ewind][!] [+cmd]					*:br* *:brewind*
+		Go to first buffer in buffer list.  If the buffer list is
 		empty, go to the first unlisted buffer.
 		See |:buffer-!| for [!].
 
-							*:bf* *:bfirst*
-:bf[irst]	Same as ":brewind".
+:bf[irst] [+cmd]					*:bf* *:bfirst*
+		Same as |:brewind|.
+		Also see |+cmd|.
 
-							*:sbr* *:sbrewind*
-:sbr[ewind]	Split window and go to first buffer in buffer list.  If the
+:sbr[ewind] [+cmd]					*:sbr* *:sbrewind*
+		Split window and go to first buffer in buffer list.  If the
 		buffer list is empty, go to the first unlisted buffer.
 		Respects the 'switchbuf' option.
+		Also see |+cmd|.
 
-							*:sbf* *:sbfirst*
-:sbf[irst]	Same as ":sbrewind".
+:sbf[irst] [+cmd]					*:sbf* *:sbfirst*
+		Same as ":sbrewind".
 
-							*:bl* *:blast*
-:bl[ast][!]	Go to last buffer in buffer list.  If the buffer list is
+:bl[ast][!] [+cmd]					*:bl* *:blast*
+		Go to last buffer in buffer list.  If the buffer list is
 		empty, go to the last unlisted buffer.
 		See |:buffer-!| for [!].
 
-							*:sbl* *:sblast*
-:sbl[ast]	Split window and go to last buffer in buffer list.  If the
+:sbl[ast] [+cmd]					*:sbl* *:sblast*
+		Split window and go to last buffer in buffer list.  If the
 		buffer list is empty, go to the last unlisted buffer.
 		Respects 'switchbuf' option.
 
-:[N]bm[odified][!] [N]				*:bm* *:bmodified* *E84*
+:[N]bm[odified][!] [+cmd] [N]			*:bm* *:bmodified* *E84*
 		Go to [N]th next modified buffer.  Note: this command also
 		finds unlisted buffers.  If there is no modified buffer the
 		command fails.
 
-:[N]sbm[odified] [N]					*:sbm* *:sbmodified*
+:[N]sbm[odified] [+cmd] [N]				*:sbm* *:sbmodified*
 		Split window and go to [N]th next modified buffer.
 		Respects 'switchbuf' option.
 		Note: this command also finds buffers not in the buffer list.
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index f3007c9347..56dfe8ea7c 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -132,9 +132,9 @@ EX(CMD_augroup,		"augroup",	ex_autocmd,
 EX(CMD_aunmenu,		"aunmenu",	ex_menu,
 			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
 EX(CMD_buffer,		"buffer",	ex_buffer,
-			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
 EX(CMD_bNext,		"bNext",	ex_bprevious,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_ball,		"ball",		ex_buffer_all,
 			RANGE|NOTADR|COUNT|TRLBAR),
 EX(CMD_badd,		"badd",		ex_edit,
@@ -146,19 +146,19 @@ EX(CMD_behave,		"behave",	ex_behave,
 EX(CMD_belowright,	"belowright",	ex_wrongmodifier,
 			NEEDARG|EXTRA|NOTRLCOM),
 EX(CMD_bfirst,		"bfirst",	ex_brewind,
-			BANG|RANGE|NOTADR|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
 EX(CMD_blast,		"blast",	ex_blast,
-			BANG|RANGE|NOTADR|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
 EX(CMD_bmodified,	"bmodified",	ex_bmodified,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_bnext,		"bnext",	ex_bnext,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_botright,	"botright",	ex_wrongmodifier,
 			NEEDARG|EXTRA|NOTRLCOM),
 EX(CMD_bprevious,	"bprevious",	ex_bprevious,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_brewind,		"brewind",	ex_brewind,
-			BANG|RANGE|NOTADR|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
 EX(CMD_break,		"break",	ex_break,
 			TRLBAR|SBOXOK|CMDWIN),
 EX(CMD_breakadd,	"breakadd",	ex_breakadd,
@@ -814,23 +814,23 @@ EX(CMD_sandbox,		"sandbox",	ex_wrongmodifier,
 EX(CMD_saveas,		"saveas",	ex_write,
 			BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
 EX(CMD_sbuffer,		"sbuffer",	ex_buffer,
-			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
 EX(CMD_sbNext,		"sbNext",	ex_bprevious,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_sball,		"sball",	ex_buffer_all,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_sbfirst,		"sbfirst",	ex_brewind,
-			TRLBAR),
+			EDITCMD|TRLBAR),
 EX(CMD_sblast,		"sblast",	ex_blast,
-			TRLBAR),
+			EDITCMD|TRLBAR),
 EX(CMD_sbmodified,	"sbmodified",	ex_bmodified,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_sbnext,		"sbnext",	ex_bnext,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_sbprevious,	"sbprevious",	ex_bprevious,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
 EX(CMD_sbrewind,	"sbrewind",	ex_brewind,
-			TRLBAR),
+			EDITCMD|TRLBAR),
 EX(CMD_scriptnames,	"scriptnames",	ex_scriptnames,
 			TRLBAR|CMDWIN),
 EX(CMD_scriptencoding,	"scriptencoding", ex_scriptencoding,
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index e90dfe5935..c957b5e735 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5135,6 +5135,8 @@ ex_buffer(eap)
 	    goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
 	else
 	    goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
+	if (eap->do_ecmd_cmd != NULL)
+	    do_cmdline_cmd(eap->do_ecmd_cmd);
     }
 }
 
@@ -5147,6 +5149,8 @@ ex_bmodified(eap)
     exarg_T	*eap;
 {
     goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
+    if (eap->do_ecmd_cmd != NULL)
+	do_cmdline_cmd(eap->do_ecmd_cmd);
 }
 
 /*
@@ -5158,6 +5162,8 @@ ex_bnext(eap)
     exarg_T	*eap;
 {
     goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
+    if (eap->do_ecmd_cmd != NULL)
+	do_cmdline_cmd(eap->do_ecmd_cmd);
 }
 
 /*
@@ -5171,6 +5177,8 @@ ex_bprevious(eap)
     exarg_T	*eap;
 {
     goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
+    if (eap->do_ecmd_cmd != NULL)
+	do_cmdline_cmd(eap->do_ecmd_cmd);
 }
 
 /*
@@ -5184,6 +5192,8 @@ ex_brewind(eap)
     exarg_T	*eap;
 {
     goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+    if (eap->do_ecmd_cmd != NULL)
+	do_cmdline_cmd(eap->do_ecmd_cmd);
 }
 
 /*
@@ -5195,6 +5205,8 @@ ex_blast(eap)
     exarg_T	*eap;
 {
     goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
+    if (eap->do_ecmd_cmd != NULL)
+	do_cmdline_cmd(eap->do_ecmd_cmd);
 }
 #endif
 
diff --git a/src/version.c b/src/version.c
index 83dfeaa36d..a6a10176df 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    450,
 /**/
     449,
 /**/

From 337097fd5b88f443820b6c5c54bd65a5ed579717 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 20:07:26 +0200
Subject: [PATCH 140/473] Added tag v7-4-450 for changeset 7c9abc70ffc1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a604f37fcc..e151e18706 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3172,3 +3172,4 @@ d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 0d2c821cdc2505879823a551baeeb8d3c61ce758 v7-4-447
 2fd96725b0632cd9183581ce13d7b2cbd734d8d4 v7-4-448
 cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449
+7c9abc70ffc187f9bb60d968cb7e3cc5ed6d4231 v7-4-450

From 2f3fdc6dce98e9291d54cef32bd16d35a32d6cd4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 20:45:23 +0200
Subject: [PATCH 141/473] updated for version 7.4.451 Problem:    Calling
 system() with empty input gives an error for writing the 	    temp file.
 Solution:   Do not try writing if the string length is zero. (Olaf Dabrunz)

---
 src/eval.c    | 5 ++++-
 src/version.c | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index 780d8834b0..8f62cb2e83 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -18638,13 +18638,16 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
 	}
 	else
 	{
+	    size_t len;
+
 	    p = get_tv_string_buf_chk(&argvars[1], buf);
 	    if (p == NULL)
 	    {
 		fclose(fd);
 		goto errret;		/* type error; errmsg already given */
 	    }
-	    if (fwrite(p, STRLEN(p), 1, fd) != 1)
+	    len = STRLEN(p);
+	    if (len > 0 && fwrite(p, len, 1, fd) != 1)
 		err = TRUE;
 	}
 	if (fclose(fd) != 0)
diff --git a/src/version.c b/src/version.c
index a6a10176df..fa2ced9bc4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    451,
 /**/
     450,
 /**/

From ba77ff6a4b16f360823d53fe057b7d9ae1874a41 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 20:45:24 +0200
Subject: [PATCH 142/473] Added tag v7-4-451 for changeset ac6cfdc02695

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e151e18706..5dd4ee4e09 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3173,3 +3173,4 @@ d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 2fd96725b0632cd9183581ce13d7b2cbd734d8d4 v7-4-448
 cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449
 7c9abc70ffc187f9bb60d968cb7e3cc5ed6d4231 v7-4-450
+ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451

From 1bd1cde401d3287b77427d25fd1a294c9d6e7ef9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 22:05:53 +0200
Subject: [PATCH 143/473] updated for version 7.4.452 Problem:    Can't build
 with tiny features. (Tony Mechelynck) Solution:   Use "return" instead of
 "break".

---
 src/ex_cmds.c | 4 ++--
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 4ae996c944..afc215459c 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5900,7 +5900,7 @@ ex_help(eap)
 }
 
 /*
- * ":helpclose": Close the help window
+ * ":helpclose": Close one help window
  */
     void
 ex_helpclose(eap)
@@ -5913,7 +5913,7 @@ ex_helpclose(eap)
 	if (win->w_buffer->b_help)
 	{
 	    win_close(win, FALSE);
-	    break;
+	    return;
 	}
     }
 }
diff --git a/src/version.c b/src/version.c
index fa2ced9bc4..902302e791 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    452,
 /**/
     451,
 /**/

From 53ce56725b5f0720819c7e5a205ff67b50a30c04 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 22:05:53 +0200
Subject: [PATCH 144/473] Added tag v7-4-452 for changeset 78aad99db762

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5dd4ee4e09..8c4ccb9b63 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3174,3 +3174,4 @@ d4cc9f48d5a40382e3e3d52dfe6e948745ee13b4 v7-4-444
 cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449
 7c9abc70ffc187f9bb60d968cb7e3cc5ed6d4231 v7-4-450
 ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451
+78aad99db7627a19574d10415780ded69936d7d7 v7-4-452

From 70a4f03973bc1459a82560384c78db0cf4ba6a3e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 22:23:26 +0200
Subject: [PATCH 145/473] updated for version 7.4.453 Problem:    Still can't
 build with tiny features. Solution:   Add #ifdef.

---
 src/ex_cmds.c | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index afc215459c..b8076fc37b 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5906,6 +5906,7 @@ ex_help(eap)
 ex_helpclose(eap)
     exarg_T	*eap UNUSED;
 {
+#if defined(FEAT_WINDOWS)
     win_T *win;
 
     FOR_ALL_WINDOWS(win)
@@ -5916,6 +5917,7 @@ ex_helpclose(eap)
 	    return;
 	}
     }
+#endif
 }
 
 #if defined(FEAT_MULTI_LANG) || defined(PROTO)
diff --git a/src/version.c b/src/version.c
index 902302e791..7727401dab 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    453,
 /**/
     452,
 /**/

From 8df49b4fb1667e7bc2940fe7e2e3a3b039b1ea6a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 22:23:27 +0200
Subject: [PATCH 146/473] Added tag v7-4-453 for changeset c72eb8499a9d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 8c4ccb9b63..3500f186a6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3175,3 +3175,4 @@ cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449
 7c9abc70ffc187f9bb60d968cb7e3cc5ed6d4231 v7-4-450
 ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451
 78aad99db7627a19574d10415780ded69936d7d7 v7-4-452
+c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453

From d30cf26f2756ec6c100beb83070bc23aa2c9e701 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 19 Sep 2014 22:38:48 +0200
Subject: [PATCH 147/473] Updated runtime files.

---
 runtime/autoload/phpcomplete.vim | 12 +++---
 runtime/doc/editing.txt          |  7 +++-
 runtime/doc/helphelp.txt         |  4 +-
 runtime/doc/index.txt            |  2 +-
 runtime/doc/spell.txt            |  2 +-
 runtime/doc/tags                 |  3 ++
 runtime/doc/todo.txt             | 58 +++++++++++----------------
 runtime/indent/ada.vim           |  2 +-
 runtime/indent/vim.vim           | 33 +++++++++-------
 runtime/spell/ro/main.aap        | 52 ++++++++++++++++--------
 runtime/spell/ro/ro_RO.diff      | 68 ++++++++++++++------------------
 runtime/syntax/php.vim           | 13 +++---
 runtime/syntax/sisu.vim          | 34 ++++++++++------
 13 files changed, 156 insertions(+), 134 deletions(-)

diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index c00e55cc1e..82ba894b2a 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
 " Maintainer:	Dávid Szabó ( complex857 AT gmail DOT com )
 " Previous Maintainer:	Mikolaj Machowski ( mikmach AT wp DOT pl )
 " URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change:  2014 Jul 24
+" Last Change:  2014 Aug 10
 "
 "	OPTIONS:
 "
@@ -94,9 +94,9 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
 		" Check if we are inside of PHP markup
 		let pos = getpos('.')
 		let phpbegin = searchpairpos('<?', '', '?>', 'bWn',
-				\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
+				\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
 		let phpend = searchpairpos('<?', '', '?>', 'Wn',
-				\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
+				\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
 
 		if phpbegin == [0,0] && phpend == [0,0]
 			" We are outside of any PHP markup. Complete HTML
@@ -803,7 +803,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
 			endif
 			let relative_name = namespace_part.tag.name
 			" match base without the namespace part for namespaced base but not namespaced tags, for tagfiles with old ctags
-			if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tag.name, base[len(namespace_part):]) == 0
+			if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tolower(tag.name), tolower(base[len(namespace_part):])) == 0
 				call add(no_namespace_matches, {'word': leading_slash.relative_name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
 			endif
 			if has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && tag.namespace ==? namespace_for_class
@@ -1607,6 +1607,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 				for arg in args
 					if arg =~# object.'\(,\|$\)'
 						let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
+						let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
 						break
 					endif
 				endfor
@@ -1625,6 +1626,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 					for param in docblock.params
 						if param.name =~? object
 							let classname_candidate = matchstr(param.type, class_name_pattern.'\(\[\]\)\?')
+							let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
 							break
 						endif
 					endfor
@@ -1934,7 +1936,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
 	call search('{')
 	let endline = line('.')
 
-	let content = join(getline(cfline, endline),"\n")
+	let content = join(getline(cfline, endline), "\n")
 	" Catch extends
 	if content =~? 'extends'
 		let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index cbb9b90e5f..3ef8f05bc6 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Aug 09
+*editing.txt*   For Vim version 7.4.  Last change: 2014 Sep 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -609,7 +609,10 @@ list of the current window.
 			{not in Vi}
 
 :[count]arga[dd] {name} ..			*:arga* *:argadd* *E479*
-			Add the {name}s to the argument list.
+:[count]arga[dd]
+			Add the {name}s to the argument list.  When {name} is
+			omitted at the current buffer name to the argument
+			list.
 			If [count] is omitted, the {name}s are added just
 			after the current entry in the argument list.
 			Otherwise they are added after the [count]'th file.
diff --git a/runtime/doc/helphelp.txt b/runtime/doc/helphelp.txt
index e7d281a915..4ef436c5dc 100644
--- a/runtime/doc/helphelp.txt
+++ b/runtime/doc/helphelp.txt
@@ -1,4 +1,4 @@
-*helphelp.txt*	For Vim version 7.4.  Last change: 2012 Nov 28
+*helphelp.txt*	For Vim version 7.4.  Last change: 2014 Sep 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -97,7 +97,7 @@ Help on help files					*helphelp*
 			current file.  See |help-translated|.
 
 						 	*:helpc* *:helpclose*
-:helpc[lose]            Close one help window.
+:helpc[lose]            Close one help window, if there is one.
 
 							*:helpg* *:helpgrep*
 :helpg[rep] {pattern}[@xx]
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index d16ad9a407..908b58680e 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt*     For Vim version 7.4.  Last change: 2014 Mar 25
+*index.txt*     For Vim version 7.4.  Last change: 2014 Sep 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/spell.txt b/runtime/doc/spell.txt
index e1cc6a593c..5a802a29ff 100644
--- a/runtime/doc/spell.txt
+++ b/runtime/doc/spell.txt
@@ -1,4 +1,4 @@
-*spell.txt*	For Vim version 7.4.  Last change: 2014 Jul 02
+*spell.txt*	For Vim version 7.4.  Last change: 2014 Sep 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
diff --git a/runtime/doc/tags b/runtime/doc/tags
index a8047a68e4..144b76038b 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2248,6 +2248,8 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 :ha	print.txt	/*:ha*
 :hardcopy	print.txt	/*:hardcopy*
 :help	helphelp.txt	/*:help*
+:helpc	helphelp.txt	/*:helpc*
+:helpclose	helphelp.txt	/*:helpclose*
 :helpf	helphelp.txt	/*:helpf*
 :helpfind	helphelp.txt	/*:helpfind*
 :helpg	helphelp.txt	/*:helpg*
@@ -7825,6 +7827,7 @@ spell-FLAG	spell.txt	/*spell-FLAG*
 spell-FOL	spell.txt	/*spell-FOL*
 spell-FORBIDDENWORD	spell.txt	/*spell-FORBIDDENWORD*
 spell-HOME	spell.txt	/*spell-HOME*
+spell-IGNOREEXTRA	spell.txt	/*spell-IGNOREEXTRA*
 spell-KEEPCASE	spell.txt	/*spell-KEEPCASE*
 spell-KEY	spell.txt	/*spell-KEY*
 spell-LANG	spell.txt	/*spell-LANG*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 3dffe92e6d..ca957e360d 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Sep 09
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Sep 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -61,42 +61,11 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13)
-Still produces errors.
-Add flag to ignore fifth argument of SFX.
-Conversion from utf-8 to cp1250 can't be without errors.
-
-Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show
-up. (Paul Moore, 2014 Jul 30)
-Should it depend on the Windows version?  Waiting for feedback.
-No longer needed after including DirectX patch?
-Related to issue 255?
-
-Problem with linebreak, adds a test that fails. (Nazri Ramliy, 2014 Sep 6)
-
 Patch to avoid problems with encoding conversion with diff.vim.
 (Yasuhiro Matsumoto, 2014 Sep 1.
+Depends on current language, language of file can be different.
 
-Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
-14, Aug 30)
-    Make ":1close" close the first window.
-    Make ":+1close" close the next window.
-    Make ":-1close" close the previous window.
-Can't easily close the help window, like ":pc" closes the preview window and
-":ccl" closes the quickfix window.  Add ":hclose". (Chris Gaal)
-Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
-
-Patch to fix line formatting bug. (Christian Brabandt, 2014 Sep 7)
-
-Patch to fix ml_get error. (Christian Brabandt, 2014 Sep 7)
-
-Patch by Marcin Szamotulski to add +cmd to buffer commands.
-(2014 Aug 18)
-
-Patch to fix encoding of arguments when setting 'encoding'. (Yasuhiro
-Matsumoto, 2014 Sep 4)
-
-Patch to fix that system() with empty input fails. (Olaf Dabrunz, 2014 Aug 19)
+Patch for C/C++ syntax string handling. (Brian Bi, 2014 Sep 13)
 
 When using a visual selection of multiple words and doing CTRL-W_] it jumps to
 the tag matching the word under the cursor, not the selected text.
@@ -105,6 +74,9 @@ Patch by Christian, 2014 Aug 8.
 
 Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
 
+'backupcopy' should be global-local, so that some files can be written in a
+different way.  Patch by Christian, 2014 Sep 17.
+
 Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
 Prefer the second solution.
 
@@ -113,6 +85,13 @@ Issue 252.  Patch by Christian, 2014 Aug 26.
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
+Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
+14, Aug 30)
+    Make ":1close" close the first window.
+    Make ":+1close" close the next window.
+    Make ":-1close" close the previous window.
+Doesn't look right, asked for updates.
+
 Patch to add a special key name for K_CURSORHOLD. (Hirohito Higashi, 2014 Aug
 10)
 
@@ -129,6 +108,9 @@ inconsistent with the documentation.
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
 
+ml_updatechunk() is slow when retrying for another encoding. (John Little,
+2014 Sep 11)
+
 Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 
 Patch to allow for a different icon on MS-Windows. (Yasuhiro Matsumoto, 2014
@@ -136,11 +118,16 @@ Sep 7).
 
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
+Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
+
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
 Jun 8)
 
 No error for missing endwhile. (ZyX, 2014 Mar 20)
 
+start_global_changes() plus end_global_changes() causes problem for
+clip_unnamed_plus. (Jason Pleau, 2014 Sep 12)
+
 Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
 
 PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19)
@@ -238,7 +225,8 @@ Patch to support sorting on floating point number.  (Alex Jakushev, 2010 Oct
 
 Patch to support expression argument to sort() instead of a function name.
 Yasuhiro Matsumoto, 2013 May 31.
-Or should we add a more general mechanism, like lambda functions?
+Or should we add a more general mechanism, like a lambda() function?
+Patch by Yasuhiro Matsumoto, 2014 Sep 16.
 
 VMS: Select() doesn't work properly, typing ESC may hang Vim.  Use sys$qiow
 instead. (Samuel Ferencik, 2013 Sep 28)
diff --git a/runtime/indent/ada.vim b/runtime/indent/ada.vim
index 03fbaa3a18..5019f0b736 100644
--- a/runtime/indent/ada.vim
+++ b/runtime/indent/ada.vim
@@ -148,7 +148,7 @@ function s:StatementIndent( current_indent, prev_lnum )
       " Get previous non-blank/non-comment-only line
       while 1
 	 let line = substitute( getline(lnum), g:ada#Comment, '', '' )
-	 
+
 	 if line !~ '^\s*$' && line !~ '^\s*#'
 	    break
 	 endif
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim
index 8c215733b3..ff4af027b4 100644
--- a/runtime/indent/vim.vim
+++ b/runtime/indent/vim.vim
@@ -1,7 +1,7 @@
 " Vim indent file
 " Language:	Vim script
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2012 Aug 02
+" Last Change:	2014 Sep 19
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -37,7 +37,8 @@ function GetVimIndentIntern()
 
   " If the current line doesn't start with '\' and below a line that starts
   " with '\', use the indent of the line above it.
-  if getline(v:lnum) !~ '^\s*\\'
+  let cur_text = getline(v:lnum)
+  if cur_text !~ '^\s*\\'
     while lnum > 0 && getline(lnum) =~ '^\s*\\'
       let lnum = lnum - 1
     endwhile
@@ -47,27 +48,30 @@ function GetVimIndentIntern()
   if lnum == 0
     return 0
   endif
+  let prev_text = getline(lnum)
 
   " Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
   " and :else.  Add it three times for a line that starts with '\' after
   " a line that doesn't (or g:vim_indent_cont if it exists).
   let ind = indent(lnum)
-  if getline(v:lnum) =~ '^\s*\\' && v:lnum > 1 && getline(lnum) !~ '^\s*\\'
+  if cur_text =~ '^\s*\\' && v:lnum > 1 && prev_text !~ '^\s*\\'
     if exists("g:vim_indent_cont")
       let ind = ind + g:vim_indent_cont
     else
       let ind = ind + &sw * 3
     endif
-  elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END'
+  elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END'
     let ind = ind + &sw
   else
-    let line = getline(lnum)
-    let i = match(line, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
-    if i >= 0
-      let ind += &sw
-      if strpart(line, i, 1) == '|' && has('syntax_items')
-            \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
-        let ind -= &sw
+    " A line starting with :au does not increment/decrement indent.
+    if prev_text !~ '^\s*au\%[tocmd]'
+      let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
+      if i >= 0
+	let ind += &sw
+	if strpart(prev_text, i, 1) == '|' && has('syntax_items')
+	      \ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
+	  let ind -= &sw
+	endif
       endif
     endif
   endif
@@ -75,9 +79,8 @@ function GetVimIndentIntern()
   " If the previous line contains an "end" after a pipe, but not in an ":au"
   " command.  And not when there is a backslash before the pipe.
   " And when syntax HL is enabled avoid a match inside a string.
-  let line = getline(lnum)
-  let i = match(line, '[^\\]|\s*\(ene\@!\)')
-  if i > 0 && line !~ '^\s*au\%[tocmd]'
+  let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
+  if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
     if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
       let ind = ind - &sw
     endif
@@ -86,7 +89,7 @@ function GetVimIndentIntern()
 
   " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
   " :endfun, :else and :augroup END.
-  if getline(v:lnum) =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
+  if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
     let ind = ind - &sw
   endif
 
diff --git a/runtime/spell/ro/main.aap b/runtime/spell/ro/main.aap
index c07e2712cf..8f2379dc32 100644
--- a/runtime/spell/ro/main.aap
+++ b/runtime/spell/ro/main.aap
@@ -9,35 +9,43 @@
 SPELLDIR = ..
 FILES    = ro_RO.aff ro_RO.dic
 
-all: $SPELLDIR/ro.iso-8859-2.spl $SPELLDIR/ro.utf-8.spl \
-        $SPELLDIR/ro.cp1250.spl ../README_ro.txt
-
-$SPELLDIR/ro.iso-8859-2.spl : $FILES
-        :sys env LANG=ro_RO.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+all: $SPELLDIR/ro.utf-8.spl \
+        $SPELLDIR/ro.iso-8859-2.spl \
+        $SPELLDIR/ro.cp1250.spl \
+        ../README_ro.txt
 
 $SPELLDIR/ro.utf-8.spl : $FILES
-        :sys env LANG=ro_RO.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+        :sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
 
+# Note: this generates conversion errors, because not all characters can be
+# represented in iso-8859-2.
+$SPELLDIR/ro.iso-8859-2.spl : $FILES
+        :sys env LANG=ro_RO.iso88592 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
+
+# Note: this generates conversion errors, because not all characters can be
+# represented in cp1250.
 $SPELLDIR/ro.cp1250.spl : $FILES
         :sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
 
-../README_ro.txt: README_ro_RO.txt
+../README_ro.txt: README
         :copy $source $target
 
 #
 # Fetching the files from OpenOffice.org.
 #
-OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
-:attr {fetch = $OODIR/%file%} ro_RO.zip
+#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
+OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
+ZIPFILE = ro_RO.3.3.10.zip
+:attr {fetch = $OODIR/%file%} $ZIPFILE
 
 # The files don't depend on the .zip file so that we can delete it.
 # Only download the zip file if the targets don't exist.
 # This is a bit tricky, since the file name includes the date.
 ro_RO.aff ro_RO.dic: {buildcheck=}
         :assertpkg unzip patch
-        :fetch ro_RO.zip
-        :sys $UNZIP ro_RO.zip
-        :delete ro_RO.zip
+        :fetch $ZIPFILE
+        :sys $UNZIP $ZIPFILE
+        :delete $ZIPFILE
         @if not os.path.exists('ro_RO.orig.aff'):
             :copy ro_RO.aff ro_RO.orig.aff
         @if not os.path.exists('ro_RO.orig.dic'):
@@ -60,12 +68,12 @@ diff:
 
 check:
         :assertpkg unzip diff
-        :fetch ro_RO.zip
+        :fetch $ZIPFILE
         :mkdir tmp
         :cd tmp
         @try:
             @import stat
-            :sys $UNZIP ../ro_RO.zip
+            :sys $UNZIP ../$ZIPFILE
             :sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
             @if os.stat('d')[stat.ST_SIZE] > 0:
                 :copy ro_RO.aff ../ro_RO.new.aff
@@ -75,7 +83,19 @@ check:
         @finally:
             :cd ..
             :delete {r}{f}{q} tmp
-            :delete ro_RO.zip
-
+            :delete $ZIPFILE
+
+# Remove all the downloaded and generated files.
+clean:
+        :delete ro_RO.aff
+        :delete ro_RO.dic
+        :delete ro_RO.orig.aff
+        :delete ro_RO.orig.dic
+        :delete ro_RO-ante1993.aff
+        :delete ro_RO-ante1993.dic
+        :delete COPYING.GPL
+        :delete COPYING.LGPL
+        :delete COPYING.MPL
+        :delete README
 
 # vim: set sts=4 sw=4 :
diff --git a/runtime/spell/ro/ro_RO.diff b/runtime/spell/ro/ro_RO.diff
index 5477030ab4..2c18228720 100644
--- a/runtime/spell/ro/ro_RO.diff
+++ b/runtime/spell/ro/ro_RO.diff
@@ -1,42 +1,34 @@
-*** ro_RO.orig.aff	Wed Aug 31 20:34:38 2005
---- ro_RO.aff	Wed Aug 31 20:39:57 2005
+*** ro_RO.orig.aff	2014-08-29 16:29:21.162457824 +0200
+--- ro_RO.aff	2014-09-19 15:29:52.354413307 +0200
 ***************
-*** 3,4 ****
---- 3,8 ----
+*** 3,5 ****
+  TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
+! KEY qwertyuiop|asdfghjkl|zxcvbnm
   
-+ FOL �����������������������������������������������������������
-+ LOW �����������������������������������������������������������
-+ UPP �����������������������������������������������������������
-+ 
-  PFX E Y 1
-***************
-*** 12,15 ****
-  SFX L   0          l          u
-! SFX L   0          le         [^cg] i
-! SFX L   0          i          [cg] i
-  SFX L   0          le         e
---- 16,19 ----
-  SFX L   0          l          u
-! SFX L   0          le         [^cg]i
-! SFX L   0          i          [cg]i
-  SFX L   0          le         e
-***************
-*** 18,20 ****
-  SFX U   0          a          re
-! SFX U   0          i          [^i] ii
-  
---- 22,24 ----
-  SFX U   0          a          re
-! SFX U   0          i          [^i]ii
+--- 3,9 ----
+  TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
+! # KEY qwertyuiop|asdfghjkl|zxcvbnm
+! 
+! # ignore extra field (specifies type of word?)
+! IGNOREEXTRA
+! 
   
 ***************
-*** 38,41 ****
-  SFX I   0          ului       [^ua]
-! SFX I   a          ii         [gc] a
-! SFX I   a          ei         [^cg] a
-  
---- 42,45 ----
-  SFX I   0          ului       [^ua]
-! SFX I   a          ii         [gc]a
-! SFX I   a          ei         [^cg]a
-  
+*** 1546,1553 ****
+  SFX q   0     ilor    .      adj. m. pl. dat.
+! SFX q   0    ă
+! SFX q   0    a
+! SFX q   0    ei
+! SFX q   0    e
+! SFX q   0    ele
+! SFX q   0    elor
+  PFX q Y 1
+--- 1550,1557 ----
+  SFX q   0     ilor    .      adj. m. pl. dat.
+! SFX q   0    ă        .
+! SFX q   0    a        .
+! SFX q   0    ei       .
+! SFX q   0    e        .
+! SFX q   0    ele      .
+! SFX q   0    elor     .
+  PFX q Y 1
diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim
index f27d923400..5ec5d5a393 100644
--- a/runtime/syntax/php.vim
+++ b/runtime/syntax/php.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language: php PHP 3/4/5
 " Maintainer: Jason Woofenden <jason@jasonwoof.com>
-" Last Change: Aug 28, 2013
+" Last Change: Sep 18, 2014
 " URL: https://gitorious.org/jasonwoof/vim-syntax/blobs/master/php.vim
 " Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
 "         Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@@ -123,7 +123,11 @@ syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTO
 syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION  contained
 
 " Constants
-syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL  contained
+syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END contained
+
+" Predefined constants
+" Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u
+syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained
 
 syn case ignore
 
@@ -502,11 +506,6 @@ syn keyword phpStructure trait
 " Some of these changes (highlighting isset/unset/echo etc) are not so
 " critical, but they make things more colourful. :-)
 
-" highlight constant E_STRICT
-syntax case match
-syntax keyword phpCoreConstant E_STRICT contained
-syntax case ignore
-
 " different syntax highlighting for 'echo', 'print', 'switch', 'die' and 'list' keywords
 " to better indicate what they are.
 syntax keyword phpDefine echo print contained
diff --git a/runtime/syntax/sisu.vim b/runtime/syntax/sisu.vim
index 23d73254eb..0e0f2dbe0a 100644
--- a/runtime/syntax/sisu.vim
+++ b/runtime/syntax/sisu.vim
@@ -1,8 +1,9 @@
 " SiSU Vim syntax file
-" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
-" SiSU Markup:     SiSU (sisu-4.0.9)
-" Last Change:     2013-02-22
-" URL (sisu-4.1.0): <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
+" SiSU Maintainer: Ralph Amissah <ralph.amissah@gmail.com>
+" SiSU Markup:     SiSU (sisu-5.6.7)
+" Last Change:     2014-09-14
+" URL: <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
+"      <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob_plain;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
 "(originally looked at Ruby Vim by Mirko Nasato)
 
 if version < 600
@@ -23,15 +24,14 @@ if !exists("sisu_no_identifiers")
   syn match   sisu_break               contains=@NoSpell                  " \\\\\( \|$\)\|<br>\|<br />"
   syn match   sisu_control             contains=@NoSpell                  "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$"
   syn match   sisu_control             contains=@NoSpell                  "^<:\(bo\|---\)>\s*$"
+  syn match   sisu_marktail            contains=@NoSpell                  "^--[+~-]#\s*$"
   syn match   sisu_marktail                                               "[~-]#"
   syn match   sisu_control                                                "\""
   syn match   sisu_underline                                              "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
   syn match   sisu_number              contains=@NoSpell                  "[0-9a-f]\{32\}\|[0-9a-f]\{64\}"
   syn match   sisu_link                contains=@NoSpell                  "\(_\?https\?://\|\.\.\/\)\S\+"
   syn match   sisu_link                                                   " \*\~\S\+"
-  syn match   sisu_action                                                 "^<:insert\d\+>"
-  syn match   sisu_require             contains=@NoSpell                  "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
-  syn match   sisu_require             contains=@NoSpell                  "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
+  syn match   sisu_require             contains=@NoSpell                  "^<<\s*[a-zA-Z0-9^./_-]\+\.ss[it]$"
   syn match   sisu_structure                                              "^:A\~$"
 
 "% "Document Sub Headers:
@@ -44,6 +44,8 @@ if !exists("sisu_no_identifiers")
   syn match   sisu_sub_header_original                                    "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s"
   syn match   sisu_sub_header_make                                        "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s"
   syn match   sisu_sub_header_notes                                       "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s"
+  syn match   sisu_within_index_ignore                                    "\S\+[:;]\(\s\+\|$\)"
+  syn match   sisu_within_index                                           "[:|;]\|+\d\+"
 
 "% "semantic markers: (ignore)
   syn match   sisu_sem_marker                                             ";{\|};[a-z._]*[a-z]"
@@ -93,17 +95,25 @@ syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_
 syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
 
 "% "Headings:
-syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
+syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-4]\|:\?[A-D]\)\~\(\S\+\|[^-]\)" end="$"
 
 "% "Block Group Text:
 " table
 syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
 " table
+syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+table" end="^```\(\s\|$\)"
 syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
 " block, group, poem, alt
-syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\(block\|group\|poem\|alt\)"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\1"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\(block\|group\|poem\|alt\)" end="^```\(\s\|$\)"
+" box
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^box\(\.[a-z]\+\)\?{" end="^}box"
+syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\box\(\.[a-z]\+\)\?" end="^```\(\s\|$\)"
 " code
-syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
+syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^code\(\.[a-z][0-9a-z_]\+\)\?{" end="^}code"
+syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^```\s\+code\(\.[a-z][0-9a-z_]\+\)\?" end="^```\(\s\|$\)"
+" quote
+syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_contain start="^```\s\+quote" end="^```\(\s\|$\)"
 
 "% "Endnotes:
 " regular endnote or asterisk or plus sign endnote
@@ -138,7 +148,7 @@ syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endn
 "% "Font Face Curly Brackets:
 "syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline
 " book index:
-syn region sisu_index matchgroup=sisu_index_block start="^={" end="}"
+syn region sisu_index contains=sisu_within_index_ignore,sisu_within_index matchgroup=sisu_index_block start="^={" end="}"
 " emphasis:
 syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
 " bold:
@@ -246,6 +256,8 @@ hi def link sisu_index                 SpecialKey
 hi def link sisu_index_block           Visual
 hi def link sisu_content_endnote       Special
 hi def link sisu_control               Delimiter
+hi def link sisu_within_index          Delimiter
+hi def link sisu_within_index_ignore   SpecialKey
 hi def link sisu_ocn                   Include
 hi def link sisu_number                Number
 hi def link sisu_identifier            Function

From 48ee0f351ed55af1e2aeb2bd7a2044692a334cd7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 13:48:43 +0200
Subject: [PATCH 148/473] updated for version 7.4.454 Problem:    When using a
 Visual selection of multiple words and doing CTRL-W_] 	    it jumps to the
 tag matching the word under the cursor, not the 	    selected text. 
 (Patrick hemmer) Solution:   Do not reset Visual mode. (idea by Christian
 Brabandt)

---
 src/version.c | 2 ++
 src/window.c  | 9 +++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/version.c b/src/version.c
index 7727401dab..1069c0b01a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    454,
 /**/
     453,
 /**/
diff --git a/src/window.c b/src/window.c
index 0088e32648..4bc2e6c412 100644
--- a/src/window.c
+++ b/src/window.c
@@ -479,14 +479,15 @@ do_window(nchar, Prenum, xchar)
     case ']':
     case Ctrl_RSB:
 		CHECK_CMDWIN
-		reset_VIsual_and_resel();	/* stop Visual mode */
+		/* keep Visual mode, can select words to use as a tag */
 		if (Prenum)
 		    postponed_split = Prenum;
 		else
 		    postponed_split = -1;
+		g_do_tagpreview = 0;
 
-		/* Execute the command right here, required when
-		 * "wincmd ]" was used in a function. */
+		/* Execute the command right here, required when "wincmd ]"
+		 * was used in a function. */
 		do_nv_ident(Ctrl_RSB, NUL);
 		break;
 
@@ -590,7 +591,7 @@ do_window(nchar, Prenum, xchar)
 #endif
 		    case ']':
 		    case Ctrl_RSB:
-			reset_VIsual_and_resel();	/* stop Visual mode */
+			/* keep Visual mode, can select words to use as a tag */
 			if (Prenum)
 			    postponed_split = Prenum;
 			else

From 7484bdbc6e7576584c7ae734c2ebd159dc435c16 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 13:48:43 +0200
Subject: [PATCH 149/473] Added tag v7-4-454 for changeset 0cdff7c26855

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3500f186a6..d5a7ae9255 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3176,3 +3176,4 @@ cb5480096f1b9e8f44e9d742fa190a90d77e1c54 v7-4-449
 ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451
 78aad99db7627a19574d10415780ded69936d7d7 v7-4-452
 c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453
+0cdff7c268559f8f34eae073a013ece71b62b9e3 v7-4-454

From 5a4b1fdcfd84c88a5c2c6100f1f55498bc170003 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 14:24:40 +0200
Subject: [PATCH 150/473] updated for version 7.4.455 Problem:    Completion
 for :buf does not use 'wildignorecase'. (Akshay H) Solution:   Pass the
 'wildignorecase' flag around.

---
 src/buffer.c  | 21 ++++++++++++---------
 src/version.c |  2 ++
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 5a9f8a786c..4fc50321ce 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,9 +28,9 @@
 #include "vim.h"
 
 #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
-static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf));
+static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
 # define HAVE_BUFLIST_MATCH
-static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name));
+static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
 #endif
 static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
 static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
@@ -2282,7 +2282,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
 #ifdef FEAT_DIFF
 			    && (!diffmode || diff_mode_buf(buf))
 #endif
-			    && buflist_match(prog, buf) != NULL)
+			    && buflist_match(prog, buf, FALSE) != NULL)
 		    {
 			if (curtab_only)
 			{
@@ -2396,7 +2396,7 @@ ExpandBufnames(pat, num_file, file, options)
 	    {
 		if (!buf->b_p_bl)	/* skip unlisted buffers */
 		    continue;
-		p = buflist_match(prog, buf);
+		p = buflist_match(prog, buf, p_wic);
 		if (p != NULL)
 		{
 		    if (round == 1)
@@ -2444,16 +2444,17 @@ ExpandBufnames(pat, num_file, file, options)
  * Check for a match on the file name for buffer "buf" with regprog "prog".
  */
     static char_u *
-buflist_match(prog, buf)
+buflist_match(prog, buf, ignore_case)
     regprog_T	*prog;
     buf_T	*buf;
+    int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match;
 
     /* First try the short file name, then the long file name. */
-    match = fname_match(prog, buf->b_sfname);
+    match = fname_match(prog, buf->b_sfname, ignore_case);
     if (match == NULL)
-	match = fname_match(prog, buf->b_ffname);
+	match = fname_match(prog, buf->b_ffname, ignore_case);
 
     return match;
 }
@@ -2463,9 +2464,10 @@ buflist_match(prog, buf)
  * Return "name" when there is a match, NULL when not.
  */
     static char_u *
-fname_match(prog, name)
+fname_match(prog, name, ignore_case)
     regprog_T	*prog;
     char_u	*name;
+    int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match = NULL;
     char_u	*p;
@@ -2474,7 +2476,8 @@ fname_match(prog, name)
     if (name != NULL)
     {
 	regmatch.regprog = prog;
-	regmatch.rm_ic = p_fic;	/* ignore case when 'fileignorecase' is set */
+	/* Ignore case when 'fileignorecase' or the argument is set. */
+	regmatch.rm_ic = p_fic || ignore_case;
 	if (vim_regexec(&regmatch, name, (colnr_T)0))
 	    match = name;
 	else
diff --git a/src/version.c b/src/version.c
index 1069c0b01a..9083083d1e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    455,
 /**/
     454,
 /**/

From 5701c510722225bcfa9116b959b42a14faf62345 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 14:24:41 +0200
Subject: [PATCH 151/473] Added tag v7-4-455 for changeset ebc72764fa1e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d5a7ae9255..6e301b633c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3177,3 +3177,4 @@ ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451
 78aad99db7627a19574d10415780ded69936d7d7 v7-4-452
 c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453
 0cdff7c268559f8f34eae073a013ece71b62b9e3 v7-4-454
+ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455

From a4c4bea38e225e45c9da46889e234ff45c743b51 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 15:45:08 +0200
Subject: [PATCH 152/473] updated for version 7.4.456 Problem:    'backupcopy'
 is global, cannot write only some files in a 	    different way. Solution:  
 Make 'backupcopy' global-local. (Christian Brabandt)

---
 runtime/doc/options.txt |  2 +-
 src/buffer.c            |  1 +
 src/fileio.c            | 15 ++++++------
 src/option.c            | 53 ++++++++++++++++++++++++++++++++---------
 src/option.h            |  5 +++-
 src/proto/option.pro    |  1 +
 src/structs.h           |  4 +++-
 src/version.c           |  2 ++
 8 files changed, 62 insertions(+), 21 deletions(-)

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 291ab833ee..790e66c7b4 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -921,7 +921,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 						*'backupcopy'* *'bkc'*
 'backupcopy' 'bkc'	string	(Vi default for Unix: "yes", otherwise: "auto")
-			global
+			global or local to buffer |global-local|
 			{not in Vi}
 	When writing a file and a backup is made, this option tells how it's
 	done.  This is a comma separated list of words.
diff --git a/src/buffer.c b/src/buffer.c
index 4fc50321ce..9eb67164e9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2001,6 +2001,7 @@ free_buf_options(buf, free_p_ff)
 #ifdef FEAT_LISP
     clear_string_option(&buf->b_p_lw);
 #endif
+    clear_string_option(&buf->b_p_bkc);
 }
 
 /*
diff --git a/src/fileio.c b/src/fileio.c
index b9221ed400..c7e846b82a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3149,6 +3149,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
     int		    write_undo_file = FALSE;
     context_sha256_T sha_ctx;
 #endif
+    unsigned int    bkc = get_bkc_value(buf);
 
     if (fname == NULL || *fname == NUL)	/* safety check */
 	return FAIL;
@@ -3647,10 +3648,10 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	struct stat st;
 #endif
 
-	if ((bkc_flags & BKC_YES) || append)	/* "yes" */
+	if ((bkc & BKC_YES) || append)	/* "yes" */
 	    backup_copy = TRUE;
 #if defined(UNIX) || defined(WIN32)
-	else if ((bkc_flags & BKC_AUTO))	/* "auto" */
+	else if ((bkc & BKC_AUTO))	/* "auto" */
 	{
 	    int		i;
 
@@ -3738,7 +3739,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	/*
 	 * Break symlinks and/or hardlinks if we've been asked to.
 	 */
-	if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK))
+	if ((bkc & BKC_BREAKSYMLINK) || (bkc & BKC_BREAKHARDLINK))
 	{
 # ifdef UNIX
 	    int	lstat_res;
@@ -3746,24 +3747,24 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	    lstat_res = mch_lstat((char *)fname, &st);
 
 	    /* Symlinks. */
-	    if ((bkc_flags & BKC_BREAKSYMLINK)
+	    if ((bkc & BKC_BREAKSYMLINK)
 		    && lstat_res == 0
 		    && st.st_ino != st_old.st_ino)
 		backup_copy = FALSE;
 
 	    /* Hardlinks. */
-	    if ((bkc_flags & BKC_BREAKHARDLINK)
+	    if ((bkc & BKC_BREAKHARDLINK)
 		    && st_old.st_nlink > 1
 		    && (lstat_res != 0 || st.st_ino == st_old.st_ino))
 		backup_copy = FALSE;
 # else
 #  if defined(WIN32)
 	    /* Symlinks. */
-	    if ((bkc_flags & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
+	    if ((bkc & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
 		backup_copy = FALSE;
 
 	    /* Hardlinks. */
-	    if ((bkc_flags & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
+	    if ((bkc & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
 		backup_copy = FALSE;
 #  endif
 # endif
diff --git a/src/option.c b/src/option.c
index 2007dee7db..af9fb506fc 100644
--- a/src/option.c
+++ b/src/option.c
@@ -56,6 +56,7 @@
  */
 #define PV_AI		OPT_BUF(BV_AI)
 #define PV_AR		OPT_BOTH(OPT_BUF(BV_AR))
+#define PV_BKC		OPT_BOTH(OPT_BUF(BV_BKC))
 #ifdef FEAT_QUICKFIX
 # define PV_BH		OPT_BUF(BV_BH)
 # define PV_BT		OPT_BUF(BV_BT)
@@ -582,7 +583,7 @@ static struct vimoption
 			    (char_u *)&p_bk, PV_NONE,
 			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     {"backupcopy",  "bkc",  P_STRING|P_VIM|P_COMMA|P_NODUP,
-			    (char_u *)&p_bkc, PV_NONE,
+			    (char_u *)&p_bkc, PV_BKC,
 #ifdef UNIX
 			    {(char_u *)"yes", (char_u *)"auto"}
 #else
@@ -5412,6 +5413,7 @@ check_buf_options(buf)
 #ifdef FEAT_LISP
     check_string_option(&buf->b_p_lw);
 #endif
+    check_string_option(&buf->b_p_bkc);
 }
 
 /*
@@ -5729,16 +5731,25 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
     }
 
     /* 'backupcopy' */
-    else if (varp == &p_bkc)
+    else if (gvarp == &p_bkc)
     {
-	if (opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE) != OK)
+	char_u		*bkc = p_bkc;
+	unsigned int	*flags = &bkc_flags;
+
+	if (opt_flags & OPT_LOCAL)
+	{
+	    bkc = curbuf->b_p_bkc;
+	    flags = &curbuf->b_bkc_flags;
+	}
+
+	if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
 	    errmsg = e_invarg;
-	if (((bkc_flags & BKC_AUTO) != 0)
-		+ ((bkc_flags & BKC_YES) != 0)
-		+ ((bkc_flags & BKC_NO) != 0) != 1)
+	if ((((int)*flags & BKC_AUTO) != 0)
+		+ (((int)*flags & BKC_YES) != 0)
+		+ (((int)*flags & BKC_NO) != 0) != 1)
 	{
 	    /* Must have exactly one of "auto", "yes"  and "no". */
-	    (void)opt_strings_flags(oldval, p_bkc_values, &bkc_flags, TRUE);
+	    (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
 	    errmsg = e_invarg;
 	}
     }
@@ -9025,12 +9036,13 @@ get_option_value_strict(name, numval, stringval, opt_type, from)
 }
 
 /*
- * Iterate over options. First argument is a pointer to a pointer to a structure 
- * inside options[] array, second is option type like in the above function.
+ * Iterate over options. First argument is a pointer to a pointer to a
+ * structure inside options[] array, second is option type like in the above
+ * function.
  *
- * If first argument points to NULL it is assumed that iteration just started 
+ * If first argument points to NULL it is assumed that iteration just started
  * and caller needs the very first value.
- * If first argument points to the end marker function returns NULL and sets 
+ * If first argument points to the end marker function returns NULL and sets
  * first argument to NULL.
  *
  * Returns full option name for current option on each call.
@@ -9856,6 +9868,10 @@ unset_global_local_option(name, from)
 	case PV_AR:
 	    buf->b_p_ar = -1;
 	    break;
+	case PV_BKC:
+	    clear_string_option(&buf->b_p_bkc);
+	    buf->b_bkc_flags = 0;
+	    break;
 	case PV_TAGS:
 	    clear_string_option(&buf->b_p_tags);
 	    break;
@@ -9961,6 +9977,7 @@ get_varp_scope(p, opt_flags)
 #ifdef FEAT_LISP
 	    case PV_LW:   return (char_u *)&(curbuf->b_p_lw);
 #endif
+	    case PV_BKC:  return (char_u *)&(curbuf->b_p_bkc);
 	}
 	return NULL; /* "cannot happen" */
     }
@@ -9993,6 +10010,8 @@ get_varp(p)
 				    ? (char_u *)&(curbuf->b_p_ar) : p->var;
 	case PV_TAGS:	return *curbuf->b_p_tags != NUL
 				    ? (char_u *)&(curbuf->b_p_tags) : p->var;
+	case PV_BKC:	return *curbuf->b_p_bkc != NUL
+				    ? (char_u *)&(curbuf->b_p_bkc) : p->var;
 #ifdef FEAT_FIND_ID
 	case PV_DEF:	return *curbuf->b_p_def != NUL
 				    ? (char_u *)&(curbuf->b_p_def) : p->var;
@@ -10585,6 +10604,8 @@ buf_copy_options(buf, flags)
 	     * are not copied, start using the global value */
 	    buf->b_p_ar = -1;
 	    buf->b_p_ul = NO_LOCAL_UNDOLEVEL;
+	    buf->b_p_bkc = empty_option;
+	    buf->b_bkc_flags = 0;
 #ifdef FEAT_QUICKFIX
 	    buf->b_p_gp = empty_option;
 	    buf->b_p_mp = empty_option;
@@ -12052,3 +12073,13 @@ briopt_check(wp)
     return OK;
 }
 #endif
+
+/*
+ * Get the local or global value of 'backupcopy'.
+ */
+    unsigned int
+get_bkc_value(buf)
+    buf_T *buf;
+{
+    return buf->b_bkc_flags ? buf->b_bkc_flags : bkc_flags;
+}
diff --git a/src/option.h b/src/option.h
index 696d70d6a2..23cdecdf01 100644
--- a/src/option.h
+++ b/src/option.h
@@ -327,7 +327,7 @@ EXTERN char_u	*p_bs;		/* 'backspace' */
 EXTERN char_u	*p_bg;		/* 'background' */
 EXTERN int	p_bk;		/* 'backup' */
 EXTERN char_u	*p_bkc;		/* 'backupcopy' */
-EXTERN unsigned	bkc_flags;
+EXTERN unsigned	bkc_flags;	/* flags from 'backupcopy' */
 #ifdef IN_OPTION_C
 static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL};
 #endif
@@ -918,6 +918,9 @@ enum
     , BV_AR
 #ifdef FEAT_QUICKFIX
     , BV_BH
+#endif
+    , BV_BKC
+#ifdef FEAT_QUICKFIX
     , BV_BT
     , BV_EFM
     , BV_GP
diff --git a/src/proto/option.pro b/src/proto/option.pro
index 3da74e62d0..2fe05aa048 100644
--- a/src/proto/option.pro
+++ b/src/proto/option.pro
@@ -62,4 +62,5 @@ int check_ff_value __ARGS((char_u *p));
 long get_sw_value __ARGS((buf_T *buf));
 long get_sts_value __ARGS((void));
 void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit));
+unsigned int get_bkc_value __ARGS((buf_T *buf));
 /* vim: set ft=c : */
diff --git a/src/structs.h b/src/structs.h
index 441fcaa1c4..d24175320f 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -137,7 +137,7 @@ typedef struct
 #ifdef FEAT_LINEBREAK
     int		wo_bri;
 # define w_p_bri w_onebuf_opt.wo_bri	/* 'breakindent' */
-    char_u		*wo_briopt;
+    char_u	*wo_briopt;
 # define w_p_briopt w_onebuf_opt.wo_briopt /* 'breakindentopt' */
 #endif
 #ifdef FEAT_DIFF
@@ -1537,6 +1537,8 @@ struct file_buffer
 
     int		b_p_ai;		/* 'autoindent' */
     int		b_p_ai_nopaste;	/* b_p_ai saved for paste mode */
+    char_u	*b_p_bkc;	/* 'backupcopy' */
+    unsigned	b_bkc_flags;    /* flags for 'backupcopy' */
     int		b_p_ci;		/* 'copyindent' */
     int		b_p_bin;	/* 'binary' */
 #ifdef FEAT_MBYTE
diff --git a/src/version.c b/src/version.c
index 9083083d1e..50639fd642 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    456,
 /**/
     455,
 /**/

From 328262b4fde98a3e2c304ba8edeb1be00861b186 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 15:45:09 +0200
Subject: [PATCH 153/473] Added tag v7-4-456 for changeset 54194bd6ed60

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6e301b633c..5321569507 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3178,3 +3178,4 @@ ac6cfdc02695b31b07e9beb60fd704f74f4d4c81 v7-4-451
 c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453
 0cdff7c268559f8f34eae073a013ece71b62b9e3 v7-4-454
 ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
+54194bd6ed607aa0cec07d8a27d4794573eabba9 v7-4-456

From bfafae672b068418ff5e30f3212814c3b20acaf3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 16:49:46 +0200
Subject: [PATCH 154/473] updated for version 7.4.457 Problem:    Using
 getchar() in an expression mapping may result in 	    K_CURSORHOLD,
 which can't be recognized. Solution:   Add the <CursorHold> key.  (Hirohito
 Higashi)

---
 src/misc2.c   | 1 +
 src/version.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/misc2.c b/src/misc2.c
index 1fe0e87cf1..d421a00bc0 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2471,6 +2471,7 @@ static struct key_name_entry
     {K_SNR,		(char_u *)"SNR"},
 #endif
     {K_PLUG,		(char_u *)"Plug"},
+    {K_CURSORHOLD,	(char_u *)"CursorHold"},
     {0,			NULL}
 };
 
diff --git a/src/version.c b/src/version.c
index 50639fd642..bca37f54fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    457,
 /**/
     456,
 /**/

From 6a7ae73437c02ec5dc3d1d6aa6d793d47e2aa5c7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 16:49:46 +0200
Subject: [PATCH 155/473] Added tag v7-4-457 for changeset 96761b6789f6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5321569507..f7eb0ac7fb 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3179,3 +3179,4 @@ c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453
 0cdff7c268559f8f34eae073a013ece71b62b9e3 v7-4-454
 ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
 54194bd6ed607aa0cec07d8a27d4794573eabba9 v7-4-456
+96761b6789f61a8dee1551b7cea98e669fb90fb3 v7-4-457

From 8bc7d05fd7471abc940ac338996e69c7a88ce999 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 18:37:56 +0200
Subject: [PATCH 156/473] updated for version 7.4.458 Problem:    Issue 252:
 Cursor moves in a zero-height window. Solution:   Check for zero height.
 (idea by Christian Brabandt)

---
 src/move.c    | 12 ++++++++++++
 src/version.c |  2 ++
 2 files changed, 14 insertions(+)

diff --git a/src/move.c b/src/move.c
index 42f778438f..2e0efeca3c 100644
--- a/src/move.c
+++ b/src/move.c
@@ -183,6 +183,18 @@ update_topline()
     if (!screen_valid(TRUE))
 	return;
 
+    /* If the window height is zero just use the cursor line. */
+    if (curwin->w_height == 0)
+    {
+	curwin->w_topline = curwin->w_cursor.lnum;
+	curwin->w_botline = curwin->w_topline;
+	curwin->w_valid |= VALID_BOTLINE|VALID_BOTLINE_AP;
+#ifdef FEAT_SCROLLBIND
+	curwin->w_scbind_pos = 1;
+#endif
+	return;
+    }
+
     check_cursor_moved(curwin);
     if (curwin->w_valid & VALID_TOPLINE)
 	return;
diff --git a/src/version.c b/src/version.c
index bca37f54fa..867aa7c3fd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    458,
 /**/
     457,
 /**/

From 321451cbead2bdb104bf832832c37daa23f2c407 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 18:37:56 +0200
Subject: [PATCH 157/473] Added tag v7-4-458 for changeset fe1827921d50

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f7eb0ac7fb..aa3828e5ef 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3180,3 +3180,4 @@ c72eb8499a9d3f618de3528287d1de62025fdda4 v7-4-453
 ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
 54194bd6ed607aa0cec07d8a27d4794573eabba9 v7-4-456
 96761b6789f61a8dee1551b7cea98e669fb90fb3 v7-4-457
+fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458

From 1c17c48001a65198acd7b015f1609b9a09b85db0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 21:53:41 +0200
Subject: [PATCH 158/473] updated for version 7.4.459 Problem:    Can't change
 the icon after building Vim. Solution:   Load the icon from a file on
 startup. (Yasuhiro Matsumoto)

---
 src/gui_w32.c          |  8 ++++++++
 src/os_mswin.c         | 27 +++++++++++++++++++++++++++
 src/os_win32.c         |  3 ++-
 src/proto/os_mswin.pro |  1 +
 src/version.c          |  2 ++
 5 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/src/gui_w32.c b/src/gui_w32.c
index 6948ab551c..5e18e85175 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1662,6 +1662,14 @@ gui_mch_init(void)
     if (s_textArea == NULL)
 	return FAIL;
 
+    /* Try loading an icon from $RUNTIMEPATH/bitmaps/vim.ico. */
+    {
+	HANDLE	hIcon = NULL;
+
+	if (mch_icon_load(&hIcon) == OK && hIcon != NULL)
+	    SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, hIcon);
+    }
+
 #ifdef FEAT_MENU
     s_menuBar = CreateMenu();
 #endif
diff --git a/src/os_mswin.c b/src/os_mswin.c
index b5786800e4..8ad3695bd4 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -928,6 +928,33 @@ check_str_len(char_u *str)
 }
 # endif
 
+/*
+ * Passed to do_in_runtimepath() to load a vim.ico file.
+ */
+    static void
+mch_icon_load_cb(char_u *fname, void *cookie)
+{
+    HANDLE *h = (HANDLE *)cookie;
+
+    *h = LoadImage(NULL,
+		   fname,
+		   IMAGE_ICON,
+		   64,
+		   64,
+		   LR_LOADFROMFILE | LR_LOADMAP3DCOLORS);
+}
+
+/*
+ * Try loading an icon file from 'runtimepath'.
+ */
+    int
+mch_icon_load(iconp)
+    HANDLE *iconp;
+{
+    return do_in_runtimepath((char_u *)"bitmaps/vim.ico",
+					      FALSE, mch_icon_load_cb, iconp);
+}
+
     int
 mch_libcall(
     char_u	*libname,
diff --git a/src/os_win32.c b/src/os_win32.c
index 7192c51a03..21c3ee9f4e 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2446,7 +2446,8 @@ SaveConsoleTitleAndIcon(void)
 	return;
 
     /* Extract the first icon contained in the Vim executable. */
-    g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
+    if (mch_icon_load((HANDLE *)&g_hVimIcon) == FAIL || g_hVimIcon == NULL)
+	g_hVimIcon = ExtractIcon(NULL, exe_name, 0);
     if (g_hVimIcon != NULL)
 	g_fCanChangeIcon = TRUE;
 }
diff --git a/src/proto/os_mswin.pro b/src/proto/os_mswin.pro
index 0d29979cf8..b56ee56568 100644
--- a/src/proto/os_mswin.pro
+++ b/src/proto/os_mswin.pro
@@ -21,6 +21,7 @@ int mch_has_wildcard __ARGS((char_u *p));
 int mch_chdir __ARGS((char *path));
 int can_end_termcap_mode __ARGS((int give_msg));
 int mch_screenmode __ARGS((char_u *arg));
+int mch_icon_load __ARGS((HANDLE *iconp));
 int mch_libcall __ARGS((char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result));
 void DumpPutS __ARGS((const char *psz));
 int mch_get_winpos __ARGS((int *x, int *y));
diff --git a/src/version.c b/src/version.c
index 867aa7c3fd..a9f83a2038 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    459,
 /**/
     458,
 /**/

From d1facee369d7cc65da812bbb051bc92eda60b8ee Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 23 Sep 2014 21:53:41 +0200
Subject: [PATCH 159/473] Added tag v7-4-459 for changeset 7816c24ff890

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index aa3828e5ef..41dc81f205 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3181,3 +3181,4 @@ ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
 54194bd6ed607aa0cec07d8a27d4794573eabba9 v7-4-456
 96761b6789f61a8dee1551b7cea98e669fb90fb3 v7-4-457
 fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458
+7816c24ff8907c9f24a9e35992a4d5f3cc9dbc7e v7-4-459

From d81e38c93f92faa21c5c41995243884b2ba29f3b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 24 Sep 2014 13:26:44 +0200
Subject: [PATCH 160/473] updated for version 7.4.460 Problem:    Can't build
 without the quickfix feature. (Erik Falor) Solution:   Add a #ifdef.

---
 src/version.c | 2 ++
 src/window.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/version.c b/src/version.c
index a9f83a2038..4c5324a63d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    460,
 /**/
     459,
 /**/
diff --git a/src/window.c b/src/window.c
index 4bc2e6c412..5a2d8a42b5 100644
--- a/src/window.c
+++ b/src/window.c
@@ -484,7 +484,9 @@ do_window(nchar, Prenum, xchar)
 		    postponed_split = Prenum;
 		else
 		    postponed_split = -1;
+#ifdef FEAT_QUICKFIX
 		g_do_tagpreview = 0;
+#endif
 
 		/* Execute the command right here, required when "wincmd ]"
 		 * was used in a function. */

From e2c87c98073a16e0f4b3a6a7b83b7691f78143ca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 24 Sep 2014 13:26:44 +0200
Subject: [PATCH 161/473] Added tag v7-4-460 for changeset d5eba03293a6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 41dc81f205..9369220572 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3182,3 +3182,4 @@ ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
 96761b6789f61a8dee1551b7cea98e669fb90fb3 v7-4-457
 fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458
 7816c24ff8907c9f24a9e35992a4d5f3cc9dbc7e v7-4-459
+d5eba03293a6193a1b462822800641b820252ce3 v7-4-460

From 9329bab5902677aa3342649e0379520fdbe12f63 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 27 Sep 2014 11:18:19 +0200
Subject: [PATCH 162/473] updated for version 7.4.461 Problem:    MS-Windows:
 When collate is on the number of copies is too high. Solution:   Only set the
 collated/uncollated count when collate is on. 	    (Yasuhiro Matsumoto)

---
 src/os_mswin.c | 20 +++++++++++++-------
 src/version.c  |  2 ++
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/src/os_mswin.c b/src/os_mswin.c
index 8ad3695bd4..9151aef414 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1673,16 +1673,22 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
      */
     psettings->chars_per_line = prt_get_cpl();
     psettings->lines_per_page = prt_get_lpp();
-    psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
-							? prt_dlg.nCopies : 1;
-    psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
-							? 1 : prt_dlg.nCopies;
+    if (prt_dlg.Flags & PD_USEDEVMODECOPIESANDCOLLATE)
+    {
+	psettings->n_collated_copies = (prt_dlg.Flags & PD_COLLATE)
+						    ? prt_dlg.nCopies : 1;
+	psettings->n_uncollated_copies = (prt_dlg.Flags & PD_COLLATE)
+						    ? 1 : prt_dlg.nCopies;
 
-    if (psettings->n_collated_copies == 0)
-	psettings->n_collated_copies = 1;
+	if (psettings->n_collated_copies == 0)
+	    psettings->n_collated_copies = 1;
 
-    if (psettings->n_uncollated_copies == 0)
+	if (psettings->n_uncollated_copies == 0)
+	    psettings->n_uncollated_copies = 1;
+    } else {
+	psettings->n_collated_copies = 1;
 	psettings->n_uncollated_copies = 1;
+    }
 
     psettings->jobname = jobname;
 
diff --git a/src/version.c b/src/version.c
index 4c5324a63d..d0847ad7e5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    461,
 /**/
     460,
 /**/

From 46cc4eeb71196f4367680040d3ac10df65aa8acf Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 27 Sep 2014 11:18:20 +0200
Subject: [PATCH 163/473] Added tag v7-4-461 for changeset 4eba2bdb26f2

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9369220572..2228e5e2b9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3183,3 +3183,4 @@ ebc72764fa1e74758ae1ef9d3f49301f80fc3aa4 v7-4-455
 fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458
 7816c24ff8907c9f24a9e35992a4d5f3cc9dbc7e v7-4-459
 d5eba03293a6193a1b462822800641b820252ce3 v7-4-460
+4eba2bdb26f2be61bfdb1f635c0ed65f4bc35b0b v7-4-461

From 1b6e3ecdef7204a486ecd841c7a4ed0068728db4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 29 Sep 2014 17:15:18 +0200
Subject: [PATCH 164/473] updated for version 7.4.462 Problem:    Setting the
 local value of 'backupcopy' empty gives an error. 	    (Peter Mattern)
 Solution:   When using an empty value set the flags to zero. (Hirohito 
     Higashi)

---
 src/option.c  | 22 ++++++++++++++--------
 src/version.c |  2 ++
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/option.c b/src/option.c
index af9fb506fc..5e8e95a6d2 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5742,15 +5742,21 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 	    flags = &curbuf->b_bkc_flags;
 	}
 
-	if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
-	    errmsg = e_invarg;
-	if ((((int)*flags & BKC_AUTO) != 0)
-		+ (((int)*flags & BKC_YES) != 0)
-		+ (((int)*flags & BKC_NO) != 0) != 1)
+	if ((opt_flags & OPT_LOCAL) && *bkc == NUL)
+	    /* make the local value empty: use the global value */
+	    *flags = 0;
+	else
 	{
-	    /* Must have exactly one of "auto", "yes"  and "no". */
-	    (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
-	    errmsg = e_invarg;
+	    if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK)
+		errmsg = e_invarg;
+	    if ((((int)*flags & BKC_AUTO) != 0)
+		    + (((int)*flags & BKC_YES) != 0)
+		    + (((int)*flags & BKC_NO) != 0) != 1)
+	    {
+		/* Must have exactly one of "auto", "yes"  and "no". */
+		(void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE);
+		errmsg = e_invarg;
+	    }
 	}
     }
 
diff --git a/src/version.c b/src/version.c
index d0847ad7e5..579e0f9ebf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    462,
 /**/
     461,
 /**/

From 5289a4ec67c77748607c8e39250e506ef372ae14 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 29 Sep 2014 17:15:18 +0200
Subject: [PATCH 165/473] Added tag v7-4-462 for changeset c0d93d67572b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2228e5e2b9..9f9231906d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3184,3 +3184,4 @@ fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458
 7816c24ff8907c9f24a9e35992a4d5f3cc9dbc7e v7-4-459
 d5eba03293a6193a1b462822800641b820252ce3 v7-4-460
 4eba2bdb26f2be61bfdb1f635c0ed65f4bc35b0b v7-4-461
+c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462

From 863dcd4e1a54e28590743d0f7608cd08c778128c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 29 Sep 2014 18:08:59 +0200
Subject: [PATCH 166/473] updated for version 7.4.463 Problem:    Test 86 and
 87 may hang on MS-Windows. Solution:   Call inputrestore() after inputsave().
 (Ken Takata)

---
 src/testdir/test86.in | 1 +
 src/testdir/test87.in | 1 +
 src/version.c         | 2 ++
 3 files changed, 4 insertions(+)

diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index b1692939a7..819ae9587d 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -1384,6 +1384,7 @@ EOF
 :debug silent! py test_keyboard_interrupt()
 :redir END
 :0 debuggreedy
+:call inputrestore()
 :silent $put =output
 :unlet output
 :py del test_keyboard_interrupt
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 9111a499bc..e24df41316 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -1361,6 +1361,7 @@ EOF
 :debug silent! py3 test_keyboard_interrupt()
 :redir END
 :0 debuggreedy
+:call inputrestore()
 :silent $put =output
 :unlet output
 :py3 del test_keyboard_interrupt
diff --git a/src/version.c b/src/version.c
index 579e0f9ebf..2239524231 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    463,
 /**/
     462,
 /**/

From a48c2b6cc335806f17dc18b5deed856e72d40274 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 29 Sep 2014 18:08:59 +0200
Subject: [PATCH 167/473] Added tag v7-4-463 for changeset 6f80b9a773db

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9f9231906d..fedb4beb7c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3185,3 +3185,4 @@ fe1827921d50cb59ac680ea13e3f9103cd9db660 v7-4-458
 d5eba03293a6193a1b462822800641b820252ce3 v7-4-460
 4eba2bdb26f2be61bfdb1f635c0ed65f4bc35b0b v7-4-461
 c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
+6f80b9a773db0f3c69156f8768c8b6cfa4ad6785 v7-4-463

From 542d7043d900d20f3ef5c27580278d8d83d1016f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 2 Oct 2014 01:41:41 +0200
Subject: [PATCH 168/473] Update runtime files.

---
 runtime/autoload/phpcomplete.vim |  5 ++-
 runtime/compiler/msvc.vim        |  4 +-
 runtime/doc/autocmd.txt          |  7 +++-
 runtime/doc/editing.txt          |  4 +-
 runtime/doc/eval.txt             |  4 +-
 runtime/doc/map.txt              |  4 +-
 runtime/doc/netbeans.txt         |  2 +-
 runtime/doc/options.txt          |  3 +-
 runtime/doc/os_win32.txt         |  8 +++-
 runtime/doc/syntax.txt           | 10 ++---
 runtime/doc/tags                 |  2 +
 runtime/doc/todo.txt             | 68 +++++++++++++++++++++-----------
 runtime/doc/version7.txt         |  2 +-
 runtime/doc/windows.txt          | 13 +++---
 runtime/syntax/c.vim             | 68 +++++++++++++++++---------------
 runtime/syntax/valgrind.vim      |  6 ++-
 16 files changed, 132 insertions(+), 78 deletions(-)

diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index 82ba894b2a..b014b4cdcf 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
 " Maintainer:	Dávid Szabó ( complex857 AT gmail DOT com )
 " Previous Maintainer:	Mikolaj Machowski ( mikmach AT wp DOT pl )
 " URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change:  2014 Aug 10
+" Last Change:  2014 Oct 02
 "
 "	OPTIONS:
 "
@@ -2344,6 +2344,9 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
 						endfor
 					endif
 				endif
+				if exists('no_namespace_candidate')
+					unlet no_namespace_candidate
+				endif
 			endfor
 		endif
 		let i += 1
diff --git a/runtime/compiler/msvc.vim b/runtime/compiler/msvc.vim
index 99fd35eb18..efe36c4da2 100644
--- a/runtime/compiler/msvc.vim
+++ b/runtime/compiler/msvc.vim
@@ -1,7 +1,7 @@
 " Vim compiler file
-" Compiler:	Miscrosoft Visual C
+" Compiler:	Microsoft Visual C
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2005 Nov 30
+" Last Change:	2014 Sep 20
 
 if exists("current_compiler")
   finish
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 03f95cac6d..fed1a48148 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 7.4.  Last change: 2014 Aug 22
+*autocmd.txt*   For Vim version 7.4.  Last change: 2014 Sep 23
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -519,6 +519,11 @@ CursorHold			When the user doesn't press a key for the time
 				operator.
 				While recording the CursorHold event is not
 				triggered. |q|
+							*<CursorHold>*
+				Internally the autocommand is triggered by the
+				<CursorHold> key. In an expression mapping
+				|getchar()| may see this character.
+
 				Note: Interactive commands cannot be used for
 				this event.  There is no hit-enter prompt,
 				the screen is updated directly (when needed).
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 3ef8f05bc6..add3bb0878 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1483,8 +1483,8 @@ Notes:
 - Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no
   objection to its export.  Pkzip's public file APPNOTE.TXT describes this
   algorithm in detail.
-- The implmentation of 'cryptmethod' "blowfish" has a flaw.  It is possible to
-  crack the first 64 bytes of a file and in some circumstances more of the
+- The implementation of 'cryptmethod' "blowfish" has a flaw.  It is possible
+  to crack the first 64 bytes of a file and in some circumstances more of the
   file. Use of it is not recommended, but it's still the strongest method
   supported by Vim 7.3 and 7.4.  The "zip" method is even weaker.
 - Vim originates from the Netherlands.  That is where the sources come from.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index c0ec1a7da5..eb7fcbcaac 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Sep 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1751,7 +1751,7 @@ confirm( {msg} [, {choices} [, {default} [, {type}]]])
 copy( {expr})			any	make a shallow copy of {expr}
 cos( {expr})			Float	cosine of {expr}
 cosh( {expr})			Float	hyperbolic cosine of {expr}
-count( {list}, {expr} [, {start} [, {ic}]])
+count( {list}, {expr} [, {ic} [, {start}]])
 				Number	 count how many {expr} are in {list}
 cscope_connection( [{num} , {dbpath} [, {prepend}]])
 				Number	checks existence of cscope connection
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 3ac8e5db9d..5f1c4a6261 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt*       For Vim version 7.4.  Last change: 2014 Jun 02
+*map.txt*       For Vim version 7.4.  Last change: 2014 Sep 30
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1283,6 +1283,8 @@ completion can be enabled:
 	-complete=custom,{func} custom completion, defined via {func}
 	-complete=customlist,{func} custom completion, defined via {func}
 
+Note: That some completion methods might expand environment variables.
+
 
 Custom completion			*:command-completion-custom*
 					*:command-completion-customlist*
diff --git a/runtime/doc/netbeans.txt b/runtime/doc/netbeans.txt
index e0ac2bf82a..82db022d03 100644
--- a/runtime/doc/netbeans.txt
+++ b/runtime/doc/netbeans.txt
@@ -470,7 +470,7 @@ raise		Bring the editor to the foreground.
 		New in version 2.1.
 
 removeAnno serNum
-		Remove a previously place annotation for this buffer.
+		Remove a previously placed annotation for this buffer.
 		"serNum" is the same number used in addAnno.
 
 save		Save the buffer when it was modified.  The other side of the
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 790e66c7b4..b50711c698 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
+*options.txt*	For Vim version 7.4.  Last change: 2014 Sep 23
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -4009,6 +4009,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 	When Vim was compiled with HAVE_X11 defined, the original icon will be
 	restored if possible |X11|.  See |X11-icon| for changing the icon on
 	X11.
+	For MS-Windows the icon can be changed, see |windows-icon|.
 
 						*'iconstring'*
 'iconstring'		string	(default "")
diff --git a/runtime/doc/os_win32.txt b/runtime/doc/os_win32.txt
index 80085a8ed0..9637d7e82a 100644
--- a/runtime/doc/os_win32.txt
+++ b/runtime/doc/os_win32.txt
@@ -1,4 +1,4 @@
-*os_win32.txt*  For Vim version 7.4.  Last change: 2014 Aug 29
+*os_win32.txt*  For Vim version 7.4.  Last change: 2014 Sep 25
 
 
 		  VIM REFERENCE MANUAL    by George Reilly
@@ -367,4 +367,10 @@ Q. I use Vim under Win32s and NT.  In NT, I can define the console to default to
 A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section.  DOS
    prompts and external DOS commands will now run in a 50-line window.
 
+						*windows-icon*
+Q. I don't like the Vim icon, can I change it?
+A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
+   'runtimepath'.  For example ~/vimfiles/bitmaps/vim.ico.
+
+
  vim:tw=78:fo=tcq2:ts=8:ft=help:norl:
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index 5cd4bd5447..ee91a91acb 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.4.  Last change: 2014 Sep 09
+*syntax.txt*	For Vim version 7.4.  Last change: 2014 Sep 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3799,7 +3799,7 @@ The 'foldnestmax' option limits the nesting of syntax folds.
 
 
 			*:syn-contains* *E405* *E406* *E407* *E408* *E409*
-contains={groupname},..
+contains={group-name},..
 
 The "contains" argument is followed by a list of syntax group names.  These
 groups will be allowed to begin inside the item (they may extend past the
@@ -3852,13 +3852,13 @@ region where contained items do match.	Note that this may also limit the
 area that is highlighted
 
 
-containedin={groupname}...				*:syn-containedin*
+containedin={group-name}...				*:syn-containedin*
 
 The "containedin" argument is followed by a list of syntax group names.  The
 item will be allowed to begin inside these groups.  This works as if the
 containing item has a "contains=" argument that includes this item.
 
-The {groupname}... can be used just like for "contains", as explained above.
+The {group-name}... can be used just like for "contains", as explained above.
 
 This is useful when adding a syntax item afterwards.  An item can be told to
 be included inside an already existing item, without changing the definition
@@ -3874,7 +3874,7 @@ keywords never contain another item, thus adding them to "containedin" won't
 work.
 
 
-nextgroup={groupname},..				*:syn-nextgroup*
+nextgroup={group-name},..				*:syn-nextgroup*
 
 The "nextgroup" argument is followed by a list of syntax group names,
 separated by commas (just like with "contains", so you can also use patterns).
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 144b76038b..f8db6553e1 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -3134,6 +3134,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 <CSI>	intro.txt	/*<CSI>*
 <Char->	map.txt	/*<Char->*
 <Char>	map.txt	/*<Char>*
+<CursorHold>	autocmd.txt	/*<CursorHold>*
 <D-	intro.txt	/*<D-*
 <Del>	change.txt	/*<Del>*
 <Down>	motion.txt	/*<Down>*
@@ -8781,6 +8782,7 @@ window-variable	eval.txt	/*window-variable*
 windowid-variable	eval.txt	/*windowid-variable*
 windows	windows.txt	/*windows*
 windows-3.1	os_win32.txt	/*windows-3.1*
+windows-icon	os_win32.txt	/*windows-icon*
 windows-intro	windows.txt	/*windows-intro*
 windows-starting	windows.txt	/*windows-starting*
 windows.txt	windows.txt	/*windows.txt*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index ca957e360d..62bd2d5fc0 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Sep 19
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Oct 02
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -58,6 +58,15 @@ Patch to make getregtype() return the right size for non-linux systems.
 (Yasuhiro Matsumoto, 2014 Jul 8)
 Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 
+Patch to fix 'linebreak' when applying an operator.  And fix the test not
+actually testing. (Christian Brabandt, 2014 Sep 23)
+
+patch to fix issue 26. (Christian)
+
+Test 11 and 100 do not work properly on Windows.
+Patch by Ken Takata (2014 Sep 25)
+Alternative patch Oct 1.
+
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
@@ -65,26 +74,15 @@ Patch to avoid problems with encoding conversion with diff.vim.
 (Yasuhiro Matsumoto, 2014 Sep 1.
 Depends on current language, language of file can be different.
 
-Patch for C/C++ syntax string handling. (Brian Bi, 2014 Sep 13)
-
-When using a visual selection of multiple words and doing CTRL-W_] it jumps to
-the tag matching the word under the cursor, not the selected text.
-(Patrick hemmer)
-Patch by Christian, 2014 Aug 8.
-
-Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
-
-'backupcopy' should be global-local, so that some files can be written in a
-different way.  Patch by Christian, 2014 Sep 17.
-
-Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
-Prefer the second solution.
-
-Issue 252.  Patch by Christian, 2014 Aug 26.
+Add books from Steve Oualline to Vim website. (2014 Sep 25)
 
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
+Patch to have the fold and sign column and at the last line of the buffer.
+(Marco Hinz, 2014 Sep 25)
+Alternate suggestion: let all columns continue, also number column.
+
 Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
 14, Aug 30)
     Make ":1close" close the first window.
@@ -92,29 +90,53 @@ Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
     Make ":-1close" close the previous window.
 Doesn't look right, asked for updates.
 
-Patch to add a special key name for K_CURSORHOLD. (Hirohito Higashi, 2014 Aug
-10)
+Patch to handle multi-byte printer name on MS-Windows. (Yasuhiro Matsumoto,
+2014 Sept 28)
+
+Two patches by Christian, 2014 Sep 29:
+- Combination of precedes listchar and 'showbreak' doesn't work well.
+- Moving cursor is off when 'nu' and 'sbr' are set.
 
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
+Patch to fix window title for a command window on MS-Windows. (Yasuhiro
+Matsumoto, 2014 Sep 28)
+
+Patch to fix that 0x80 in abbreviation isn't handled correctly.
+(Christian Brabandt, 2014 Oct 1)
+
+Patch to fix issue 57, on the issue.
+
+Patch for issue 101, maintainer unreachable.
+
+Remove restriction in NSIS installer that the end of the path must be "Vim".
+(Tim Lebedkov, 2014 Sep 24)
+
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
+'foldexpr' applies to help. (Paul Marshall, 2014 Sep 24)
+
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
+On MS-Windows running tests with Mercurial has problems when the input files
+are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
+
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
 
 ml_updatechunk() is slow when retrying for another encoding. (John Little,
 2014 Sep 11)
 
-Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
+Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24)
 
-Patch to allow for a different icon on MS-Windows. (Yasuhiro Matsumoto, 2014
-Sep 7).
+When in 'comments' "n:x" follows after three-part comment directly it repeats
+any one-character from the previous line. (Kartik Agaram, 2014 Sep 19)
+
+Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
@@ -165,6 +187,8 @@ from?
 Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman,
 2014 Jun 8)
 
+Patch to load TCL dynamically. (Ken Takata, 2014 Sep 20)
+
 Include a plugin manager with Vim? Neobundle seems to be the best currently.
 Long message about this from ZyX, 2014 Mar 23.  And following replies.
 Also see http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 833bf9e4ab..3e3e32b395 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -2039,7 +2039,7 @@ Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like
 Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US".
 
 Added backslashes before dashes in the vim.1 manual page to make them appear
-as real dashes. (Pierr Habouzit)
+as real dashes. (Pierre Habouzit)
 
 Where "gq" left the cursor depended on the value of 'formatprg'.  Now "gq"
 always leaves the cursor at the last line of the formatted text.
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 00fe956dd4..0098e3e521 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt*   For Vim version 7.4.  Last change: 2014 Mar 25
+*windows.txt*   For Vim version 7.4.  Last change: 2014 Sep 23
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -726,18 +726,21 @@ the buffer.  The result is that all buffers will use the 'encoding' encoding
 
 CTRL-W ]					*CTRL-W_]* *CTRL-W_CTRL-]*
 CTRL-W CTRL-]	Split current window in two.  Use identifier under cursor as a
-		tag and jump to it in the new upper window.  Make new window N
-		high.
+		tag and jump to it in the new upper window.
+		In Visual mode uses the Visually selected text as a tag.
+		Make new window N high.
 
 							*CTRL-W_g]*
 CTRL-W g ]	Split current window in two.  Use identifier under cursor as a
 		tag and perform ":tselect" on it in the new upper window.
+		In Visual mode uses the Visually selected text as a tag.
 		Make new window N high.
 
 							*CTRL-W_g_CTRL-]*
 CTRL-W g CTRL-]	Split current window in two.  Use identifier under cursor as a
-		tag and perform ":tjump" on it in the new upper window.  Make
-		new window N high.
+		tag and perform ":tjump" on it in the new upper window.
+		In Visual mode uses the Visually selected text as a tag.
+		Make new window N high.
 
 CTRL-W f					*CTRL-W_f* *CTRL-W_CTRL-F*
 CTRL-W CTRL-F	Split current window in two.  Edit file name under cursor.
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index d991540488..2e54b8c42a 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:	C
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 May 26
+" Last Change:	2014 Sep 23
 
 " Quit when a (custom) syntax file was already loaded
 if exists("b:current_syntax")
@@ -35,28 +35,37 @@ syn match	cSpecial	display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
 if !exists("c_no_utf")
   syn match	cSpecial	display contained "\\\(u\x\{4}\|U\x\{8}\)"
 endif
-if exists("c_no_cformat")
-  syn region	cString		start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
-  " cCppString: same as cString, but ends at end of line
-  if !exists("cpp_no_cpp11") " ISO C++11
-    syn region cCppString	start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
-  else
-    syn region cCppString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
-  endif
-  syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
-  syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
-else
+
+if !exists("c_no_cformat")
+  " Highlight % items in strings.
   if !exists("c_no_c99") " ISO C99
     syn match	cFormat		display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
   else
     syn match	cFormat		display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([bdiuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
   endif
   syn match	cFormat		display "%%" contained
+endif
+
+" cCppString: same as cString, but ends at end of line
+if s:ft ==# "cpp" && !exists("cpp_no_cpp11")
+  " ISO C++11
+  syn region	cString		start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+  syn region 	cCppString	start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+elseif s:ft ==# "c" && !exists("c_no_c11")
+  " ISO C99
+  syn region	cString		start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
+  syn region	cCppString	start=+\%(L\|U\|u8\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
+else
+  " older C or C++
   syn region	cString		start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
-  " cCppString: same as cString, but ends at end of line
   syn region	cCppString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
 endif
 
+syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
+syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
+
+syn cluster	cStringGroup	contains=cCppString,cCppOut2,cCppSkip
+
 syn match	cCharacter	"L\='[^\\]'"
 syn match	cCharacter	"L'[^']*'" contains=cSpecial
 if exists("c_gnu")
@@ -70,12 +79,9 @@ syn match	cSpecialCharacter display "L\='\\\o\{1,3}'"
 syn match	cSpecialCharacter display "'\\x\x\{1,2}'"
 syn match	cSpecialCharacter display "L'\\x\x\+'"
 
-if !exists("c_no_c11") " ISO C11
-  if exists("c_no_cformat")
-    syn region	cString		start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,@Spell extend
-  else
-    syn region	cString		start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
-  endif
+if (s:ft ==# "c" && !exists("c_no_c11")) || (s:ft ==# "cpp" && !exists("cpp_no_cpp11"))
+  " ISO C11 or ISO C++ 11
+  syn region	cString		start=+\%(U\|u8\=\)"+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat,@Spell extend
   syn match	cCharacter	"[Uu]'[^\\]'"
   syn match	cCharacter	"[Uu]'[^']*'" contains=cSpecial
   if exists("c_gnu")
@@ -102,24 +108,24 @@ endif
 " This should be before cErrInParen to avoid problems with #define ({ xxx })
 if exists("c_curly_error")
   syn match cCurlyError "}"
-  syn region	cBlock		start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell fold
+  syn region	cBlock		start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold
 else
   syn region	cBlock		start="{" end="}" transparent fold
 endif
 
-"catch errors caused by wrong parenthesis and brackets
-" also accept <% for {, %> for }, <: for [ and :> for ] (C99)
+" Catch errors caused by wrong parenthesis and brackets.
+" Also accept <% for {, %> for }, <: for [ and :> for ] (C99)
 " But avoid matching <::.
 syn cluster	cParenGroup	contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
 if exists("c_no_curly_error")
   if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
-    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
     syn match	cParenError	display ")"
     syn match	cErrInParen	display contained "^^<%\|^%>"
   else
-    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
     syn match	cParenError	display ")"
@@ -127,13 +133,13 @@ if exists("c_no_curly_error")
   endif
 elseif exists("c_no_bracket_error")
   if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
-    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
     syn match	cParenError	display ")"
     syn match	cErrInParen	display contained "<%\|%>"
   else
-    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
     syn match	cParenError	display ")"
@@ -141,19 +147,19 @@ elseif exists("c_no_bracket_error")
   endif
 else
   if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
-    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
     syn match	cParenError	display "[\])]"
     syn match	cErrInParen	display contained "<%\|%>"
-    syn region	cBracket	transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+    syn region	cBracket	transparent start='\[\|<::\@!' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
   else
-    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
+    syn region	cParen		transparent start='(' end=')' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell
     " cCppParen: same as cParen but ends at end-of-line; used in cDefine
     syn region	cCppParen	transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
     syn match	cParenError	display "[\])]"
     syn match	cErrInParen	display contained "[\]{}]\|<%\|%>"
-    syn region	cBracket	transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell
+    syn region	cBracket	transparent start='\[\|<::\@!' end=']\|:>' end='}'me=s-1 contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,@cStringGroup,@Spell
   endif
   " cCppBracket: same as cParen but ends at end-of-line; used in cDefine
   syn region	cCppBracket	transparent start='\[\|<::\@!' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell
@@ -376,7 +382,7 @@ syn region	cPreProc	start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>
 " Highlight User Labels
 syn cluster	cMultiGroup	contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
 if s:ft ==# 'c' || exists("cpp_no_cpp11")
-  syn region	cMulti		transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
+  syn region	cMulti		transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell,@cStringGroup
 endif
 " Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
 syn cluster	cLabelGroup	contains=cUserLabel
diff --git a/runtime/syntax/valgrind.vim b/runtime/syntax/valgrind.vim
index 48e9564acb..c247927c2f 100644
--- a/runtime/syntax/valgrind.vim
+++ b/runtime/syntax/valgrind.vim
@@ -2,9 +2,11 @@
 " Language: Valgrind Memory Debugger Output
 " Maintainer: Roger Luethi <rl@hellgate.ch>
 " Program URL: http://devel-home.kde.org/~sewardj/
-" Last Change: 2012 Apr 30
+" Last Change: 2014 Oct 02
 "
 " Notes: mostly based on strace.vim and xml.vim
+"
+" Contributors: Christoph Gysin <christoph.gysin@gmail.com>
 
 " Quit when a syntax file was already loaded
 if exists("b:current_syntax")
@@ -65,7 +67,7 @@ syn match valgrindAt "at\s\@=" contained
 syn match valgrindAddr "\(\W\)\@<=0x\x\+" contained
 syn match valgrindFunc "\(: \)\@<=\w\+" contained
 syn match valgrindBin "\((\(with\|\)in \)\@<=\S\+\()\)\@=" contained
-syn match valgrindSrc "\((\)\@<=.*:\d\+\()\)\@=" contained
+syn match valgrindSrc "\((\)\@<=[^)]*:\d\+\()\)\@=" contained
 
 " Define the default highlighting
 

From b0b9c10b88a3f108d911ee14b3110d995a529438 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 6 Oct 2014 18:10:09 +0200
Subject: [PATCH 169/473] updated for version 7.4.464 Problem:    Compiler
 warning. Solution:   Add type cast. (Ken Takata)

---
 src/gui_w32.c | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gui_w32.c b/src/gui_w32.c
index 5e18e85175..374ed47258 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1667,7 +1667,7 @@ gui_mch_init(void)
 	HANDLE	hIcon = NULL;
 
 	if (mch_icon_load(&hIcon) == OK && hIcon != NULL)
-	    SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, hIcon);
+	    SendMessage(s_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
     }
 
 #ifdef FEAT_MENU
diff --git a/src/version.c b/src/version.c
index 2239524231..dc9d25d589 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    464,
 /**/
     463,
 /**/

From bfa001f02fcd4df5e105a58adb52aba8cea16ddb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 6 Oct 2014 18:10:10 +0200
Subject: [PATCH 170/473] Added tag v7-4-464 for changeset 74c65620c985

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index fedb4beb7c..d5e7117004 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3186,3 +3186,4 @@ d5eba03293a6193a1b462822800641b820252ce3 v7-4-460
 4eba2bdb26f2be61bfdb1f635c0ed65f4bc35b0b v7-4-461
 c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 6f80b9a773db0f3c69156f8768c8b6cfa4ad6785 v7-4-463
+74c65620c985f680eb1d7c1110f259cc37779ffa v7-4-464

From 2629b32cc49ac000d29c460ece874328ede97297 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 7 Oct 2014 10:38:40 +0200
Subject: [PATCH 171/473] updated for version 7.4.465 Problem:    Crash when
 expanding a very long string. Solution:   Use wsncpy() instead of wcscpy().
 (Ken Takata)

---
 src/os_win32.c | 5 +++--
 src/version.c  | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/os_win32.c b/src/os_win32.c
index 21c3ee9f4e..eb66ed2d2b 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2775,9 +2775,10 @@ fname_case(
 	if (p != NULL)
 	{
 	    char_u	*q;
-	    WCHAR	buf[_MAX_PATH + 2];
+	    WCHAR	buf[_MAX_PATH + 1];
 
-	    wcscpy(buf, p);
+	    wcsncpy(buf, p, _MAX_PATH);
+	    buf[_MAX_PATH] = L'\0';
 	    vim_free(p);
 
 	    if (fname_casew(buf, (len > 0) ? _MAX_PATH : 0) == OK)
diff --git a/src/version.c b/src/version.c
index dc9d25d589..c502cdc4b8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    465,
 /**/
     464,
 /**/

From cf0cf8f9d5ef213d50c986ec1b05f04bab778b40 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 7 Oct 2014 10:38:40 +0200
Subject: [PATCH 172/473] Added tag v7-4-465 for changeset 452e8b2a0ab3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d5e7117004..63d4d3ff8b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3187,3 +3187,4 @@ d5eba03293a6193a1b462822800641b820252ce3 v7-4-460
 c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 6f80b9a773db0f3c69156f8768c8b6cfa4ad6785 v7-4-463
 74c65620c985f680eb1d7c1110f259cc37779ffa v7-4-464
+452e8b2a0ab39fb0cc037382cc4842a6d6b2a3f2 v7-4-465

From 96186b8fb98fc6a3616ca4bb824ed6fa17751726 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 10:44:37 +0200
Subject: [PATCH 173/473] updated for version 7.4.466 Problem:    CTRL-W } does
 not open preview window. (Erik Falor) Solution:   Don't set g_do_tagpreview
 for CTRL-W }.

---
 src/version.c | 2 ++
 src/window.c  | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/version.c b/src/version.c
index c502cdc4b8..6417a491d8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    466,
 /**/
     465,
 /**/
diff --git a/src/window.c b/src/window.c
index 5a2d8a42b5..fda9199b2e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -485,7 +485,8 @@ do_window(nchar, Prenum, xchar)
 		else
 		    postponed_split = -1;
 #ifdef FEAT_QUICKFIX
-		g_do_tagpreview = 0;
+		if (nchar != '}')
+		    g_do_tagpreview = 0;
 #endif
 
 		/* Execute the command right here, required when "wincmd ]"

From 5300527953ea2d44e880d4f3361b8a38da4f7f68 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 10:44:38 +0200
Subject: [PATCH 174/473] Added tag v7-4-466 for changeset 521c49b6de9d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 63d4d3ff8b..a9c3ffd4a3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3188,3 +3188,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 6f80b9a773db0f3c69156f8768c8b6cfa4ad6785 v7-4-463
 74c65620c985f680eb1d7c1110f259cc37779ffa v7-4-464
 452e8b2a0ab39fb0cc037382cc4842a6d6b2a3f2 v7-4-465
+521c49b6de9d6352331dd8ff63286f6673014616 v7-4-466

From f2a0ed18836113c291632b53b17011d0eb9fc7fb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 13:24:43 +0200
Subject: [PATCH 175/473] updated for version 7.4.467

---
 src/normal.c                |  9 +++++++++
 src/screen.c                | 10 +++++++++-
 src/testdir/test_listlbr.in | 10 +++++++++-
 src/testdir/test_listlbr.ok |  4 ++++
 src/version.c               |  2 ++
 5 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/normal.c b/src/normal.c
index a8d74117c7..8384d6ffea 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1380,6 +1380,12 @@ do_pending_operator(cap, old_col, gui_yank)
     pos_T	old_cursor;
     int		empty_region_error;
     int		restart_edit_save;
+#ifdef FEAT_LINEBREAK
+    int		lbr_saved = curwin->w_p_lbr;
+
+    curwin->w_p_lbr = FALSE;	/* avoid a problem with unwanted linebreaks in
+				 * block mode */
+#endif
 
     /* The visual area is remembered for redo */
     static int	    redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
@@ -2136,6 +2142,9 @@ do_pending_operator(cap, old_col, gui_yank)
 	oap->block_mode = FALSE;
 	clearop(oap);
     }
+#ifdef FEAT_LINEBREAK
+    curwin->w_p_lbr = lbr_saved;
+#endif
 }
 
 /*
diff --git a/src/screen.c b/src/screen.c
index 7a9311a453..fae2703f71 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1584,9 +1584,17 @@ win_update(wp)
 	     */
 	    if (VIsual_mode == Ctrl_V)
 	    {
-		colnr_T	fromc, toc;
+		colnr_T	    fromc, toc;
+#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
+		int	    save_ve_flags = ve_flags;
 
+		if (curwin->w_p_lbr)
+		    ve_flags = VE_ALL;
+#endif
 		getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc);
+#if defined(FEAT_VIRTUALEDIT) && defined(FEAT_LINEBREAK)
+		ve_flags = save_ve_flags;
+#endif
 		++toc;
 		if (curwin->w_curswant == MAXCOL)
 		    toc = MAXCOL;
diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in
index f155f85a4b..f6618c5a42 100644
--- a/src/testdir/test_listlbr.in
+++ b/src/testdir/test_listlbr.in
@@ -2,7 +2,7 @@ Test for linebreak and list option (non-utf8)
 
 STARTTEST
 :so small.vim
-:if !exists("+linebreak") || !exists("+conceal") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
 :10new|:vsp|:vert resize 20
 :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \"
 :norm! zt
@@ -56,6 +56,14 @@ STARTTEST
 :syn match All /.*/ contains=ConcealVar
 :let line=ScreenChar(winwidth(0))
 :call DoRecordScreen()
+:set cpo&vim linebreak
+:let g:test ="Test 6: set linebreak with visual block mode"
+:let line="REMOVE: this not"
+:$put =line
+:let line="REMOVE: aaaaaaaaaaaaa"
+:$put =line
+:1/^REMOVE:
+0jf x:$put
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok
index 9b8037f4d3..ee74667661 100644
--- a/src/testdir/test_listlbr.ok
+++ b/src/testdir/test_listlbr.ok
@@ -32,3 +32,7 @@ Sabbbbbb bla
 ~                   
 ~                   
 ~                   
+this not
+aaaaaaaaaaaaa
+REMOVE: 
+REMOVE: 
diff --git a/src/version.c b/src/version.c
index 6417a491d8..5979660f43 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    467,
 /**/
     466,
 /**/

From 4fe72939860c3c9dcd0b87753ea1a99f3b8eb1f5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 13:24:43 +0200
Subject: [PATCH 176/473] Added tag v7-4-467 for changeset 0a4efa3d2019

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a9c3ffd4a3..d3db20ddc3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3189,3 +3189,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 74c65620c985f680eb1d7c1110f259cc37779ffa v7-4-464
 452e8b2a0ab39fb0cc037382cc4842a6d6b2a3f2 v7-4-465
 521c49b6de9d6352331dd8ff63286f6673014616 v7-4-466
+0a4efa3d20197cdf0bfe93080abc7cd197878e9a v7-4-467

From 6310a53287e14099e985f0a9b55eb1468dea2d82 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 13:36:16 +0200
Subject: [PATCH 177/473] updated for version 7.4.468 Problem:    Issue 26:
 CTRL-C does not interrupt after it was mapped and then 	    unmapped.
 Solution:   Reset mapped_ctrl_c. (Christian Brabandt)

---
 src/getchar.c | 5 ++++-
 src/version.c | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/getchar.c b/src/getchar.c
index d646dc4c15..9edb767e1b 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3707,6 +3707,9 @@ do_map(maptype, arg, mode, abbrev)
     {
 	if (!did_it)
 	    retval = 2;			    /* no match */
+	else if (*keys == Ctrl_C)
+	    /* If CTRL-C has been unmapped, reuse it for Interrupting. */
+	    mapped_ctrl_c = FALSE;
 	goto theend;
     }
 
@@ -3739,7 +3742,7 @@ do_map(maptype, arg, mode, abbrev)
 	goto theend;
     }
 
-    /* If CTRL-C has been mapped, don't always use it for Interrupting */
+    /* If CTRL-C has been mapped, don't always use it for Interrupting. */
     if (*keys == Ctrl_C)
 	mapped_ctrl_c = TRUE;
 
diff --git a/src/version.c b/src/version.c
index 5979660f43..83887f67ec 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    468,
 /**/
     467,
 /**/

From a17201ee65302c27c4d04c1155bf81c4c659035d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 13:36:17 +0200
Subject: [PATCH 178/473] Added tag v7-4-468 for changeset 4f7f236d773d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d3db20ddc3..1c17cd23c0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3190,3 +3190,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 452e8b2a0ab39fb0cc037382cc4842a6d6b2a3f2 v7-4-465
 521c49b6de9d6352331dd8ff63286f6673014616 v7-4-466
 0a4efa3d20197cdf0bfe93080abc7cd197878e9a v7-4-467
+4f7f236d773d21e46ffa6c38d8df110d11413dca v7-4-468

From edd8e182f23bd43967b9f7e95c7ed4146a82f4c5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 14:48:30 +0200
Subject: [PATCH 179/473] updated for version 7.4.469 Problem:    Can't build
 with MSVC. (Ken Takata) Solution:   Move the assignment after the
 declarations.

---
 src/normal.c  | 7 ++++---
 src/version.c | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/normal.c b/src/normal.c
index 8384d6ffea..0116d058ba 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1382,9 +1382,6 @@ do_pending_operator(cap, old_col, gui_yank)
     int		restart_edit_save;
 #ifdef FEAT_LINEBREAK
     int		lbr_saved = curwin->w_p_lbr;
-
-    curwin->w_p_lbr = FALSE;	/* avoid a problem with unwanted linebreaks in
-				 * block mode */
 #endif
 
     /* The visual area is remembered for redo */
@@ -1396,6 +1393,10 @@ do_pending_operator(cap, old_col, gui_yank)
     int		    include_line_break = FALSE;
 #endif
 
+#ifdef FEAT_LINEBREAK
+    curwin->w_p_lbr = FALSE;	/* Avoid a problem with unwanted linebreaks in
+				 * block mode. */
+#endif
 #if defined(FEAT_CLIPBOARD)
     /*
      * Yank the visual area into the GUI selection register before we operate
diff --git a/src/version.c b/src/version.c
index 83887f67ec..8d1e4a0dd9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    469,
 /**/
     468,
 /**/

From e0286b8addd0aafcfe35b5b5a79d31ba083fafa4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 14:48:30 +0200
Subject: [PATCH 180/473] Added tag v7-4-469 for changeset a6f5a4ac4d46

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1c17cd23c0..5baceefebf 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3191,3 +3191,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 521c49b6de9d6352331dd8ff63286f6673014616 v7-4-466
 0a4efa3d20197cdf0bfe93080abc7cd197878e9a v7-4-467
 4f7f236d773d21e46ffa6c38d8df110d11413dca v7-4-468
+a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469

From 3cecb6b6c255a266d8e03ecefe74d3080f07278d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 15:37:06 +0200
Subject: [PATCH 181/473] updated for version 7.4.470 Problem:    Test 11 and
 100 do not work properly on Windows. Solution:   Avoid using feedkeys(). (Ken
 Takata)

---
 src/testdir/Make_dos.mak | 2 +-
 src/testdir/test100.in   | 4 ++--
 src/testdir/test11.in    | 6 +++---
 src/version.c            | 2 ++
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index cd7aa4d487..38264f2eaf 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -63,7 +63,7 @@ win32:	fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report
 fixff:
 	-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
 	-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
-		dotest.in test60.ok test71.ok test74.ok
+		dotest.in test60.ok test71.ok test74.ok test100.ok
 
 report:
 	@echo ""
diff --git a/src/testdir/test100.in b/src/testdir/test100.in
index e703f18199..7bd88fe9c9 100644
--- a/src/testdir/test100.in
+++ b/src/testdir/test100.in
@@ -16,7 +16,7 @@ STARTTEST
 :new one
 :0put ='ONE: expecting global undolevels: 5, local undolevels: -123456 (default)'
 :call FillBuffer()
-:call feedkeys(":earlier 10\n", 't')
+:earlier 10
 :call UndoLevel()
 :set ff=unix
 :%w! test.out
@@ -24,7 +24,7 @@ STARTTEST
 :0put ='TWO: expecting global undolevels: 5, local undolevels: 2 (first) then 10 (afterwards)'
 :setlocal ul=2
 :call FillBuffer()
-:call feedkeys(":earlier 10\n", 't')
+:earlier 10
 :call UndoLevel()
 :setlocal ul=10
 :call UndoLevel()
diff --git a/src/testdir/test11.in b/src/testdir/test11.in
index 47de470a2d..9e9e257c1d 100644
--- a/src/testdir/test11.in
+++ b/src/testdir/test11.in
@@ -46,13 +46,13 @@ STARTTEST
 :w>>test.out                    " Append it to the output file
 :set shelltemp                  " need temp files here
 :au FilterReadPre   *.out  call rename(expand("<afile>"), expand("<afile>") . ".t")
-:au FilterReadPre   *.out  exe '!sed s/e/E/ ' . shellescape(expand("<afile>")) . ".t >" . shellescape(expand("<afile>"))
-:au FilterReadPre   *.out  exe '!rm ' . shellescape(expand("<afile>")) . '.t'
+:au FilterReadPre   *.out  exe 'silent !sed s/e/E/ ' . shellescape(expand("<afile>")) . ".t >" . shellescape(expand("<afile>"))
+:au FilterReadPre   *.out  exe 'silent !rm ' . shellescape(expand("<afile>")) . '.t'
 :au FilterReadPost  *.out  '[,']s/x/X/g
 :e! test.out                    " Edit the output file
 :23,$!cat
 :23,$s/\r$//                 " remove CR for when sed adds them
-:au! FileReadPre    *.gz   exe '!gzip -d ' . shellescape(expand("<afile>"))
+:au! FileReadPre    *.gz   exe 'silent !gzip -d ' . shellescape(expand("<afile>"))
 :au  FileReadPre    *.gz   call rename(expand("<afile>:r"), expand("<afile>"))
 :au! FileReadPost   *.gz   '[,']s/l/L/
 :$r Xtestfile.gz             " Read compressed file
diff --git a/src/version.c b/src/version.c
index 8d1e4a0dd9..fca5cb6536 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    470,
 /**/
     469,
 /**/

From 4ff52c362e278d29dc54e684976085d5d25a4337 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 15:37:06 +0200
Subject: [PATCH 182/473] Added tag v7-4-470 for changeset 9d5b8b015e5f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5baceefebf..80e2b5c48d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3192,3 +3192,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 0a4efa3d20197cdf0bfe93080abc7cd197878e9a v7-4-467
 4f7f236d773d21e46ffa6c38d8df110d11413dca v7-4-468
 a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
+9d5b8b015e5f32b84e0d74f21481b0cea2b84975 v7-4-470

From 4ad095bc498049e98967af70476afe555413af19 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 17:05:56 +0200
Subject: [PATCH 183/473] updated for version 7.4.471 Problem:    MS-Windows:
 When printer name contains multi-byte, the name is 	    displayed as ???.
 Solution:   Convert the printer name from the active codepage to 'encoding'. 
     (Yasuhiro Matsumoto)

---
 src/os_mswin.c | 22 ++++++++++++++++++++++
 src/version.c  |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/src/os_mswin.c b/src/os_mswin.c
index 9151aef414..dff0939764 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1635,11 +1635,33 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
 	char_u	*printer_name = (char_u *)devname + devname->wDeviceOffset;
 	char_u	*port_name = (char_u *)devname +devname->wOutputOffset;
 	char_u	*text = _("to %s on %s");
+#ifdef FEAT_MBYTE
+	char_u  *printer_name_orig = printer_name;
+	char_u	*port_name_orig = port_name;
 
+	if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+	{
+	    char_u  *to_free = NULL;
+	    int     maxlen;
+
+	    acp_to_enc(printer_name, STRLEN(printer_name), &to_free, &maxlen);
+	    if (to_free != NULL)
+		printer_name = to_free;
+	    acp_to_enc(port_name, STRLEN(port_name), &to_free, &maxlen);
+	    if (to_free != NULL)
+		port_name = to_free;
+	}
+#endif
 	prt_name = alloc((unsigned)(STRLEN(printer_name) + STRLEN(port_name)
 							     + STRLEN(text)));
 	if (prt_name != NULL)
 	    wsprintf(prt_name, text, printer_name, port_name);
+#ifdef FEAT_MBYTE
+	if (printer_name != printer_name_orig)
+	    vim_free(printer_name);
+	if (port_name != port_name_orig)
+	    vim_free(port_name);
+#endif
     }
     GlobalUnlock(prt_dlg.hDevNames);
 
diff --git a/src/version.c b/src/version.c
index fca5cb6536..3be907b118 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    471,
 /**/
     470,
 /**/

From 78ec92f06c5d560666c0ff2fb425ff4ffc55e11c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 9 Oct 2014 17:05:56 +0200
Subject: [PATCH 184/473] Added tag v7-4-471 for changeset 3005da486a71

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 80e2b5c48d..5f7746658b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3193,3 +3193,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 4f7f236d773d21e46ffa6c38d8df110d11413dca v7-4-468
 a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
 9d5b8b015e5f32b84e0d74f21481b0cea2b84975 v7-4-470
+3005da486a71dc1171b3c8fe075701ea5e4b5668 v7-4-471

From 816f38ac7c4eef5831b5839d7c000304b7b72e82 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 10 Oct 2014 15:28:46 +0200
Subject: [PATCH 185/473] updated for version 7.4.472 Problem:    The
 "precedes" entry in 'listchar' will be drawn when 'showbreak 	    is set and
 list is not. Solution:   Only draw this character when 'list' is on.
 (Christian Brabandt)

---
 src/screen.c  | 1 +
 src/version.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/screen.c b/src/screen.c
index fae2703f71..36afc2dcda 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4901,6 +4901,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 	 * special character (via 'listchars' option "precedes:<char>".
 	 */
 	if (lcs_prec_todo != NUL
+		&& wp->w_p_list
 		&& (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0)
 #ifdef FEAT_DIFF
 		&& filler_todo <= 0
diff --git a/src/version.c b/src/version.c
index 3be907b118..f22d195a1b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    472,
 /**/
     471,
 /**/

From ee0262bfd62d7123ef00eeaf62d9a840a778e31b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 10 Oct 2014 15:28:46 +0200
Subject: [PATCH 186/473] Added tag v7-4-472 for changeset af998690a884

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5f7746658b..c76a0d930b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3194,3 +3194,4 @@ c0d93d67572b2d4161d0c5a5ab09477d6447ff49 v7-4-462
 a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
 9d5b8b015e5f32b84e0d74f21481b0cea2b84975 v7-4-470
 3005da486a71dc1171b3c8fe075701ea5e4b5668 v7-4-471
+af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472

From 1f389b6c20532d627124933c6406a0a44a5f86f1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 10 Oct 2014 15:34:33 +0200
Subject: [PATCH 187/473] updated for version 7.4.473 Problem:    Cursor
 movement is incorrect when there is a number 	    column/sign/fold column
 and 'sbr' is displayed. Solution:   Adjust the column for 'sbr'. (Christian
 Brabandt)

---
 src/charset.c | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/charset.c b/src/charset.c
index fcc41ec334..006caa2a50 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1184,6 +1184,8 @@ win_lbr_chartabsize(wp, line, s, col, headp)
 	{
 	    col -= W_WIDTH(wp);
 	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
+	    if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr))
+		col -= (colnr_T)STRLEN(p_sbr);
 	    if (numberextra > 0)
 		col = col % numberextra;
 	}
diff --git a/src/version.c b/src/version.c
index f22d195a1b..d7c4cc0999 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    473,
 /**/
     472,
 /**/

From b1dae06cb9a8e13c789d50b5e8d4b645a025afc9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 10 Oct 2014 15:34:33 +0200
Subject: [PATCH 188/473] Added tag v7-4-473 for changeset 1cdd5804b538

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c76a0d930b..9acd0257f9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3195,3 +3195,4 @@ a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
 9d5b8b015e5f32b84e0d74f21481b0cea2b84975 v7-4-470
 3005da486a71dc1171b3c8fe075701ea5e4b5668 v7-4-471
 af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
+1cdd5804b538d578d71c9d85fddf8805cb200663 v7-4-473

From b6abdb2901e15ac31918178ac537a166e75c3904 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 11 Oct 2014 12:48:26 +0200
Subject: [PATCH 189/473] updated for version 7.4.474 Problem:    AIX compiler
 can't handle // comment.  Issue 265. Solution:   Remove that line.

---
 src/regexp_nfa.c | 1 -
 src/version.c    | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 6531d45fd1..37635662bc 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4407,7 +4407,6 @@ addstate(l, state, subs_arg, pim, off)
     switch (state->c)
     {
 	case NFA_MATCH:
-//	    nfa_match = TRUE;
 	    break;
 
 	case NFA_SPLIT:
diff --git a/src/version.c b/src/version.c
index d7c4cc0999..89088200df 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    474,
 /**/
     473,
 /**/

From 91aa0b258f307c7673476a1933447331a215689a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 11 Oct 2014 12:48:26 +0200
Subject: [PATCH 190/473] Added tag v7-4-474 for changeset 7f2472960aa1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9acd0257f9..0df40f05e1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3196,3 +3196,4 @@ a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
 3005da486a71dc1171b3c8fe075701ea5e4b5668 v7-4-471
 af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 1cdd5804b538d578d71c9d85fddf8805cb200663 v7-4-473
+7f2472960aa114ee650fbac399b4561f1d43251b v7-4-474

From fee386cb6c024da9dcb8a6824d2abefda1b9fc9b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 11 Oct 2014 14:47:26 +0200
Subject: [PATCH 191/473] updated for version 7.4.475 Problem:    Can't compile
 on a system where Xutf8SetWMProperties() is not in 	    the X11 library. 
 Issue 265. Solution:   Add a configure check.

---
 src/auto/configure | 53 ++++++++++++++++++++++++++++++++++++----------
 src/config.h.in    |  3 +++
 src/configure.in   | 29 +++++++++++++------------
 src/os_unix.c      |  7 ++++--
 src/version.c      |  2 ++
 5 files changed, 68 insertions(+), 26 deletions(-)

diff --git a/src/auto/configure b/src/auto/configure
index b0fba306e6..f5195b2462 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -12732,16 +12732,15 @@ $as_echo "$vim_cv_memcpy_handles_overlap" >&6; }
 fi
 
 
-
-if test "$enable_multibyte" = "yes"; then
+if test "x$with_x" = "xyes"; then
   cflags_save=$CFLAGS
-  ldflags_save=$LDFLAGS
-  if test "x$x_includes" != "xNONE" ; then
-    CFLAGS="$CFLAGS -I$x_includes"
-    LDFLAGS="$X_LIBS $LDFLAGS -lX11"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
+  libs_save=$LIBS
+  LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
+  CFLAGS="$CFLAGS $X_CFLAGS"
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether X_LOCALE needed" >&5
 $as_echo_n "checking whether X_LOCALE needed... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <X11/Xlocale.h>
 int
@@ -12774,7 +12773,7 @@ _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
-		$as_echo "#define X_LOCALE 1" >>confdefs.h
+	      $as_echo "#define X_LOCALE 1" >>confdefs.h
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -12787,9 +12786,41 @@ else
 $as_echo "no" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xutf8SetWMProperties() can be used" >&5
+$as_echo_n "checking whether Xutf8SetWMProperties() can be used... " >&6; }
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char Xutf8SetWMProperties ();
+int
+main ()
+{
+return Xutf8SetWMProperties ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	      $as_echo "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
   CFLAGS=$cflags_save
-  LDFLAGS=$ldflags_save
+  LIBS=$libs_save
 fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _xpg4_setrunelocale in -lxpg4" >&5
diff --git a/src/config.h.in b/src/config.h.in
index 7f16e622aa..b8168a55f6 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -446,3 +446,6 @@
 
 /* Define if we have AvailabilityMacros.h on Mac OS X */
 #undef HAVE_AVAILABILITYMACROS_H
+
+/* Define if Xutf8SetWMProperties() is in an X library. */
+#undef HAVE_XUTF8SETWMPROPERTIES
diff --git a/src/configure.in b/src/configure.in
index 62785e171c..ff1f4824b4 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -3730,21 +3730,24 @@ fi
 dnl Check for multibyte locale functions
 dnl Find out if _Xsetlocale() is supported by libX11.
 dnl Check if X_LOCALE should be defined.
-
-if test "$enable_multibyte" = "yes"; then
+if test "x$with_x" = "xyes"; then
   cflags_save=$CFLAGS
-  ldflags_save=$LDFLAGS
-  if test "x$x_includes" != "xNONE" ; then
-    CFLAGS="$CFLAGS -I$x_includes"
-    LDFLAGS="$X_LIBS $LDFLAGS -lX11"
-    AC_MSG_CHECKING(whether X_LOCALE needed)
-    AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
-	AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
-		AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
-	AC_MSG_RESULT(no))
-  fi
+  libs_save=$LIBS
+  LIBS="$LIBS $X_LIBS $GUI_LIB_LOC $GUI_X_LIBS $X_PRE_LIBS $X_LIB $X_EXTRA_LIBS"
+  CFLAGS="$CFLAGS $X_CFLAGS"
+
+  AC_MSG_CHECKING(whether X_LOCALE needed)
+  AC_TRY_COMPILE([#include <X11/Xlocale.h>],,
+      AC_TRY_LINK_FUNC([_Xsetlocale], [AC_MSG_RESULT(yes)
+	      AC_DEFINE(X_LOCALE)], AC_MSG_RESULT(no)),
+      AC_MSG_RESULT(no))
+
+  AC_MSG_CHECKING(whether Xutf8SetWMProperties() can be used)
+  AC_TRY_LINK_FUNC([Xutf8SetWMProperties], [AC_MSG_RESULT(yes)
+	      AC_DEFINE(HAVE_XUTF8SETWMPROPERTIES)], AC_MSG_RESULT(no))
+
   CFLAGS=$cflags_save
-  LDFLAGS=$ldflags_save
+  LIBS=$libs_save
 fi
 
 dnl Link with xpg4, it is said to make Korean locale working
diff --git a/src/os_unix.c b/src/os_unix.c
index b49afc3f8a..6209605cfa 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1960,9 +1960,12 @@ get_x11_thing(get_title, test_only)
     return retval;
 }
 
-/* Are Xutf8 functions available?  Avoid error from old compilers. */
+/* Xutf8 functions are not avaialble on older systems. Note that on some
+ * systems X_HAVE_UTF8_STRING may be defined in a header file but
+ * Xutf8SetWMProperties() is not in the X11 library.  Configure checks for
+ * that and defines HAVE_XUTF8SETWMPROPERTIES. */
 #if defined(X_HAVE_UTF8_STRING) && defined(FEAT_MBYTE)
-# if X_HAVE_UTF8_STRING
+# if X_HAVE_UTF8_STRING && HAVE_XUTF8SETWMPROPERTIES
 #  define USE_UTF8_STRING
 # endif
 #endif
diff --git a/src/version.c b/src/version.c
index 89088200df..78c3baa2a1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    475,
 /**/
     474,
 /**/

From 73187ed8f90cebd75d92a0e94df217d2d58660f0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 11 Oct 2014 14:47:26 +0200
Subject: [PATCH 192/473] Added tag v7-4-475 for changeset 0446fa17bd95

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0df40f05e1..f5e7d6337d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3197,3 +3197,4 @@ a6f5a4ac4d4666282179339abe696d7689f8681b v7-4-469
 af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 1cdd5804b538d578d71c9d85fddf8805cb200663 v7-4-473
 7f2472960aa114ee650fbac399b4561f1d43251b v7-4-474
+0446fa17bd95cdb37cd0c14ada32818b43577597 v7-4-475

From e72ce10db2a84ea0960c06c0965f902a176258be Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 12:07:11 +0200
Subject: [PATCH 193/473] updated for version 7.4.476 Problem:    MingW:
 compiling with "XPM=no" doesn't work. Solution:   Check for the "no" value.
 (KF Leong)  Also for Cygwin. (Ken 	    Takata)

---
 src/Make_cyg.mak  | 2 +-
 src/Make_ming.mak | 4 ++--
 src/version.c     | 2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index 4b9985f70a..abd35a6a42 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -485,7 +485,7 @@ USE_STDCPLUS = yes
 endif
 
 ##############################
-ifdef XPM
+ifneq ($(XPM),no)
 # Only allow XPM for a GUI build.
 DEFINES += -DFEAT_XPM_W32
 INCLUDES += -I$(XPM)/include
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index 82988629ee..19b4c2fe3d 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -22,7 +22,7 @@
 #     http://www.matcode.com/mpress.htm
 #
 # Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
-# Updated 2012 Sep 5.
+# Updated 2014 Oct 13.
 
 #>>>>> choose options:
 # set to yes for a debug build
@@ -613,7 +613,7 @@ LIB += -ld2d1 -ldwrite
 USE_STDCPLUS = yes
 endif
 endif
-ifdef XPM
+ifneq ($(XPM),no)
 # Only allow XPM for a GUI build.
 ifeq (yes, $(GUI))
 OBJ += $(OUTDIR)/xpm_w32.o
diff --git a/src/version.c b/src/version.c
index 78c3baa2a1..c4f560b07c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    476,
 /**/
     475,
 /**/

From 996a59d5af09be0ff3920bf5ac46c6689cda7a0e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 12:07:11 +0200
Subject: [PATCH 194/473] Added tag v7-4-476 for changeset 4c29b75cae19

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f5e7d6337d..ba85b5658c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3198,3 +3198,4 @@ af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 1cdd5804b538d578d71c9d85fddf8805cb200663 v7-4-473
 7f2472960aa114ee650fbac399b4561f1d43251b v7-4-474
 0446fa17bd95cdb37cd0c14ada32818b43577597 v7-4-475
+4c29b75cae193c039f44ad438f772f8af19d2bb3 v7-4-476

From 24445e01891dd26cdf062ef64bc1ef7021df182a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 12:56:49 +0200
Subject: [PATCH 195/473] updated for version 7.4.477 Problem:    When using
 ":%diffput" and the other file is empty an extra empty 	    line
 remains. Solution:   Set the buf_empty flag.

---
 src/diff.c    | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/diff.c b/src/diff.c
index 98b791a720..d324f99d87 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2325,7 +2325,7 @@ ex_diffgetput(eap)
 		    end_skip = 0;
 	    }
 
-	    buf_empty = FALSE;
+	    buf_empty = bufempty();
 	    added = 0;
 	    for (i = 0; i < count; ++i)
 	    {
diff --git a/src/version.c b/src/version.c
index c4f560b07c..d233c24e9a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    477,
 /**/
     476,
 /**/

From 7cf8cee8bb0acf8593aea183b14b2487876172a9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 12:56:49 +0200
Subject: [PATCH 196/473] Added tag v7-4-477 for changeset f21a2f67bdbb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ba85b5658c..7f40b1df07 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3199,3 +3199,4 @@ af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 7f2472960aa114ee650fbac399b4561f1d43251b v7-4-474
 0446fa17bd95cdb37cd0c14ada32818b43577597 v7-4-475
 4c29b75cae193c039f44ad438f772f8af19d2bb3 v7-4-476
+f21a2f67bdbb7bb7c5c2352186757c3fd2471ce2 v7-4-477

From a31f979bc7f2fc6a868865f73c907edf465ca820 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 21:26:40 +0200
Subject: [PATCH 197/473] updated for version 7.4.478 Problem:    Using byte
 length instead of character length for 'showbreak'. Solution:   Compute the
 character length. (Marco Hinz)

---
 src/charset.c | 8 ++++++--
 src/version.c | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/charset.c b/src/charset.c
index 006caa2a50..918f9a5142 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1184,8 +1184,12 @@ win_lbr_chartabsize(wp, line, s, col, headp)
 	{
 	    col -= W_WIDTH(wp);
 	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
-	    if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr))
-		col -= (colnr_T)STRLEN(p_sbr);
+	    if (*p_sbr != NUL)
+	    {
+		colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
+		if (col >= sbrlen)
+		    col -= sbrlen;
+	    }
 	    if (numberextra > 0)
 		col = col % numberextra;
 	}
diff --git a/src/version.c b/src/version.c
index d233c24e9a..fed16aa170 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    478,
 /**/
     477,
 /**/

From 6185b1d46803cd339e4ac450c0727d2992f5b86d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 21:26:40 +0200
Subject: [PATCH 198/473] Added tag v7-4-478 for changeset fcb898dea2bc

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7f40b1df07..a06cc24394 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3200,3 +3200,4 @@ af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 0446fa17bd95cdb37cd0c14ada32818b43577597 v7-4-475
 4c29b75cae193c039f44ad438f772f8af19d2bb3 v7-4-476
 f21a2f67bdbb7bb7c5c2352186757c3fd2471ce2 v7-4-477
+fcb898dea2bc8b6e89172cb48ef26c56cb79cfdd v7-4-478

From 8954c17455eab9d6313153161b1153ca037e054d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 22:50:10 +0200
Subject: [PATCH 199/473] updated for version 7.4.479 Problem:    MS-Windows:
 The console title can be wrong. Solution:   Take the encoding into account.
 When restoring the title use the 	    right function. (Yasuhiro
 Matsumoto)

---
 src/os_mswin.c |  2 +-
 src/os_win32.c | 31 ++++++++++++++++++++++++++++++-
 src/version.c  |  2 ++
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/os_mswin.c b/src/os_mswin.c
index dff0939764..dfd40af8de 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -344,7 +344,7 @@ mch_restore_title(
     int which)
 {
 #ifndef FEAT_GUI_MSWIN
-    mch_settitle((which & 1) ? g_szOrigTitle : NULL, NULL);
+    SetConsoleTitle(g_szOrigTitle);
 #endif
 }
 
diff --git a/src/os_win32.c b/src/os_win32.c
index eb66ed2d2b..a831ada54c 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4648,6 +4648,35 @@ mch_call_shell(
 #ifdef FEAT_TITLE
     char szShellTitle[512];
 
+# ifdef FEAT_MBYTE
+    /* Change the title to reflect that we are in a subshell. */
+    if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+    {
+	WCHAR szShellTitle[512];
+
+	if (GetConsoleTitleW(szShellTitle,
+				  sizeof(szShellTitle)/sizeof(WCHAR) - 4) > 0)
+	{
+	    if (cmd == NULL)
+		wcscat(szShellTitle, L" :sh");
+	    else
+	    {
+		WCHAR *wn = enc_to_utf16(cmd, NULL);
+
+		if (wn != NULL)
+		{
+		    wcscat(szShellTitle, L" - !");
+		    if ((wcslen(szShellTitle) + wcslen(wn) <
+					  sizeof(szShellTitle)/sizeof(WCHAR)))
+			wcscat(szShellTitle, wn);
+		    SetConsoleTitleW(szShellTitle);
+		    vim_free(wn);
+		    goto didset;
+		}
+	    }
+	}
+    }
+#endif
     /* Change the title to reflect that we are in a subshell. */
     if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
     {
@@ -4659,7 +4688,7 @@ mch_call_shell(
 	    if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
 		strcat(szShellTitle, cmd);
 	}
-	mch_settitle(szShellTitle, NULL);
+	SetConsoleTitle(szShellTitle);
     }
 #endif
 
diff --git a/src/version.c b/src/version.c
index fed16aa170..3388fafec6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    479,
 /**/
     478,
 /**/

From ed1207e5d5d370699b5d1da755418920fd3f86aa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 22:50:10 +0200
Subject: [PATCH 200/473] Added tag v7-4-479 for changeset e0f2ed0efb49

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a06cc24394..3d11c64162 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3201,3 +3201,4 @@ af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 4c29b75cae193c039f44ad438f772f8af19d2bb3 v7-4-476
 f21a2f67bdbb7bb7c5c2352186757c3fd2471ce2 v7-4-477
 fcb898dea2bc8b6e89172cb48ef26c56cb79cfdd v7-4-478
+e0f2ed0efb49d1d01b978f8a7f0db5cc8813cb1b v7-4-479

From a55da9c682d0cef4ade764cc3e60a0953d67550a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 15 Oct 2014 22:51:52 +0200
Subject: [PATCH 201/473] Update runtime files and translations.

---
 runtime/doc/map.txt                  |  10 +-
 runtime/doc/todo.txt                 |  83 ++-
 runtime/filetype.vim                 |   8 +-
 runtime/lang/menu_chinese_gb.936.vim |  22 +-
 runtime/lang/menu_zh_cn.gb2312.vim   |   8 +-
 runtime/lang/menu_zh_cn.utf-8.vim    |   8 +-
 runtime/optwin.vim                   |   4 +-
 runtime/syntax/j.vim                 |  42 +-
 runtime/syntax/rst.vim               |  13 +-
 runtime/tutor/tutor.ru               | 979 ++++++++++++++++-----------
 runtime/tutor/tutor.ru.cp1251        | 979 ++++++++++++++++-----------
 runtime/tutor/tutor.ru.utf-8         | 979 ++++++++++++++++-----------
 src/po/ru.cp1251.po                  |  99 ++-
 src/po/ru.po                         |  99 ++-
 14 files changed, 1992 insertions(+), 1341 deletions(-)

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 5f1c4a6261..1be2827c2c 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt*       For Vim version 7.4.  Last change: 2014 Sep 30
+*map.txt*       For Vim version 7.4.  Last change: 2014 Oct 03
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -923,9 +923,11 @@ Examples: ({CURSOR} is where you type a non-keyword character) >
 <		"test;;"	  is not expanded
 		"test ;;"	  is expanded to "test <endofline>"
 
-To avoid the abbreviation in insert mode: Type part of the abbreviation, exit
-insert mode with <Esc>, re-enter insert mode with "a" and type the rest.  Or
-type CTRL-V before the character after the abbreviation.
+To avoid the abbreviation in Insert mode: Type CTRL-V before the character
+that would trigger the abbreviation.  E.g. CTRL-V <Space>.  Or type part of
+the abbreviation, exit insert mode with <Esc>, re-enter insert mode with "a"
+and type the rest.
+
 To avoid the abbreviation in Command-line mode: Type CTRL-V twice somewhere in
 the abbreviation to avoid it to be replaced.  A CTRL-V in front of a normal
 character is mostly ignored otherwise.
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 62bd2d5fc0..daf5270e5a 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Oct 02
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Oct 15
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -35,6 +35,8 @@ not be repeated below, unless there is extra information.
 -------------------- Known bugs and current work -----------------------
 
 Regexp problems:
+- The NFA engine does not implement the time limit passed to
+  nfa_regexec_multi()
 - Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
   (Lech Lorens, 2014 Feb 3)
 - Issue 164: freeze on regexp search.
@@ -58,15 +60,6 @@ Patch to make getregtype() return the right size for non-linux systems.
 (Yasuhiro Matsumoto, 2014 Jul 8)
 Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 
-Patch to fix 'linebreak' when applying an operator.  And fix the test not
-actually testing. (Christian Brabandt, 2014 Sep 23)
-
-patch to fix issue 26. (Christian)
-
-Test 11 and 100 do not work properly on Windows.
-Patch by Ken Takata (2014 Sep 25)
-Alternative patch Oct 1.
-
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
@@ -74,15 +67,9 @@ Patch to avoid problems with encoding conversion with diff.vim.
 (Yasuhiro Matsumoto, 2014 Sep 1.
 Depends on current language, language of file can be different.
 
-Add books from Steve Oualline to Vim website. (2014 Sep 25)
-
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
-Patch to have the fold and sign column and at the last line of the buffer.
-(Marco Hinz, 2014 Sep 25)
-Alternate suggestion: let all columns continue, also number column.
-
 Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
 14, Aug 30)
     Make ":1close" close the first window.
@@ -90,28 +77,31 @@ Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
     Make ":-1close" close the previous window.
 Doesn't look right, asked for updates.
 
-Patch to handle multi-byte printer name on MS-Windows. (Yasuhiro Matsumoto,
-2014 Sept 28)
-
-Two patches by Christian, 2014 Sep 29:
-- Combination of precedes listchar and 'showbreak' doesn't work well.
-- Moving cursor is off when 'nu' and 'sbr' are set.
-
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
-Patch to fix window title for a command window on MS-Windows. (Yasuhiro
-Matsumoto, 2014 Sep 28)
-
 Patch to fix that 0x80 in abbreviation isn't handled correctly.
 (Christian Brabandt, 2014 Oct 1)
 
+Check for valid yank reg seems wrong.  Patch by Zyx, 2014 Oct 12.
+
+":sign-jump" uses first window in buffer instead of current window.
+Patch by James McCoy, 2013 Nov 22.  Update 2014 Oct 5.
+
 Patch to fix issue 57, on the issue.
 
 Patch for issue 101, maintainer unreachable.
 
+Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
+
+Patch to fix that last_changedtick is not update on saving. (Christian
+Brabandt, 2014 Oct 10, second one)
+
+substitute() can be slow with long strings.  Patch by Ozaki Kiichi, 2014 Oct
+12.
+
 Remove restriction in NSIS installer that the end of the path must be "Vim".
-(Tim Lebedkov, 2014 Sep 24)
+(Tim Lebedkov, 2014 Sep 24) Again Oct 12.
 
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
@@ -119,6 +109,14 @@ Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
 'foldexpr' applies to help. (Paul Marshall, 2014 Sep 24)
 
+Patch to fix issue 203. (Christian Brabandt, 2014 Oct 8)
+
+Patch to fix issue 253. (Christian Brabandt, 2014 Oct 8)
+
+Patch to fix issue 78. (Christian Brabandt, 2014 Oct 8)
+
+Patch to fix leak in map() with error. (Christian Brabandt, 2014 Oct 11)
+
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
@@ -142,9 +140,19 @@ Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
 Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
 
+Patch for building a 32bit Vim with 64bit MingW compiler.
+(Michael Soyka, 2014 Oct 15)
+
+Delete old code in os_msdos.c, mch_FullName().
+
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
 Jun 8)
 
+Patch to switch to the BT regexp engine when the NFA engine uses many states.
+(Christian Brabandt, 2014 Oct 3)
+
+Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
+
 No error for missing endwhile. (ZyX, 2014 Mar 20)
 
 start_global_changes() plus end_global_changes() causes problem for
@@ -338,9 +346,6 @@ buffer. (2013 Dec 9)
 Patch for drag&drop reordering of GUI tab pages reordering.
 (Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
 
-":sign-jump" uses first window in buffer instead of current window.
-Patch by James McCoy, 2013 Nov 22.
-
 GTK: problem with 'L' in 'guioptions' changing the window width.
 (Aaron Cornelius, 2012 Feb 6)
 
@@ -414,7 +419,7 @@ Patch to allow setting w:quickfix_title via setqflist() and setloclist()
 functions. (Christian Brabandt, 2013 May 8, update May 21)
 Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
 Second one. Update May 22.
-Update by Daniel Hahler, 2014 Jul 4, Aug 14.
+Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
 
 Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
 
@@ -551,6 +556,10 @@ URXVT:
 - Use urxvt mouse support also in xterm.  Explanations:
   http://www.midnight-commander.org/ticket/2662
 
+Patch to have the fold and sign column and at the last line of the buffer.
+(Marco Hinz, 2014 Sep 25)
+Alternate suggestion: let all columns continue, also the number column.
+
 Patch to add tests for if_xcmdsrv.c., Jul 8, need some more work. (Brian Burns)
 New tests Jul 13.   Update Jul 17.  Discussion Jul 18.
 
@@ -1007,6 +1016,12 @@ to avoid changing 'eventignore'?
 Patch for displaying 0x200c and 0x200d. (Ali Gholami Rudi, 2009 May 6)
 Probably needs a bit of work.
 
+Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
+Added test, updates, June 23.
+Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
+With modification for Tatweel character: https://dpaste.de/VmFw
+Remark from Ameretat Reith (2014 Oct 13)
+
 List of encoding aliases. (Takao Fujiwara, 2009 Jul 18)
 Are they all OK?  Update Jul 22.
 
@@ -1025,10 +1040,6 @@ on the first character. (John Beckett, 2010 Aug 7)
 Setting 'tags' to "tagsdir/*" does not find "tagsdir/tags". (Steven K. Wong,
 2009 Jul 18)
 
-Patch to add farsi handling to arabic.c (Ali Gholami Rudi, 2009 May 2)
-Added test, updates, June 23.
-Updated for 7.4: http://litcave.rudi.ir/farsi_vim.diff
-
 Patch to add "focusonly" to 'scrollopt', so that scrollbind also applies in
 window that doesn't have focus. (Jonathon Mah, 2009 Jan 12)
 Needs more work.
@@ -1960,7 +1971,7 @@ More patches:
 -   testdir/Make_dos_sh.mak for running tests with MingW. (Bill Mccarthy, 2008
     Sep 13)
 -   Patch for adding "space" item in 'listchars'. (Jérémie Roquet, 2009 Oct 29,
-    Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24)
+    Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24, 2014 Oct 10)
 -   Replace ccomplete.vim by cppcomplete.vim from www.vim.org?  script 1520 by
     Vissale Neang.  (Martin Stubenschrott) Asked Vissale to make the scripts
     more friendly for the Vim distribution.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 67d3a88288..67d1674537 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Sep 05
+" Last Change:	2014 Oct 09
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1151,7 +1151,7 @@ au BufNewFile,BufRead *.mv,*.mpl,*.mws		setf maple
 au BufNewFile,BufRead *.map			setf map
 
 " Markdown
-au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,README.md  setf markdown
+au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md  setf markdown
 
 " Mason
 au BufNewFile,BufRead *.mason,*.mhtml,*.comp	setf mason
@@ -1243,8 +1243,8 @@ au BufNewFile,BufRead *.mod
 	\   setf modsim3 |
 	\ endif
 
-" Modula 2
-au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.md,*.mi setf modula2
+" Modula 2  (.md removed in favor of Markdown)
+au BufNewFile,BufRead *.m2,*.DEF,*.MOD,*.mi	setf modula2
 
 " Modula 3 (.m3, .i3, .mg, .ig)
 au BufNewFile,BufRead *.[mi][3g]		setf modula3
diff --git a/runtime/lang/menu_chinese_gb.936.vim b/runtime/lang/menu_chinese_gb.936.vim
index e636a42319..b3276b5365 100644
--- a/runtime/lang/menu_chinese_gb.936.vim
+++ b/runtime/lang/menu_chinese_gb.936.vim
@@ -1,6 +1,7 @@
-" Menu Translations:	Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By:	Yuheng Xie <elephant@linux.net.cn>
-" Last Change:		Tue Apr 18 22:00:00 2006
+" Menu Translations:    Simplified Chinese
+" Maintainer:           Shun Bai <baishunde@gmail.com>
+" Previous Maintainer:  Yuheng Xie <elephant@linux.net.cn>
+" Last Change:          2014 Oct 15
 
 " vim: ts=8 sw=8 noet
 
@@ -90,13 +91,14 @@ menutrans Toggle\ &Right\ Scrollbar		
 menutrans F&ile\ Settings			�ļ��趨(&I)
 
 " Boolean options
-menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!	��/����ʾ�к�(&N)<Tab>:set\ nu!
-menutrans Toggle\ &List\ Mode<Tab>:set\ list!		��/��\ list\ ģʽ(&L)<Tab>:set\ list!
-menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!		��/������(&W)<Tab>:set\ wrap!
-menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!	��/����������(&R)<Tab>:set\ lbr!
-menutrans Toggle\ &expand-tab<Tab>:set\ et!		��/����չ\ tab(&E)<Tab>:set\ et!
-menutrans Toggle\ &auto-indent<Tab>:set\ ai!		��/���Զ�����(&A)<Tab>:set\ ai!
-menutrans Toggle\ &C-indenting<Tab>:set\ cin!		��/��\ C\ ����(&C)<Tab>:set\ cin!
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!		��/����ʾ�к�(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu!	��/������к�(&V)<Tab>:set\ rnu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list!			��/��\ list\ ģʽ(&L)<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!			��/������(&W)<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!		��/����������(&R)<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et!			��/����չ\ tab(&E)<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai!			��/���Զ�����(&A)<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin!			��/��\ C\ ����(&C)<Tab>:set\ cin!
 
 " other options
 menutrans &Shiftwidth			��������(&S)
diff --git a/runtime/lang/menu_zh_cn.gb2312.vim b/runtime/lang/menu_zh_cn.gb2312.vim
index a12d94daf5..0df51885f0 100644
--- a/runtime/lang/menu_zh_cn.gb2312.vim
+++ b/runtime/lang/menu_zh_cn.gb2312.vim
@@ -1,6 +1,7 @@
-" Menu Translations:	Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By:	Yuheng Xie <elephant@linux.net.cn>
-" Last Change:		Tue Apr 18 22:00:00 2006
+" Menu Translations:    Simplified Chinese
+" Maintainer:           Shun Bai <baishunde@gmail.com>
+" Previous Maintainer:  Yuheng Xie <elephant@linux.net.cn>
+" Last Change:          2014 Oct 15
 
 " vim: ts=8 sw=8 noet
 
@@ -94,6 +95,7 @@ menutrans F&ile\ Settings			
 
 " Boolean options
 menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!	��/����ʾ�к�(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu! ��/������к�(&V)<Tab>:set\ rnu!
 menutrans Toggle\ &List\ Mode<Tab>:set\ list!		��/��\ list\ ģʽ(&L)<Tab>:set\ list!
 menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!		��/������(&W)<Tab>:set\ wrap!
 menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!	��/����������(&R)<Tab>:set\ lbr!
diff --git a/runtime/lang/menu_zh_cn.utf-8.vim b/runtime/lang/menu_zh_cn.utf-8.vim
index 956363d29c..cb1288f63e 100644
--- a/runtime/lang/menu_zh_cn.utf-8.vim
+++ b/runtime/lang/menu_zh_cn.utf-8.vim
@@ -1,6 +1,7 @@
-" Menu Translations:	Simplified Chinese <i18n-translation@lists.linux.net.cn>
-" Translated By:	Yuheng Xie <elephant@linux.net.cn>
-" Last Change:		Tue Apr 18 22:00:00 2006
+" Menu Translations:    Simplified Chinese
+" Maintainer:           Shun Bai <baishunde@gmail.com>
+" Previous Maintainer:  Yuheng Xie <elephant@linux.net.cn>
+" Last Change:          2014 Oct 15
 
 " vim: ts=8 sw=8 noet
 
@@ -91,6 +92,7 @@ menutrans F&ile\ Settings			文件设定(&I)
 
 " Boolean options
 menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu!	开/关显示行号(&N)<Tab>:set\ nu!
+menutrans Toggle\ relati&ve\ Line\ Numbering<Tab>:set\ rnu! 开/关相对行号(&V)<Tab>:set\ rnu!
 menutrans Toggle\ &List\ Mode<Tab>:set\ list!		开/关\ list\ 模式(&L)<Tab>:set\ list!
 menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap!		开/关折行(&W)<Tab>:set\ wrap!
 menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr!	开/关整词折行(&R)<Tab>:set\ lbr!
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index b51d58bad6..35f99c537c 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Aug 06
+" Last Change:	2014 Oct 09
 
 " If there already is an option window, jump to that one.
 if bufwinnr("option-window") > 0
@@ -728,6 +728,7 @@ call <SID>OptionG("km", &km)
 
 call <SID>Header("editing text")
 call append("$", "undolevels\tmaximum number of changes that can be undone")
+call append("$", "\t(global or local to buffer)")
 call append("$", " \tset ul=" . &ul)
 call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload")
 call append("$", " \tset ur=" . &ur)
@@ -977,6 +978,7 @@ call <SID>BinOptionG("bk", &bk)
 call append("$", "backupskip\tpatterns that specify for which files a backup is not made")
 call append("$", " \tset bsk=" . &bsk)
 call append("$", "backupcopy\twhether to make the backup as a copy or rename the existing file")
+call append("$", "\t(global or local to buffer)")
 call append("$", " \tset bkc=" . &bkc)
 call append("$", "backupdir\tlist of directories to put backup files in")
 call <SID>OptionG("bdir", &bdir)
diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim
index bde954506e..0cdd59b887 100644
--- a/runtime/syntax/j.vim
+++ b/runtime/syntax/j.vim
@@ -2,7 +2,7 @@
 " Language:	J
 " Maintainer:	David Bürgin <676c7473@gmail.com>
 " URL:		https://github.com/glts/vim-j
-" Last Change:	2014-05-25
+" Last Change:	2014-10-05
 
 if exists('b:current_syntax')
   finish
@@ -12,7 +12,7 @@ let s:save_cpo = &cpo
 set cpo&vim
 
 syntax case match
-syntax sync minlines=50
+syntax sync minlines=100
 
 syntax cluster jStdlibItems contains=jStdlibNoun,jStdlibAdverb,jStdlibConjunction,jStdlibVerb
 syntax cluster jPrimitiveItems contains=jNoun,jAdverb,jConjunction,jVerb,jCopula
@@ -30,26 +30,32 @@ syntax keyword jStdlibVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf an
 syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
 syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
 
-" Numbers. Matching J numbers is difficult. The regular expression used for
-" the general case roughly embodies this grammar sketch:
+" Numbers. Matching J numbers is difficult. In fact, the job cannot be done
+" with regular expressions alone. Below is a sketch of the pattern used. It
+" accepts most well-formed numbers and rejects most of the ill-formed ones.
+" See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
 "
-"     BASE     := /_?\d+(\.\d*)?([eE]_?\d+)?/
-"     RATIONAL := BASE  |  BASE r BASE
-"     COMPLEX  := BASE  |  BASE (j|a[dr]) BASE
-"     JNUMBER  := RATIONAL  |  RATIONAL [px] RATIONAL  |  COMPLEX  |  COMPLEX [px] COMPLEX
+" "double1" and "double2" patterns:
+"     (_?\d+(\.\d*)?|_\.\d+)([eE]_?\d+)?
+"     (_?\d+(\.\d*)?|_\.\d+|\.\d+)([eE]_?\d+)?
 "
-" The grammar is implemented as shown in this pseudo-regexp:
+" "rational1" and "rational2" patterns:
+"     \k<double1>(r\k<double2>)?|__?
+"     \k<double2>(r\k<double2>)?|__?
 "
-"        base         rational                       complex                       remainder
-"     /\< B  (  [r]B ([px]B([r]B)?)?  |  (j|a[dr])B ([px]B((j|a[dr])B)?)?  |  [px]B ((j|a[dr]|r)B)?  )?/
+" "complex1" and "complex2" patterns:
+"     \k<rational1>((j|a[dr])\k<rational2>)?
+"     \k<rational2>((j|a[dr])\k<rational2>)?
 "
-" All in all, a compromise between correctness and practicality had to be
-" made. See http://www.jsoftware.com/help/dictionary/dcons.htm for reference.
-syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/
-syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+\%(\.[0-9a-z]\+\)\=/
-syntax match jNumber /\<__\=\>/
-syntax match jNumber /\<_\./
-syntax match jNumber /\<_\=\d\+x\>/
+" "basevalue" pattern:
+"     _?[0-9a-z]+(\.[0-9a-z]*)?|_?\.[0-9a-z]+
+"
+" all numbers:
+"     \b\k<complex1>([px]\k<complex2>)?(b\k<basevalue>)?(?![0-9A-Za-z_.])
+syntax match jNumber /\<_\.[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<_\=\d\+x[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<\%(__\=r_\=\d\+\|_\=\d\+r__\=\)[0-9A-Za-z_.]\@!/
+syntax match jNumber /\<\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\%([px]\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\%(\%(j\|a[dr]\)\%(\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\%(r\%(_\=\d\+\%(\.\d*\)\=\|_\.\d\+\|\.\d\+\)\%([eE]_\=\d\+\)\=\)\=\|__\=\)\)\=\)\=\%(b\%(_\=[0-9a-z]\+\%(\.[0-9a-z]*\)\=\|_\=\.[0-9a-z]\+\)\)\=[0-9A-Za-z_.]\@!/
 
 syntax region jString oneline start=/'/ skip=/''/ end=/'/
 
diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim
index fce9e5dd3e..c1f25699e7 100644
--- a/runtime/syntax/rst.vim
+++ b/runtime/syntax/rst.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
-" Language:         reStructuredText documentation format
-" Maintainer:       Marshall Ward <marshall.ward@gmail.com>
+" Language: reStructuredText documentation format
+" Maintainer: Marshall Ward <marshall.ward@gmail.com>
 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision:  2014-08-23
+" Latest Revision: 2014-10-03
 
 if exists("b:current_syntax")
   finish
@@ -150,12 +150,19 @@ endif
 
 for code in g:rst_syntax_code_list
     unlet! b:current_syntax
+    " guard against setting 'isk' option which might cause problems (issue #108)
+    let prior_isk = &l:iskeyword
     exe 'syn include @rst'.code.' syntax/'.code.'.vim'
     exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold '
                 \.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)# '
                 \.'skip=#^$# '
                 \.'end=#^\z1\@!# contains=@NoSpell,@rst'.code
     exe 'syn cluster rstDirectives add=rstDirective'.code
+    " reset 'isk' setting, if it has been changed
+    if &l:iskeyword !=# prior_isk
+        let &l:iskeyword = prior_isk
+    endif
+    unlet! prior_isk
 endfor
 
 " TODO: Use better syncing.
diff --git a/runtime/tutor/tutor.ru b/runtime/tutor/tutor.ru
index 6fd74cf085..1194f60635 100644
--- a/runtime/tutor/tutor.ru
+++ b/runtime/tutor/tutor.ru
@@ -1,29 +1,32 @@
 ===============================================================================
-=    � � � � �   � � � � � � � � � �   �   � � � � � � �   VIM  -  ������ 1.5 =
+=   � � � � �   � � � � � � � � � �   �   � � � � � � �   VIM  --  ������ 1.7 =
 ===============================================================================
-     Vim --- ��� ����� ������ ��������, ������� ��������� ������, �������
-     ����� ��� ����, ����� �� ��� ����� ���� ������� � ����� ��������, ���
-     ����. ���� ������� ������� ��������� ����������� ����� ������ ��� ����,
-     ����� �� ����� � ��������� ������������ Vim � �������� ��������� ������
+
+     Vim -- ��� ����� ������ ��������, ������� ��������� ������, ������� �����
+     ��� ����, ����� �� ��� ����� ���� ������� � ����� ��������, ��� ����.
+     ���� ������� ������� ��������� ����������� ����� ������ ��� ����, �����
+     �� ����� � ̣������� ������������ Vim � �������� ��������� ������
      ����������.
 
      ��� ����������� �������������� 25-30 ����� �� �������� ������� �������� �
-     ����������� �� ����, ������� ������� �� ��������� �� ������������.
+     ����������� �� ����, ������� ������� �� ��������� �� ������������.
 
-     ������� � ������ ����� �������������� �����. �������� ����� ����� �����,
-     ����� ���������������� �� ��� (���� �� ��������� "vimtutor", �� ��� ���
-     �����).
+     ��������! ��������� � ������ �� ������ �������� ���� �����. ��������
+     ����� ����� �����, ����� ���������������� �� ��� (���� �� ���������
+     "vimtutor", �� ��� ��� �����).
 
      ����� �������, ��� ���� ������� ������������ ��� �������� � ��������
-     �������������. ��� ��������, ��� �� ������ ��������� ������� ��� ����,
-     ����� ��� ������� �� �������. ���� �� ������ ���������� �����, ��
-     �������� �������!
+     �������������. ��� ��������, ��� �� ������ ��������� ������� ��� ����,
+     ����� ��� ������� �� �������. ���� �� ������ ���������� ���� �����, ��
+     �� ��������� �������!
 
-     ������ ��������� � ���, ��� ������� CapsLock �� �������� � �������
-     �������   j   ��������� ���, ���, ����� ���� 1.1 ��������� ���������� ��
+     ������ ��������� � ���, ��� ������� CapsLock �� ��������, � �������
+     �������  j  ��������� ���, ���, ����� ���� 1.1 ��������� ���������� ��
      ������.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			���� 1.1:  ����������� �������
+			 ���� 1.1:  ����������� �������
+
 
 ** ��� ����������� ������� ������� ������� h,j,k,l ���, ��� �������� ����. **
 	     ^
@@ -33,802 +36,972 @@
 	     v
   1. ���������� ������ �� ������, ���� �� ������������ ���� ��������.
 
-  2. �������� ������� `����' (j) ���� ��� �� ������ �����������.
----> ������ �� ������, ��� ������� � ���������� �����.
+  2. �������� ������� `����' (j) ���� ��� �� ���� �����������.
+     ������ �� ������, ��� ������� � ���������� �����.
 
   3. ��������� ������� `����' ��������� � ����� 1.2.
 
-���������: ���� �� ���� �� ������� � ���, ��� ���������, ������� <ESC> ���
-	   �������� � ������� ����� (Normal mode). ����� ����� ������������
-	   ��������� �������.
+���������! ���� �� ���� �� ������� � ���, ��� ���������, ������� <ESC> ���
+	�������� � ������� ����� (Normal mode). ����� ����� ������������
+	��������� �������.
+
+���������! ������� ������� ���������� �������� (�������) ����� ������
+	��������. ������, ������� hjkl �������� ��� ������������
+	����������� �������, ��� ������ �� ��������� ��� ������������.
 
-���������: ������� ������� ���������� �������� (�������) ����� ������
-	   ��������. ������, ������� hjkl �������� ��� ������������
-	   ����������� �������, ��� ������ �� ��������� ��� ������������.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.2: ������ � ���������� ������ � VIM
+		      ���� 1.2: ���������� ������ � VIM
+
 
-!! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
+  !! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
 			       ���� ������� !!
 
-  1. ������� ������� <ESC> (��� ����, ����� ��������������, ��� �� � �������
+  1. ������� ������� <ESC> (��� ����, ����� ��������������, ��� �� � �������
      ������ (Normal mode)).
 
   2. ��������:			:q! <ENTER>.
+     (��� ��������, ��� �� ������ ������� ��� ������� :q! � ������ �������
+     ����.) ��� �������� ��� ����� �� ��������� ��� ���������� ����� ���������
+     ���������.
 
----> ��� �������� ��� ����� �� ��������� ��� ���������� ����� ���������
-     ���������. ���� �� ������ ��������� ��������� � �����:
-				:wq  <ENTER>
+  3. ����� �� ������� ����������� ��������� ��������, �������� �������,
+     ������� ������� ��� � ���� �������. ��� ����� ����:
+				vimtutor <ENTER>
 
-  3. ����� �� ������� ����������� ��������� ��������, �������� �������,
-     ������� ������� ��� � ���� �������. ��� ����� ����
-				vimtutor ru <ENTER>
-     ������ ����� ������������:	vim tutor.ru <ENTER>
+  4. ���� �� ������� � ���, ��� ��������� ��� ����, ��������� ���� �� 1 �� 3
+     ����� ����� ����� ��������� ��������.
 
----> 'vim' ��������� ��������� �������� vim, 'tutor.ru' --- ��� ����, �������
-     �� ������ �������������.
+���������!  :q! <ENTER>  ����������� ����� ��������� ���� ���������. �����
+	��������� ������ �� ������� ��� ��������� ��������� � ����.
+
+  5. ����������� ������ ���� � ����� 1.3.
 
-  4. ���� �� ������� � ���, ��� ��������� ��� ����, ��������� ���� �� 1 �� 3
-     ����� ����� ����� ��������� ��������. ����� ����������� ������ ���� �
-     ����� 1.3.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.3: �������������� ������ - ��������
+		  ���� 1.3: �������������� ������ -- ��������
 
 
-** �������� � ������� ������ ������� x, ����� ������� ������ ��� ��������. **
+** �������� � ������� ������ �������  x  ��� �������� ������� ��� ��������. **
 
-  1. ����������� ������ � ������ �����, ���������� --->.
+  1. ����������� ������ � ������ ����, ���������� --->.
 
   2. ��� ����������� ������, ����������� ������, ���� �� �� �������� ���
      ��������� ��������.
 
-  3. ������� ������� x ��� �������� ���������� �������.
+  3. ������� �������  x  ��� �������� ���������� �������.
 
-  4. ��������� ���� 2--4 ���� ������ �� ����� ����������.
+  4. ��������� ���� �� 2 �� 4 ���� ������ �� ����� ����������.
 
 ---> �� �������� ������ ������ ��� ������ �������.
 
-  5. ������, ����� ������ ����������������, ���������� � ����� 1.4.
-
-���������: � ���� �������� ����� �������� �� ��������� ����������, �����
-	   � �������� �������������.
+  5. ������, ����� ������ ����������������, ���������� � ����� 1.4.
 
+���������! � ���� �������� ����� �������� �� ��������� ����������, �����
+	� �������� �������������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.4: �������������� ������ - �������
+		   ���� 1.4: �������������� ������ -- �������
 
 
- ** �������� � ������� ������ (Normal mode), ������� i ��� ������� ������. **
+       ** �������� � ������� ������, �������  i  ��� ������� ������. **
 
-  1. ����������� ������ � ������ ������ �����, ���������� --->.
+  1. ����������� ������ � ������ ������ ����, ���������� --->.
 
   2. ��� ����, ����� ������� ������ ������ ���������� ������, ���������
      ������ �� ������ ����� ������� ������� �������� �����.
 
-  3. ������� i � �������� ��������� ����������.
+  3. �������  i  � �������� ��������� ����������.
 
   4. ����� ����������� ���� ������ ������� <ESC> ��� �������� � ������� �����.
-     ��������� ���� 2--4, ���� ����� �� ����� ���������� ���������.
+     ��������� ���� �� 2 �� 4, ���� ����� �� ����� ���������� ���������.
 
----> ����� ������ � ������ �������� .
+---> ����� ������ � ������ ��������� .
 ---> ����� ������ � ���� ������ ��������� �������.
 
-  5. ����� ������� ������� ������, ���������� ������ � ������.
+  5. ����� ������� ������� ������, ���������� � ����� 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		 ���� 1.5: �������������� ������ -- ����������
 
 
+     ** �������� � ������� ������, �������  A  ��� ���������� ������. **
+
+  1. ����������� ������ � ������ ������ ����, ���������� --->.
+     �� ����� �������� �� ����� ������� ���������� ������ �� ���� ������.
+
+  2. �������  A  � �������� ��������� ����������.
+
+  3. ����� ���������� ���������� ������ ������� <ESC> ��� �������� � �������
+     �����.
+
+  4. ����������� ������ �� ��������� ������, ���������� ---> � ��������� ����
+     �� 2 �� 4 ��� ����������� ���� ������.
+
+---> ����� ������ � ���� ������ ������
+     ����� ������ � ���� ������ ��������� �������.
+---> ����� ����� �� ������� ���
+     ����� ����� �� ������� ����� ������.
+
+  5. ����� ������� ���������� ������, ���������� � ����� 1.6.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 1
+			 ���� 1.6: �������������� �����
+
+
+	** �����������  :wq  ��� ���������� ����� � ������ �� Vim. **
+
+  !! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
+			       ���� ������� !!
+
+  1. ������� �� Vim, ��� �� ��� ������ � ����� 1.2:  :q!
+     ���, ���� � ��� ���� ������ � ������� ���������, ������ ������� ���������
+     � Σ�.
+
+  2. �� ����������� ��������� �������� ������� ��������� �������:
+			      vim tutor <ENTER>
+     `vim' -- ������� ��� ������� ��������� Vim, � `tutor' -- ��� ����� ���
+     ��������������. ����������� ��� �����, ������� ����� ��������.
+
+  3. ���������� � �������� �����, ��� �� ��������� � ���������� ������.
+
+  4. ��������� ���� � ����������� � ������� �� Vim ��������:  :wq <ENTER>
+
+  5. ���� �� ����� �� vimtutor �� ���� 1, ������������� vimtutor � ����������
+     � ���������� ������.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 1
+
 
   1. ������ ������������ ���� ��������� �� ���������, ���� ��������� hjkl.
-	 h (�����)	j (����)       k (�����)	    l (������)
+	h (�����)	j (����)	k (�����)	l (������)
 
-  2. ��� ������� Vim (�� ����������� % ��������� ��������) ��������:
-     vim ���_����� <ENTER>
+  2. ��� ������� Vim (�� ����������� ��������� ��������) ��������:
+			    vim ���_����� <ENTER>
 
   3. ��� ���������� ������ � Vim ��������:
-     <ESC>   :q!	 <ENTER>  ����� ���������� �� ���������� ���������.
+	<ESC>   :q!   <ENTER>  ����� ���������� �� ���������� ���������.
      ��� ��������:
-     <ESC>   :wq	 <ENTER>  ����� ��������� ���������.
+	<ESC>   :wq   <ENTER>  ����� ��������� ���������.
 
-  4. ��� �������� ������� ��� �������� � ������� ������, ��������: x
+  4. ��� �������� ������� ��� �������� � ������� ������, �������:  x
 
   5. ����� �������� ����� ����� �������� � ������� ������, ��������:
-	 i     ������� �����	<ESC>
+	 i   ������� ����������� �����   <ESC>
+     ����� �������� ����� ����� �������:
+	 a   ������� ����������� �����   <ESC>
 
-���������: ������� <ESC> ���������� ��� � ������� ����� (Normal mode) ����
-	   ������� ������������� � �������� ����������� �������.
+���������! ������� <ESC> ���������� ��� � ������� ����� (Normal mode) ����
+	����ף� ������������� � �������� �����ۣ���� �������.
 
-������ ��������� � ����� 2.
+������ ���������� � ����� 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 2.1: ������� ��������
+			   ���� 2.1: ������� ��������
 
 
-	** �������� dw ��� �������� ������� ������ �� ����� �����. **
+       ** ��������  dw  ��� �������� ������� ������ �� ����� �����. **
 
   1. ������� <ESC>, ����� ������� � ������� �����.
 
-  2. ����������� ������ ����, � ������, ���������� --->.
+  2. ����������� ������ ����, � ������ ���������� --->.
 
   3. ����������� ������ � ������ �����, ������� ������� �������.
 
-  4. ��������  dw , ����� ������� ��� �����.
+  4. ��������  dw  ��� �������� ����� �����.
 
-���������: �� ����� ������ ����� dw �������� � ��������� ������ ������. ����
-	   �� ���-�� �������� �����������, ������� <ESC> � ������� �������.
+���������! �� ����� ������ ����� dw �������� ������ � ����� ������ ������
+	������. ���� �� ���-�� ����ң�� �����������, ������� <ESC> � �������
+	�������.
 
 ---> ��������� ���� ������� � ���� ����������� �������� �������.
 
   5. ��������� ���� 3 � 4, ���� �� ��������� ��� ������ � ���������� �
      ����� 2.2.
 
-
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 2.2: �������������� ������� ��������
+		   ���� 2.2: �������������� ������� ��������
 
 
-	    ** �������� d$ ��� �������� ������ �� ����� ������. **
+	   ** ��������  d$  ��� �������� ������ �� ����� ������. **
 
   1. ������� <ESC>, ����� ������� � ������� �����.
 
-  2. ����������� ������ ����, � ������, ���������� --->.
+  2. ����������� ������ ����, � ������ ���������� --->.
 
-  3. ����������� ������ � ����� ���������� ������ (����� ������ . ).
+  3. ����������� ������ � ����� ���������� ������ (����� ������ �����).
 
-  4. ����� ������� ������� ������, ��������  d$ .
+  4. ��������  d$  ��� �������� ������� ������.
 
 ---> ���-�� ������ ��������� ���� ������ ������. ��������� ���� ������ ������.
 
 
-  5.����� ����� ����������� � ����, ���������� � ����� 2.3.
-
-
-
-
+  5. ����� ����� ����������� � ���, ��� ��� ����������, ���������� � ����� 2.3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 2.3: ������� � �������
+			  ���� 2.3: ������� � �������
+
 
+  ������ �������, ���������� �����, ������� �� ��������� � �������. ������
+  ������� �������� � ����������  d  ���������:
 
-  ������ ������� `��������' d �����:
+  	d   ������
 
-	 [�����]   d	������	    ���	     d	 [�����]   ������
   �����:
-    �����  - ������� ��� ��������� ������� (�������������, �� ���������=1).
-    d      - ������� ��������.
-    ������ - � ��� ������� ������ ���� ��������� (����������� ����).
+    d      - �������� ��������.
+    ������ - ��� ��� ������ ���� ��������� ������� (����������� ����).
 
   ������� ������ ��������:
-    w - �� ������� �� ����� �����, ������� ����������� ������.
-    e - �� ������� �� ����� �����, �� ������� ����������� ������.
+    w - �� ������� �� ����� �����, ������� ����������� ������.
+    e - �� ������� �� ����� �����, �� ������� ����������� ������.
     $ - �� ������� �� ����� ������.
     ^ - �� ������� �� ������ ������.
 
-���������: ������� ������� �� ������ ������� � ������� ������ (Normal mode)
-	   ��� �������������� ������ ���������� ������ ���, ��� ������� �
-	   ������ ��������.
+���������! ������� ������� �� ������ ������� � ������� ������ (Normal mode)
+	��� ���������������� ��������� ���������� ������ ���, ��� �������
+	� ������ ��������.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		���� 2.4: ������������� �������� ��� �����������
+
+
+      ** ���� ����� ����� ���������� ����������� �����ģ� � ��� ����������
+			  �������� ���������� ���. **
+
+  1. ����������� ������ � ������ ������ ���������� ---> ����.
+
+  2. ��������  2w  ��� ����������� ������� ���ң� � ������ ������� �����.
+
+  3. ��������  3e  ��� ����������� ������� ���ң� � ����� �������� �����.
+
+  4. ��������  0  (����) ��� ����������� � ������ ������.
+
+  5. ��������� ���� 2 � 3 � ���������� �������.
+
+---> ������� ������ �� ���� ��� ������ ����������� �� ���.
 
+  6. ���������� � ����� 2.5.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	       ���� 2.4: ���������� �� ������� `�������-������'
+		 ���� 2.5: ������������� �������� ��� ��������
 
 
-		 ** �������� dd ��� �������� ���� ������. **
+	    ** ���� ����� ����� ���������� �����ģ� � ��� ����������
+			  �������� ���������� ���. **
+
+  �������� ����� ����� ����� �������� � ���������� ��������� �������� �
+  ����������� ��������� ���� ��� �������� ���������� ���������� ��������:
+	 d   �����   ������
+
+  1. ����������� ������ � ������� ����� �� ��������� ���� � ���������� --->
+     ������ ����.
+
+  2. ��������  d2w  ��� �������� ���� ���� �� ��������� ����.
+
+  3. ��������� ���� 1 � 2 � ������� ������� ��� �������� ���������������� ����
+     �� ��������� ���� ����� ��������.
+
+---> ��� ��� �� ������ ���� �� ��� �� ���� � �� ��� �������.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 2.6: �������� �� ��������
+
 
-  ���������� ������� ���������� �������� �������� ���� ������, ������������
-  Vim ������, ��� ��� ����� ����� ����� ������ ������� d ������.
+		** ��������   dd   ��� �������� ����� ������. **
+
+  � ����� � ������ �������������� �������� ����� ������, ��������� Vi ������
+  ��� ��������� ������� ��������� �������� ������ ������� ���� d.
 
   1. ����������� ������ ����, �� ������ ������ �����.
+
   2. �������� dd ��� �������� ������.
-  3. ������ ������������� � ��������� ������.
-  4. �������� 2dd (��������� ������� `�����-�������-������'), ����� �������
-     ��� ������.
 
-      1)  ����� � ���� �� �������,
-      2)  �, ��� �������� �������� �����!
-      3)  � ����� �� ``�����'', ``�����'' --- �������!
-      4)  �������� � ����� �� ���� ���������!
-      5)  ��� �������� ��� ����� ��� �����...
-      6)  � ���� �� �������� � ���� `�'
-      7)  � ����� �� ������� �������� �����.
+  3. ������ ������������� � ���ף���� ������.
+
+  4. �������� 2dd ��� �������� ���� �����.
+
+--->  1)  ����� � ���� �� �������,
+--->  2)  �, ��� �������� �������� �����!
+--->  3)  � ����� �� ``�����'', ``�����'' --- �������!
+--->  4)  �������� � ����� �� ���� ���������!
+--->  5)  ��� �������� ��� ����� ��� �����...
+--->  6)  � ���� �� �������� � ���� `�'
+--->  7)  � ����� �� ������� �������� �����.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 2.5: ������� `�����'
+			   ���� 2.7: ������� `������'
 
 
-  ** ������� u	��� ������ ���������� ������ ���������� �������, U ��� ������
-			����������� �� ���� ������. **
+  ** �������  u  ��� ������ ���������� ������ ���������� �������, U ��� ������
+			 ����������� �� ���� ������. **
 
-  1. ����������� ������ ����, � ������, ���������� ---> � ���������� ��� ��
+  1. ����������� ������ ����, � ������ ���������� --->, � ���������� ��� ��
      ������ ������.
-  2. ������� x ��� �������� ������� ������������� �������.
-  3. ������ ������� u ��� ������ (������) ��������� ����������� �������.
-  4. ��������� ��� ������ � ������, ��������� ������� x .
-  5. ������ ������� ��������� U ��� ����, ����� ������� ��� ������ � ��������
-     ���������.
-  6. ������� u ��������� ��� ��� ������ ������� U � ���������� ������.
-  7. ������� ������ CTRL-R (����������� ������� CTRL ������� � ������ �������
-  R)     ��������� ��� ��� �������� ������ (����� ������).
 
----> ���������� ������� � ����� ������ � �������� �� �� �������� `������'.
+  2. �������  x  ��� �������� ������� ������������� �������.
 
-  8. ��� ���� ����� �������� �������. ����� ���������� � ������ ����� 2.
+  3. ������ �������  u  ��� ������ (������) ��������� ����������� �������.
+
+  4. ��������� ��� ������ � ������, ��������� �������  x .
+
+  5. ������ ������� ���������  U  ��� ����, ����� ������� ��� ������
+     � �������� ���������.
+
+  6. �������  u  ��������� ��� ��� ������ �������  U  � ���������� ������.
 
+  7. ������� ������ CTRL-R (�.�. ����������� ������� CTRL ������� � ������
+     ������� ������� R) ��������� ��� ��� �������� ������ (����� ������).
+
+---> ���������� ������� � ����� ������ � �������� �� �� �������� `������'.
+
+  8. ��� ���� ����� �������� �������. ����� ���������� � ������ ����� 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 2
+				 ������ ����� 2
+
 
+  1. ��� �������� ������ �� ������� �� ����� ����� ��������:	dw
 
-  1. ��� �������� ������ �� ������� �� ����� ����� ��������:    dw
+  2. ��� �������� ������ �� ������� �� ����� ������ ��������:	d$
 
-  2. ��� �������� ������ �� ������� �� ����� ������ ��������:    d$
+  3. ��� �������� ���� ������ ��������:		dd
 
-  3. ��� �������� ���� ������ ��������:    dd
+  4. ��� ������� ����������� ������� ���������� ����� ��������:	2w 
 
-  4. ������ ������� � ������� ������ ����� ���:
+  5. ������ ������� � ������� ������ ����� ���:
 
        [�����]   �������   ������     ���     �������	[�����]   ������
      ���:
-       �����   - ������� ��� ��������� ���������� �������
+       [�����] - ������� ��� ��������� ���������� �������, �����������
        ������� - ��� ���������, �������� d ��� ��������
        ������  - �� ��� ������ �������������� �������, �������� w (�����),
 		$ (�� ����� ������), � �.�.
 
-  5. ��� ������ (������) �������������� �������� ��������:  u (�������� u)
-     ��� ������ (������) ���� ��������� � ������ ��������:  U (��������� U)
+  6. ��� �������� � ������ ������ ����������� ����:  0
+
+  7. ��� ������ (������) �������������� �������� ��������:  u  (�������� u)
+     ��� ������ (������) ���� ��������� � ������ ��������:  U  (��������� U)
      ��� ������ ������ ��������:  CTRL-R
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 3.1: ������� �������
+			   ���� 3.1: ������� �������
 
 
-   ** �������� p ��� ������� ���������� ���������� ������ ����� �������. **
+   ** ��������  p  ��� ������� ���������� ���̣����� ������ ����� �������. **
 
-  1. ����������� ������ ���� � ��������� ������ �� ������.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
-  2. �������� dd ��� �������� ������ � �� ���������� � ������ Vim'�.
+  2. ��������  dd  ��� �������� ������ � ţ ���������� � ������ Vim'�.
 
   3. ����������� ������ � ������ ��� ��� ������, ���� ������� ��������
-     ��������� ������.
-
-  4. �������� � ������� ������ �������� p ��� ������ ������.
+     ���̣���� ������.
 
-  5. ��������� ���� 2--4, ���� �� ���������� ��� ������ � ������ �������.
+  4. �������� � ������� ������ ��������  p  ��� ������� ������ ���� �������.
 
-     �) � ����� �������� �� ���.
-     �) ����� �� � ����� �������,
-     �) �� ������� ���� ��������
-     �) ��� ���� ����� ������� ������
+  5. ��������� ���� �� 2 �� 4, ���� �� ���������� ��� ������ � ������ �������.
 
+---> �) � ����� �������� �� ���.
+---> �) ����� �� � ����� �������,
+---> �) �� ������� ���� ��������
+---> �) ��� ���� ����� ������� ������
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       ���� 3.2: ������� ������
+			    ���� 3.2: ������� ������
 
 
-	  ** �������� r � ������, ���������� ������ ��� ��������. **
+	  ** ��������  r  � ������, ���������� ������ ��� ��������. **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
   2. ���������� ������ ���, ����� �� ��������� ��� ������ �������.
 
-  3. �������� r	� ����� ������, ������������ ������.
+  3. ��������  r  � ����� ������, ������������ ������.
 
-  4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ����������.
+  4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ���������� ��� ������.
 
 --->  � ������ ������ ���� ������ ���0��� � ������ ������� �� ��������!
 --->  � ������ ������ ���� ������ ���-��� � ������ ������� �� ��������!
 
-  5. ������ ���������� � ����� 3.2.
-
-���������: �������, ��� �� ������ ������� � �������� ������, � �� ������
-	   ���������.
+  5. ������ ���������� � ����� 3.3.
 
+���������! �������, ��� �� ������ ������� � �������� ������, � �� ������
+	���������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 3.3: ������� ���������
+			  ���� 3.3: ������� ���������
 
 
-		** ��� ��������� ����� ����� �������� cw . **
+	    ** ��� ��������� �������� ����� ����� ��������  ce . **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
   2. ����������� ������ ��� ������ `o' � ����� `����'.
 
-  3. �������� cw � ��������� ����� (� ������ ������, �������� `���'.)
+  3. ��������  ce  � ��������� ����� (� ������ ������, �������� `���').
 
   4. ������� <ESC> � ���������� � ��������� ������ (� ������� �������, �������
-     ���� ��������.)
+     ���� ��������).
 
-  5. ��������� ���� 3--4 ���� ������ ����������� �� ������ ���������� �������.
+  5. ��������� ���� 3 � 4 ���� ������ ����������� �� ������ ���������� �������.
 
 ---> ��������� ���� � ���� ������ ������� ��������������.
 ---> ��������� ���� � ���� ������ ������� ��������������.
 
-�������� ��������, ��� cw �� ������ �������� �����, �� � ��������� ��� � �����
-�������.
-
+   �������� ��������, ���  ce  �� ������ ������� �����, �� � ��������� ��� �
+   ����� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 3.4: ���������� �������� � �������� c
+		  ���� 3.4: ���������� �������� � ��������  c
 
 
-** ������� ������ ������������ � ���� �� ���������, ��� � ������� ��������. **
+ ** ������� ������ ������������ � ���� �� ���������, ��� � ������� ��������. **
 
   1. ������� ��������� ����������� ����� �� �������, ��� � ������� ��������.
-     �� ������ �����:
+     � ������ �����:
 
-       [�����]   c   ������	   ���	    c	[�����]   ������
+       [�����]   c   ������           ���           c   [�����]   ������
 
   2. ������� ����� ���������: w (�����), $ (����� ������) � �.�.
 
-  3. ����������� ������ ����, � ������, ���������� --->.
+  3. ����������� ������ ����, � ������ ���������� --->.
 
   4. ��������� � ������ ������.
 
-  5. �������� c$ � �������������� ������ ������ ���, ����� ��� ��������� ��
+  5. ��������  c$  � �������������� ������ ������ ���, ����� ��� ��������� ��
      ������, ����� ���� ������� <ESC>.
 
 ---> ����� ���� ������ ��������� � ������, ����� ����� ������� �� ������.
----> ����� ���� ������ ��������� � ������ ������� c$ .
+---> ����� ���� ������ ��������� � ������ �������  c$ .
 
+���������! ������� Backspace ����� �������������� ��� ����������� ��� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 3
+				 ������ ����� 3
 
 
-  1. ��� ������� ������, ������� ������ ��� ��� ������, �������� p . ���
-     ������� ������� ��������� ����� ����� ������� (���� ���� ������� ������,
+  1. ��� ������� ������, ������� ������ ��� ��� ���̣�, ��������  p . ���
+     ������� ������� ���̣���� ����� ����� ������� (���� ���� ������� ������,
      �� ��� ����� �������� � ������ ��� ��������).
 
-  2. ��� ������ ������� ��� �������� �������� r � ����� ���������� ������.
+  2. ��� ������ ������� ��� �������� ��������  r  � ����� ���������� ������.
 
-  3. ������� ��������� ��������� ��� �������� ��������� ������ �� ������� ��
-     ����� ����� �������. ��������, �������� cw ��� ������ �� ������� ��
-     ����� �����, c$ ��� ��������� �� ����� ������.
+  3. ������� ��������� ��������� ��� �������� ��������� ������ �� ������� ��
+     ��������� �����������. ��������, ��������  ce  ��� ������ �� ������� ��
+     ����� �����,  c$  ��� ��������� �� ����� ������.
 
   4. ������ ������� ��������� �����:
 
-	 [�����]   c	������	      ���	c   [�����]   ������
-
-������ ������������� � ���������� �����.
-
-
-
+	 [�����]   c   ������         ���         c   [�����]   ������
 
+������ ���������� � ���������� �����.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	      ���� 4.1: ���������� � ����� � ������������ � ���
+	       ���� 4.1: ���������� � ����� � ������������ � ���
 
 
- ** �������� CTRL-g ����� ������� ���� ����������������� � ����� � ����������
-				    � ���.
-	�������� SHIFT-G ��� ����������� � �������� ������ � �����. **
+       ** �������� CTRL-g ����� ������� ���� ����������������� � ����� �
+     ���������� � �����. ��������  G  (SHIFT-G) ��� ����������� � ��������
+			       ������ � �����. **
 
-  ���������: ���������� ���� ���� ������ ��� ��������� ����� �������!!
+���������! ���������� ���� ���� ������ ��� ��������� ����� �������!
 
-  1. ��������� ������� Ctrl ������� g . ����� ������ �������� ������ ������� �
-     ������ ����� � ������� ������, � ������� �� ����������. ��������� �����
+  1. ��������� ������� Ctrl �������  g . ����� ������ �������� ������ �������
+     � ������ ����� � ������� ������, � ������� �� ����������. ��������� �����
      ������, �� ����������� �� ���� 3.
 
-  2. ������� shift-G ��� ����������� � ����� �����.
-
-  3. �������� ����� ������, � ������� �� ���������� � ����� shift-G. ���
-     ������ ��� � ������, � ������� �� ����, ����� � ������ ��� ������ Ctrl-g.
-     (����� �� ������ �������� �����, ��� �� ����������� �� ������.)
+  2. ��������� ������� Shift �������  g  ��� ����������� � ����� �����.
 
-  4. ���� �� ��������� ��� �������������, ��������� ���� 1--3.
+  3. �������� ����� ������, � ������� �� ���������� � ����� Shift-G. ���
+     ���� ��� � ������, � ������� �� ����, ����� � ������ ��� ������ Ctrl-g.
 
+  4. ���� �� ��������� ��� �������������, ��������� ���� � 1 �� 3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			   ���� 4.2: ������� ������
+			    ���� 4.2: ������� ������
 
-	      ** ��������  /  � ����� ������� ������� �����. **
+
+	       ** ��������  /  � ����� ������� ������� �����. **
 
   1. � ������� ������ (Normal mode) �������� ������  / . �������� ��������,
      ��� �� ������ � �������� �������� ����� ������, ��� ��� ���������� �
-     �������� :	.
+     ��������  : .
 
-  2. ������ �������� '��������' <ENTER>. ��� �� �����, ������� �� ������
+  2. ������ �������� '��������' <ENTER>. ��� �� �����, ������� �� ������
      ������.
 
-  3. ��� ����, ����� ��������� �����, ������ ������� n .
-     ��� ������ ���� ����� � �������� �����������, ������� Shift-N .
+  3. ��� ����, ����� ��������� �����, ������ �������  n .
+     ��� ������ ���� �� ����� � �������� �����������, �������  Shift-N .
+
+  4. ���� �� ������� ����� ������ � �������� �����������, �����������
+     �������  ?  ������  / .
 
-  4. ���� �� ������� ����� ������ � �������� �����������, �����������
-     ������� ? ������ / .
+  5. ��� ����, ����� ��������� ����, ������ �� ������ ����� �������  Ctrl-O.
+     (��������� ������� ������� Ctrl �������  o ). ��������� ��������� ���
+     ��� ����������� ��������. ��� �������� ���ң� �����������  Ctrl-I .
 
----> ����� �� ��� ������ ���������� ����� �����, ����� ����� ��������� �
-     ������.
+---> "��������" ��� �� ������ ��������� ����� `������';  �������� ��� ������.
 
-  "��������" ��� �� ������ ������������ ����� `������';  �������� ��� ������.
+���������! ���� ��� ������ ����� ��������� ���� �����, �� ����� ����� ���������
+	� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			���� 4.3: ����� ������ ������
 
 
-		** �������� % ��� ������ ������ ),] ��� } . **
+		 ** ��������  %  ��� ������ ������ ), ] ��� } . **
 
-  1. ��������� ������ ��� ����� �� (, [ ��� { � ������ �����, ���������� --->.
+  1. ��������� ������ ��� ����� �� (, [ ��� { � ������ ����, ���������� --->.
 
-  2. ������ �������� ������ % .
+  2. ������ �������� ������  % .
 
   3. ������ ������ ����������� �� ������ ������.
 
-  4. �������� % ��� �������� ������� ����� � ������ ������.
+  4. ��������  %  ��� �������� ������� ����� � ������ ������.
 
 ---> ��� ( ������, ���������� ����� (, ����� [ ] � ����� { } ������. ))
 
-���������: ��� ����� ������ ��� ������� �������� � ������������ ��������!
-
-
-
-
-
+���������! ��� ����� ������ ��� ������� �������� � ������������ ��������!
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		      ���� 4.4: ������ ����������� ������
 
 
-	 ** �������� :s/����/�����/g ��� ������ '����' �� '�����'. **
+	 ** ��������  :s/����/�����/g  ��� ������ '����' �� '�����'. **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
-  2. �������� :s/�����/����� <ENTER> . �������� �������� �� ��, ��� ��� �������
-     ������� ������ ������ ��������� ��������� � ������.
+  2. ��������  :s/�����/����� <ENTER> . �������� �������� �� ��, ��� ���
+     ������� ������� ������ ������ ��������� ��������� � ������.
 
-  3. ������ �������� :s/�����/�����/g , ���������� ����������� ��������� ��
-     ���� ������. ��� ������� ��� ��������� � ������ ���������.
+  3. ������ ��������  :s/�����/�����/g , ����������� � ����� g ��������
+     ����������� ��������� �� ���� ������. ��� ������� ��� ��������� � ������
+     ���������.
 
 ---> � ����� � ����������� ��������, � ����� ������ ���������� ����, � ����� �
      ������� ����������.
 
   4. ��� ������ ���� ��������� ������������������ �������� ����� �����
      ��������,
-     �������� :#,#s/����/�����/g  ��� #,# --- ������ ���� �����.
-     �������� :%s/����/�����/g    ��� ������ ���� ��������� �� ���� �����.
-
+     ��������  :#,#s/����/�����/g  ��� #,# -- ������ ���� �����.
+     ��������  :%s/����/�����/g    ��� ������ ���� ��������� �� ���� �����.
+     ��������  :%s/����/�����/gc   ��� ������ ���� ��������� �� ���� ����� �
+                                   ������� ������������� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 4
-  1. Ctrl-g ���������� ���� ��������� � ����� � ���������� � ���.
-     Shift-G ���������� ��� � ����� �����. �����, �� ������� ������� Shift-G
+				 ������ ����� 4
+
+
+  1. Ctrl-g  ���������� ���� ��������� � ����� � ���������� � ���.
+     Shift-G  ���������� ��� � ����� �����. �����, �� ������� ������� Shift-G
      ��������� ������� � ������ � ���� �������.
+     gg  ���������� ��� � ������ ������ �����.
 
-  2. ������� / � ����� ���� ������ ��������� ���������� ����� ���� ������
-     ������ �� ������.
-     ������� ? � ����� ���� ������ ��������� ���������� ����� ���� ������
+  2. �������  /  � ����� ���� ������ ��������� ���������� ����� ���� ������
+     ����� �� ������.
+     �������  ?  � ����� ���� ������ ��������� ���������� ����� ���� ������
      ����� �� ������.
-     ����� ������ �������� n ��� �������� � ���������� ��������� �������
+     ����� ������ ��������  n  ��� �������� � ���������� ��������� �������
      ������ � ��� �� ����������� ��� Shift-N ��� �������� � ���������������
      �����������.
 
-  3. ������� % , ����� ������ ��������� �� (,),[,],{, ��� } ��������� �����
+  3. �������  % , ����� ������ ��������� �� (,),[,],{, ��� } ��������� �����
      ������ ������.
 
   4. ��� ����������� `�����' ������ ������� `����' � ������, ��������
-     :s/old/new
+	:s/old/new
      ��� ����������� `�����' ������ ���� `����' � ������, ��������
-     :s/old/new/g
+	:s/old/new/g
      ��� ������ � ��������� ����� ����� ��������, ��������
-     :#,#s/old/new/g
+	:#,#s/old/new/g
      ��� ������ ���� ��������� `����' �� `�����' � �����, ��������
-     :%s/old/new/g
+	:%s/old/new/g
      ����� �������� ������ ��� ���������� �������������, �������� 'c'
-     :%s/old/new/gc
+	:%s/old/new/gc
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		   ���� 5.1: ��� ��������� ������� �������
+		    ���� 5.1: ��� ��������� ������� �������
 
 
-    ** �������� :! � ����� ������� �������, ������� ������� ���������. **
+    ** ��������  :!  � ����� ������� �������, ������� ������� ���������. **
 
-  1. �������� ��� �������� ��� ������� : ��� ��������� ������� � ���������
-     ������ ���������. ��� �������� ��� ������ �������.
+  1. �������� ��� �������� ��� �������  :  ��� ��������� ������� � ���������
+     ������ ���������. ��� �������� ��� ������ �������.
 
-  2. ������ �������� ������ ! (��������������� ����). ������ ����� ���������
+  2. ������ �������� ������  !  (��������������� ����). ��� �������� ���������
      ������� �������, ��������� ��������� ��������.
 
-  3. ��� ������� �������� ls ����� ! � ������� <ENTER>. ��� ������� �������
-     ������ ������ � ������� ��������, ����� �����, ��� ���� �� �� ����� ���
-     ������� � ����������� ��������. ��� ���������� :!dir , ���� ����������
-     ������� �� ���������.
-
----> ���������: ����� �������� ����� ��������� ����� ������� �������.
+  3. ��� ������� ��������  ls  �����  !  � ������� <ENTER>. ������� �������
+     ������ ������ � ������� ��������, ����� �����, ��� ���� �� �� ����� ���
+     ������� � ����������� ��������. ��� ����������  :!dir , ���� ������� ls
+     �� ���������.
 
----> ���������: ��� �������, ������������ � : , ������ ����������� ��������
-     <ENTER>.
+���������! ����� �������� ����� ��������� ����� ������� ������� � ���������
+	����������.
 
+���������! ��� �������, ������������ �  : , ������ ����������� ��������
+	<ENTER>. ����� �� ��� �� ������ ����� ���������� ������ ��������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			 ���� 5.2: ��� �������� ����
 
 
-** ��� ���������� ���������, ������������� � �����, �������� :w ���_�����. **
+	      ** ��� ���������� ���������, �������ģ���� � �����,
+			   ��������  :w ���_�����. **
 
-  1. �������� :!dir ��� :!ls ��� ��������� ������ ������ � ������� ��������.
-     ��� ��� ��� ��������, �� ������ ������ <ENTER> ����� ����� ���� ������.
+  1. ��������  :!dir  ���  :!ls  ��� ��������� ������ ������ � �������
+     ��������.  ��� ��� ��� ��������, ����� ����� ������� ���� ������ <ENTER>.
 
-  2. ���������� �������� ��� �����, ������� ��� �� ����������, �������� TEST.
+  2. ���������� �������� ��� �����, ������� �ݣ �� ����������, �������� TEST.
 
-  3. ������ �������� :w TEST (��� TEST --- ��� ��� �����, ����������� ����.)
+  3. ������ ��������  :w TEST  (��� TEST -- ��� ��� �����, ����������� ����.)
 
-  4. ��� ������� �������� ���� ���� (������� �� Vim) ��� ������ TEST. �����
-     �������������� � ����, ����� �������� :!dir � ����������� �������.
+  4. ������� �������� ���� ���� ���� (������� �� Vim) ��� ������ TEST. �����
+     �������������� � ����, ����� ��������  :!dir  ��� :!ls  � �����������
+     �������.
 
----> ��������, ��� ���� �� ������� �� Vim � ����� ��������� ��� ����� �
-     ������ TEST, ���� ���� ����� ������ ������ �������� � ��� ������, �����
-     �� ��� ���������.
-
-  5. ������ ������� ���� ����, ������ :!del TEST
+���������! ���� �� ������� �� Vim � ����� ��������� ��� ����� � ������ TEST
+	(�.�. ���������  vim TEST ), ���� ���� ����� ������ ������ ��������
+	� ��� ������, ����� �� ��� ���������.
 
+  5. ������ ������� ���� ����, ������ ��� MS-DOS    :!del TEST
+                                      ��� Unix      :!rm TEST
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		       ���� 5.3: ���������� ����������
 
 
-	 ** ��� ���������� ����� �����, �������� :#,# w ���_����� **
-
-  1. ��� ��� �������� :!dir ��� :!ls ��� ��������� ������ ������ � �������
-     �������� � �������� ���������� ���, �������� TEST.
+	   ** ��� ���������� ����� �����, ��������  v  �������� �����
+			  � ��������� ţ  :w ���_����� **
 
-  2. ����������� ������ � ������ ���� �������� � ������� Ctrl-g ��� ����������
-     ������ ������to. ��������� ���� �����!
+  1. ����������� ������ � ���� ������.
 
-  3. ������ ������������� � ����� �������� � ����� �������� Ctrl-g. ���������
-     � ���� ����� ����!
+  2. �������  v  � ����������� ������ ���� � ������ ����. �������� ��������,
+     ��� ����� ���������.
 
-  4. ��� ���������� ������ ����� ����� �������� :#,# w TEST , ��� #,# --- ���
-     ������, ������� �� ��������� (������, �����), � TEST --- ��� ������ �����.
+  3. �������  :  � ����� ������ ��������  :'<,'> .
 
-  5. ��� � ������, ��������� � ������� ����� ����� �������� :!dir , �� ��
-     �������� ���.
+  4. �������  w TEST  (��� TEST -- ��� �����, ������� �ݣ �� ����������).
+     �� ������� <ENTER>, ��������� ��� ����� ������ ��������  :'<,'>w TEST.
 
+  5. Vim ������� ��������� ������ � ���� TEST. ��� � ������, ��������� �
+     ������� ����� ����� ��������  :!dir  ���  :!ls . �� �������� ���� ����, ��
+     ����������� � ��������� �����.
 
+���������! �������  v  �������� ���������� �����. �� ������ ���������� ������
+	��� ��������� ������. ����� ��� ���������� ��������� ����� ���������
+	�����-�� ��������, ��������, ������� ��������  d.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		    ���� 5.4: ������ � ����������� ������
+		     ���� 5.4: ������ � ����������� ������
 
-	  ** ��� ������� ����������� �����, ��������  :r FILENAME **
 
-  1. �������� :!dir ��� ����, ����� ��������� � ���, ��� ���� TEST ��� ���
-     ����������.
+	** ��� ������� ����������� �� �����, ��������  :r ���_�����  **
 
-  2. ���������� ������ � ������� ����� ���� ��������.
+  1. ���������� ������ ��� ���� �������.
 
-���������: ����� ���������� ���� 3 �� ������� ���� 5.3.	����� �����
-	   ������������� ����, ����� � ����� �����.
+���������! ����� ���������� ���� 2 �� ������� ����� �� ����� 5.3. �������������
+	���� �� ������ �� ����� �����.
 
-  3. ������ ���������� ��� ���� TEST, ��������� ������� :r TEST , ���
-     TEST --- ��� ��� �����.
+  2. ������ ���������� ��� ���� TEST, ��������� �������  :r TEST , ��� TEST --
+     ��� ��� �����.
 
-���������: ����������� ���� ���� ����� �������� � ��� �����, ��� ���������
-	   ������.
+  3. ��� �������� ��� ���������� ����� ���� ���������, ������������� �� ������
+     � ��������������, ��� ������ � � ��� ����� ����� 5.3: �������� � ��
+     ����� TEST.
 
-  4. ����� ��������� � ���, ��� ���� ��������, ������������� ������� ����� ��
-     ������ � ��������, ��� ������ ���������� ��� ����� ����� 5.3, ��������
-     � ���������� �� �����.
+���������! �������� ����� � ����� ������� �������. ��������,  :r !ls  ���������
+	����� ������� ls � ������� ��� ���� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 5
+				 ������ ����� 5
 
 
   1.  :!�������  ��������� ������� �������.
 
       ��������� �������� �������:
-	  :!dir --- ������� ������ ������ � ��������.
-	  :!del FILENAME --- ������� ���� FILENAME.
+      	(MS-DOS)	(Unix)
+	 :!dir		 :!ls		-- ������� ������ ������ � ��������.
+	 :!del ���	 :!rm ���	-- ������� ���� �� �����.
 
-  2.  :w FILENAME ���������� ������� ������������� ���� �� ����
-      ��� ������ FILENAME.
+  2.  :w ���_�����  ���������� ������� ������������� � Vim ���� �� ���� ���
+      ��������� ������.
 
-  3.  :#,#w FILENAME ��������� ������ �� # �� # � ���� FILENAME.
+  3.  v  �����������  :w ���_�����  ��������� ��������� ��������� ������ � ����
+      � ��������� ������.
 
-  4.  :r FILENAME ��������� � ����� ���� FILENAME � �������� ��� � �������
-      ���� ������ �� �������� �������.
+  4.  :r ���_�����  ��������� � ����� ���� � ��������� ������ � �������� ���
+      ���� �������.
 
+  5.  :r !dir  ������ ����� ������� dir � �������� ��� ���� �������.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			   ���� 6.1: ������� ��������
 
 
+   ** ��������  o  ����� ������� ������ ������ ��� �������� � ������� � �����
+			    ������� (Insert mode) **
 
+  1. ����������� ������ ����, � ������ ���������� --->.
 
+  2. ��������  o  (� ������ ��������) ��� ����, ����� ������� ������ ������
+     ���� ������� � ������� � ����� ������� (Insert mode).
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 6.1: ������� ��������
+  3. ������ �������� �����-������ ����� � ������� <ESC> ��� ������ �� ������
+     �������.
 
+---> ����� �������  o  ������ �����ģ� �� ����� ������ ������ � ������ �������.
 
- ** �������� o ����� ������� ������ ������ ��� �������� � ������� � �����
-			   ������� (Insert mode) **
+  4. ��� �������� ������ ���� �������, ������ �������� ���������  O , ������
+     ��������  o . ���������� ��������� ��� � ������������� �������.
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+---> �������� ����� ������ ��� ����, �������� �� �ţ ������ � ����� Shift-O.
 
-  2. �������� o (� ������ ��������) ��� ����, ����� ������� ������ ������
-     ���� ������� � ������� � ����� ������� (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 6.2: ������� ����������
+
+
+	    ** ��������  a , ����� �������� ����� ����� �������. **
+
+  1. ����������� ������ ����, � ������ ������ ������ ���������� --->.
 
-  3. ������ ���������� ���������� ---> ������ � ������� <ESC> ��� ������ ��
-     ������ �������.
+  2. ���������  e  ���� ������ �� ������������� �� �����  c��� .
 
----> ����� ������� o ������ �������� �� ����� ������ ������ � ������ �������.
+  3. ��������  a  (� ������ ��������) ��� ���������� ������ ����� �������,
+     ������������ ��� ��������. (��������� A ��������� �������� � �����
+     ������.)
 
-  4. ��� �������� ������ ���� �������, ������ �������� ��������� O, ������
-     �������� o. ���������� ��������� ��� � ������������� �������.
-�������� ����� ������ ��� ����, ����� Shift-O, �������� ������ �� ��� ������.
+  4. �������� ����� ���, ��� �������� � ������ ����. ������� <ESC> ��� ������
+     �� ������ ������� (Insert mode).
 
+  5. �����������  e  ��� �������� � ����� ���������� �������ۣ����� ����� �
+     ��������� ���� 3 � 4.
 
+---> ��� ���� �������� ��� ����������� � ������� ������.
+---> ��� ������� �������� ��� ���������������� � ���������� ������. 
 
+���������!  a , i  �  A  ��������� � ���� � ��� �� ����� �������, ��������
+	������ � ���, ��� ����������� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 6.2: ������� ����������
+			���� 6.3: ��� ���� ������ ������
 
-	    ** �������� a , ����� �������� ����� ����� �������. **
 
-  1. ����������� ������ ����, � ����� ������ ������, ���������� ---> ,
-     ������ $ � ������� ������ (Normal mode).
+       ** �������� ���������  R  ��� ������ ����� ��� ������ �������. **
 
-  2. �������� a (� ������ ��������) ��� ���������� ������ ����� �������,
-     ������������ ��� ��������. (��������� A ��������� �������� � �����
-     ������.)
+  1. ����������� ������ ����, � ������ ������ ���������� --->, � � ������
+     ������� �����  xxx.
 
-���������: ��� ��������� �������� ������� i , ���������� �������, ������ ���
-	   �������, <ESC>, ������-������, �, �������, x , ������ ��� ����,
-	   ����� �������� ���� � ����� ������!
+  2. ������ �������  R  � ������� ����� ��������� ���� �� ������ ������ �����
+     ��������  xxx.
 
-  3. ������ ��������� ������ ������. �������� �����, ��� ���������� ��� �
-     �������� �� �� �����, ��� � ����� �������, �� ����������� �������, �
-     ������� ����� �������� �����.
+  3. ������� <ESC> ��� ������ �� ������ ������. �������� ��� ������� ������
+     �� ��� �����.
 
----> ��� ������� �������� ��� ����������������
----> ��� ������� �������� ��� ���������������� � ���������� ������ � �����
-     ������.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       ���� 6.3: ��� ���� ������ ������
+  4. ��������� ��� ���� ��� ������ ����������  xxx.
 
+---> ���������� 123 � xxx ���� xxx.
+---> ���������� 123 � 456 ���� 579.
 
-       ** �������� ��������� R ��� ������ �����, ��� ������ �������. **
+���������! ����� ������ ����� �� ����� �������, �� ������ ���ģ���� ������
+	������� ������������.
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     ���� 6.4: ����������� � ������� ������
 
-  2. ����������� ������ � ������ ������� �����, ������������� ��
-     ���������������� � ��������� ������, ���������� ---> (����� '���������').
 
-  3. ������ �������� R � �������� ������� ������ � ������ ������, ������
-     ������ ������� ������ ���, ����� ��� ������ ����� �����������.
+	** ����������� �������  y  ��� ����������� �  p  ��� ������� **
 
----> ������ ������ ����� �������� � ���������, ��������� �������.
----> ������ ������ ����� �������� � ������, ��������� R � ������ ����� �����.
+  1. ����������� ������ ����, � ������ ������ ���������� --->, � ����� `�)'.
 
-  4. �������� ��������, ��� ��� ������� <ESC> ��� ����������, �����
-     �� ���������� ����� ����������.
+  2. ������������� � ����� ����������� ������ �����  v  � ����������� ������
+     ����� ������ `������'.
 
+  3. �������  y  ��� ����������� ������������� ������.
 
+  4. ����������� ������ � ����� ��������� ������ �����������  j$ .
 
+  5. �������  p  ��� ������� ������. ����� ������� `������' � ������� <ESC>. 
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			���� 6.4: ��������� ����������
+--->  �) ���� ������� ������.
+      �)
 
+���������! ����� �������� ������������  yw  (�������  y  � ����������  w ) ���
+	����������� ������ �����.
 
-** ��������� ��������� ���, ����� ������������ ������� ��� ������ ��� ������ **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 6.5: ��������� ����������
 
 
-  1. ������� ����� '������������', ������:
-     /������������
-     ��������� ����� ��������� ���, ������� ������� n
+   ** ��������� ��������� ��� ������������� �������� ��� ������ ��� ������ **
 
-  2. �������� �������� 'ic' (������������ �������), ������:
-     :set ic
+  1. ������� ����� `������������', ������:  /������������  <ENTER>.
+     ��������� ����� ��������� ���, ������� �������  n .
 
-  3. ������ ����� �������� ����� ����� '������������', �����: n
-     ��������� ����� ��������� ���, ������� ������� n
+  2. ���������� �������� `ic' (������������ �������), ������:  :set ic
 
-  4. �������� ��������� 'hlsearch' � 'incsearch':
-     :set hls is
+  3. ������ ����� ��������� ��� �������� ����� ����� `������������',
+     �������:  n
+     ��������, ��� ������ ��������� `������������' � `������������'.
 
-  5. ������ ����� ������� ������� ������ � ����������, ��� ���������:
-     /������������
+  4. ���������� ��������� `hlsearch' � `incsearch':  :set hls is
 
+  5. ������ ����� ������� ������� ������ � ����������, ��� ���������:
+			     /������������ <ENTER>
 
+  6. ��� ����������� �ޣ�� �������� ��� ������ ��������:  :set noic
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 6
+���������! ��� ���������� ��������� ���������� ��������:  :nohlsearch
 
+���������! ���� �� ������ ������������ ������� ������ ��� ������ ������,
+	�����������  \�  � ������� ������:  /������������\c  <ENTER>
 
-  1. ������� o ������� ������ ���� ������� � ���������� ������ � ��� � ������
-     �������.
-     ������� ��������� O ������� ������ ���� ������, � ������� ���������
-     ������.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 6
 
-  2. �������� a ��� ������� ������ ����� �������, �� ������� ��������� ������.
-     ������� ��������� A ������������� ���������� ��� ��� ���������� ������
-     � ����� ������.
 
-  3. ������� ��������� R ��������� ��� � ����� ������ �� ��� ���, ���� ��
-     ����� ������ ������� <ESC> ��� ����������.
+  1. �������  o  ��� �������� ������ ���� ������� � �������� � ����� �������.
+     �������  O  ��� �������� ������ ���� �������.
 
-  4. ������ ":set xxx" �� ������� �������� �������� "xxx"
+  2. �������  a  ��� ������� ������ ����� �������.
+     �������  A  ��� ������� ������ � ����� ������.
 
+  3. �������  e  �������� ������ � ����� �����.
 
+  4. �������  y  �������� �����,  p  -- ��������� ������������� �����.
 
+  5. ������� ���������  R  ��������� � ����� ������ �� ������� �������  <ESC> .
 
+  6. �������� `:set xxx' ��� ��������� ��������� `xxx', ��������� ���������:
 
+	`ic'	`ignorecase'	������������� �������� ��� ������
+	`is'	`incsearch'	����������� ��������� ���������� ��� ������
+	`hls'	`hlsearch'	��������� ���� ���������� ��� ������
 
+  7. �������� `no' ����� ���������� ��� ��� ����������:  :set noic
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		 ���� 7: ������� ��������� ���������� �������
+			  ���� 7.1: ���������� �������
+
 
-	       ** ����������� ���������� ���������� ������� **
+		** ����������� ���������� ���������� ������� **
 
   Vim �������� ������ ���������� ���������� ��������. ��� ������ ����������
-  ���� �� ���� ���������:
+  ���� �� �ң� ���������:
 	- ������� ������� <HELP> (���� ������� ������� �� ����������)
 	- ������� ������� <F1> (���� ������� ������� �� ����������)
 	- ��������   :help <ENTER>
 
+  ���������� ����� � ���� ������� ��� ��������� ������������� � ��� ���
+  �������� �������.
+  �������  CTRL-W CTRL-W  ��� �������� �� ���� � ����.
   ��������   :q <ENTER>   ����� ������� ���� �������.
 
-  �� ������ ����� ������� ��� ������ ������� ��� �������, ������ �����
-  ��������������� �������� ������� ":help". ���������� ��������� (�� ��������
-  ������ <ENTER>):
+  �� ������ ����� ������� ��� ������ ������� ��� �������, ����� ���������������
+  �������� ������� `:help'. ���������� ��������� (�� �������� ������ <ENTER>):
+
+	:help w
+	:help c_CTRL-D
+	:help insert-index
+	:help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     ���� 7.2: �������� ���������� ��������
+
 
-  :help w
-  :help c_<T
-  :help insert-index
+			 ** ������� ����������� Vim **
 
+  Vim ����� ������� ������ ������������, ��� Vi, �� ����������� �� ��� ��
+  ��������� ���������. ��� ������������� ������� ������������ ��� �������
+  ������� ���� `vimrc'.
 
+  1. �������������� ����� ���� `vimrc'. ��� ������������ ������� ��
+     ������������ �������:
+	:e ~/.vimrc		��� Unix
+	:e $VIM/_vimrc		��� MS-Windows
 
+  2. ������ ���������� ������ ����� `vimrc':
+	:r $VIMRUNTIME/vimrc_example.vim
 
+  3. �������� ��������� ���� ����� ���� `vimrc':
+	:w
+
+  ������ ��� ��������� ������� Vim ����� �������� ��������� ����������. ���
+  ���������, �������������� ����, ����� ���� ��������� � ���� `vimrc'.
+  ��� ���������� ���������� ��������  :help vimrc-intro
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		     ���� 8: �������� ���������� �������
+			      ���� 7.3: ����������
 
-			** ������� ����������� Vim **
 
-  Vim ����� ������� ������ ������������, ��� Vi, ������ ������������ �� ���
-  ��������� �� ���������. ��� ����, ����� ������ ������������ �����
-  ����������� ��� ������� ������� ���� "vimrc".
+	 ** ��������� ������ ����� ��������� �����  CTRL-D  �  <TAB> **
 
-  1. �������������� ���� "vimrc", ��� ������������ ������� �� ������������
-     �������:
+  1. ��������������, ��� Vim �� � ������ �������������:  :set nocp
 
-       :edit ~/.vimrc			��� Unix
-       :edit $VIM/_vimrc		��� MS-Windows
+  2. ���������� ����� ����� ���� � ��������:  :!ls  ���  :!dir
 
-  2. ������ ���������� ������ ����� "vimrc":
+  3. �������� ������ �������:  :e
 
-       :read $VIMRUNTIME/vimrc_example.vim
+  4. �������  CTRL-D  � Vim ��������� ������ ������ ������������ �� `e'.
 
-  3. �������� ����:
+  5. �������  <TAB>  � Vim �������� �������� ������� �� `:edit'.
 
-       :write
+  6. ������ �������� ������ � ������ ������������� ����� �����:  :edit ���
 
-  ������ ��� ��������� ������� Vim ����� �������� ��������� ����������. ���
-  ���������, �������������� ����, ����� ���� ��������� � ���� "vimrc".
+  7. �������  <TAB>  � Vim �������� ��� �����, ���� ��� ����������.
+
+���������! ���������� �������� ��� ������ ������. ���������� ������  CTRL-D  �
+	<TAB>. ��� �������� ������� ��� �������  :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 7
+
+
+  1. ��������  :help  ��� ������� <F1>, ��� <Help> ��� �������� ���� �������.
+
+  2. ��������  :help cmd  ��� ������ ������� �� �������.
+
+  3. �������  CTRL-W CTRL-W  ��� �������� � ������� ����.
+
+  4. ��������  :q  ��� �������� ���� ������� (���� ��� �������).
+
+  5. ��� �������� ����� �������� �������� ��������� �������� `vimrc'.
+
+  6. ��� ������  :  �������, ������� CTRL-D ��� ����������� ���������
+     ����������. ������� <TAB> ��� ������������� ����������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  �� ���� ����������� ������� Vim. �� ��� ������������ ��� ����, ����� ����
-  ����� ������������� � ��������� Vim, ����������� ��� ����, ����� � ���������
-  ������������ ���. ������� ����� �� �������, ��������� Vim ����� ����� �����
-  ������. ���������� ������ ����������� ������������: ":help user-manual".
+
+  �� ���� ����������� ������� Vim. �� ��� ������������ ���� ����� �������������
+  � ��������� Vim, ����������� ��� ����, ����� � ̣������� ������������ ���.
+  ������� ��̣� �� �������, ��������� Vim ����� ����� ����� ������. ����������
+  ������ ����������� ������������: `:help user-manual'.
 
   ��� ����������� ������ ������������� �����:
-	Vim - Vi Improved - �����: Steve Oualline
-	��������: New Riders
-  ��� ����� ��������� ��������� Vim. �������� ������� ��������. ��������
-  ��������� �������� � �����������.
-  ��������� �� See http://iccf-holland.org/click5.html
+	Vim - Vi Improved, �����: Steve Oualline, ��������: New Riders
+
+  ��� ����� ��������� ��������� Vim. �������� ������� ��� ����� ��������.
+  �������� ��������� �������� � �����������.
+  ��. http://iccf-holland.org/click5.html
 
   ��������� ����� ����� ���������� �������� � ��������� ������ Vi, ��� Vim,
   ������ ����� �������������:
-	Learning the Vi Editor - �����: Linda Lamb
-	��������: O'Reilly & Associates Inc.
-  ��� ������� ����� ��� ����, ����� ������ ���, ��� ������ ����� ����������� �
-  Vi. ������ ������� ����� �������� ���������� � Vim.
+	Learning the Vi Editor, �����: Linda Lamb,
+				��������: O'Reilly & Associates Inc.
+
+  ��� ������� �����, ����� ������ �ӣ, ��� ������ ����� ������� � Vi. ������
+  ������� ����� �������� ���������� � Vim.
 
-  ���� ������� ��� ������� Michael C. Pierce � Robert K. Ware, Colorado School
-  of Mines � �������������� ����, ������������ Charles Smith, Colorado State
+  ���� ������� ������� Michael C. Pierce � Robert K. Ware, Colorado School of
+  Mines � �������������� ����, ������� ��������� Charles Smith, Colorado State
   University. E-mail: bware@mines.colorado.edu.
 
-  ���������� ��� Vim Bram Moolenaar.
+  ���������� ��� Vim ������ ��������� (Bram Moolenaar).
+
+  �������:
+  	������ ������� <a_kissel@eudoramail.com>, 2002.
+	������ �̣��� <alyoshin.s@gmail.com>, 2014.
+
+  Translators:
+  	Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+  	Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
 
-  �������: ������ ������� <a_kissel@eudoramail.com>, 2002.
-  Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ru.cp1251 b/runtime/tutor/tutor.ru.cp1251
index 024ca526b8..3cd051f3cc 100644
--- a/runtime/tutor/tutor.ru.cp1251
+++ b/runtime/tutor/tutor.ru.cp1251
@@ -1,29 +1,32 @@
 ===============================================================================
-=    � � � � �   � � � � � � � � � �   �   � � � � � � �   VIM  -  ������ 1.5 =
+=   � � � � �   � � � � � � � � � �   �   � � � � � � �   VIM  --  ������ 1.7 =
 ===============================================================================
-     Vim --- ��� ����� ������ ��������, ������� ��������� ������, �������
-     ����� ��� ����, ����� �� ��� ����� ���� ������� � ����� ��������, ���
-     ����. ���� ������� ������� ��������� ����������� ����� ������ ��� ����,
-     ����� �� ����� � ��������� ������������ Vim � �������� ��������� ������
+
+     Vim -- ��� ����� ������ ��������, ������� ��������� ������, ������� �����
+     ��� ����, ����� �� ��� ����� ���� ������� � ����� ��������, ��� ����.
+     ���� ������� ������� ��������� ����������� ����� ������ ��� ����, �����
+     �� ����� � �������� ������������ Vim � �������� ��������� ������
      ����������.
 
      ��� ����������� �������������� 25-30 ����� �� �������� ������� �������� �
-     ����������� �� ����, ������� ������� �� ��������� �� ������������.
+     ����������� �� ����, ������� ������� �� ��������� �� ������������.
 
-     ������� � ������ ����� �������������� �����. �������� ����� ����� �����,
-     ����� ���������������� �� ��� (���� �� ��������� "vimtutor", �� ��� ���
-     �����).
+     ��������! ��������� � ������ �� ������ �������� ���� �����. ��������
+     ����� ����� �����, ����� ���������������� �� ��� (���� �� ���������
+     "vimtutor", �� ��� ��� �����).
 
      ����� �������, ��� ���� ������� ������������ ��� �������� � ��������
-     �������������. ��� ��������, ��� �� ������ ��������� ������� ��� ����,
-     ����� ��� ������� �� �������. ���� �� ������ ���������� �����, ��
-     �������� �������!
+     �������������. ��� ��������, ��� �� ������ ��������� ������� ��� ����,
+     ����� ��� ������� �� �������. ���� �� ������ ���������� ���� �����, ��
+     �� ��������� �������!
 
-     ������ ��������� � ���, ��� ������� CapsLock �� �������� � �������
-     �������   j   ��������� ���, ���, ����� ���� 1.1 ��������� ���������� ��
+     ������ ��������� � ���, ��� ������� CapsLock �� ��������, � �������
+     �������  j  ��������� ���, ���, ����� ���� 1.1 ��������� ���������� ��
      ������.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			���� 1.1:  ����������� �������
+			 ���� 1.1:  ����������� �������
+
 
 ** ��� ����������� ������� ������� ������� h,j,k,l ���, ��� �������� ����. **
 	     ^
@@ -33,802 +36,972 @@
 	     v
   1. ���������� ������ �� ������, ���� �� ������������ ���� ��������.
 
-  2. �������� ������� `����' (j) ���� ��� �� ������ �����������.
----> ������ �� ������, ��� ������� � ���������� �����.
+  2. �������� ������� `����' (j) ���� ��� �� ������ �����������.
+     ������ �� ������, ��� ������� � ���������� �����.
 
   3. ��������� ������� `����' ��������� � ����� 1.2.
 
-���������: ���� �� ���� �� ������� � ���, ��� ���������, ������� <ESC> ���
-	   �������� � ������� ����� (Normal mode). ����� ����� ������������
-	   ��������� �������.
+���������! ���� �� ���� �� ������� � ���, ��� ���������, ������� <ESC> ���
+	�������� � ������� ����� (Normal mode). ����� ����� ������������
+	��������� �������.
+
+���������! ������� ������� ���������� �������� (�������) ����� ������
+	��������. ������, ������� hjkl �������� ��� ������������
+	����������� �������, ��� ������ �� ��������� ��� ������������.
 
-���������: ������� ������� ���������� �������� (�������) ����� ������
-	   ��������. ������, ������� hjkl �������� ��� ������������
-	   ����������� �������, ��� ������ �� ��������� ��� ������������.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.2: ������ � ���������� ������ � VIM
+		      ���� 1.2: ���������� ������ � VIM
+
 
-!! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
+  !! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
 			       ���� ������� !!
 
-  1. ������� ������� <ESC> (��� ����, ����� ��������������, ��� �� � �������
+  1. ������� ������� <ESC> (��� ����, ����� ��������������, ��� �� � �������
      ������ (Normal mode)).
 
   2. ��������:			:q! <ENTER>.
+     (��� ��������, ��� �� ������ ������� ��� ������� :q! � ������ �������
+     ����.) ��� �������� ��� ����� �� ��������� ��� ���������� ����� ���������
+     ���������.
 
----> ��� �������� ��� ����� �� ��������� ��� ���������� ����� ���������
-     ���������. ���� �� ������ ��������� ��������� � �����:
-				:wq  <ENTER>
+  3. ����� �� ������� ����������� ��������� ��������, �������� �������,
+     ������� ������� ��� � ���� �������. ��� ����� ����:
+				vimtutor <ENTER>
 
-  3. ����� �� ������� ����������� ��������� ��������, �������� �������,
-     ������� ������� ��� � ���� �������. ��� ����� ����
-				vimtutor ru <ENTER>
-     ������ ����� ������������:	vim tutor.ru <ENTER>
+  4. ���� �� ������� � ���, ��� ��������� ��� ����, ��������� ���� �� 1 �� 3
+     ����� ����� ����� ��������� ��������.
 
----> 'vim' ��������� ��������� �������� vim, 'tutor.ru' --- ��� ����, �������
-     �� ������ �������������.
+���������!  :q! <ENTER>  ����������� ����� ��������� ���� ���������. �����
+	��������� ������ �� ������� ��� ��������� ��������� � ����.
+
+  5. ����������� ������ ���� � ����� 1.3.
 
-  4. ���� �� ������� � ���, ��� ��������� ��� ����, ��������� ���� �� 1 �� 3
-     ����� ����� ����� ��������� ��������. ����� ����������� ������ ���� �
-     ����� 1.3.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.3: �������������� ������ - ��������
+		  ���� 1.3: �������������� ������ -- ��������
 
 
-** �������� � ������� ������ ������� x, ����� ������� ������ ��� ��������. **
+** �������� � ������� ������ �������  x  ��� �������� ������� ��� ��������. **
 
-  1. ����������� ������ � ������ �����, ���������� --->.
+  1. ����������� ������ � ������ ����, ���������� --->.
 
   2. ��� ����������� ������, ����������� ������, ���� �� �� �������� ���
      ��������� ��������.
 
-  3. ������� ������� x ��� �������� ���������� �������.
+  3. ������� �������  x  ��� �������� ���������� �������.
 
-  4. ��������� ���� 2--4 ���� ������ �� ����� ����������.
+  4. ��������� ���� �� 2 �� 4 ���� ������ �� ����� ����������.
 
 ---> �� �������� ������ ������ ��� ������ �������.
 
-  5. ������, ����� ������ ����������������, ���������� � ����� 1.4.
-
-���������: � ���� �������� ����� �������� �� ��������� ����������, �����
-	   � �������� �������������.
+  5. ������, ����� ������ ����������������, ���������� � ����� 1.4.
 
+���������! � ���� �������� ����� �������� �� ��������� ����������, �����
+	� �������� �������������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 1.4: �������������� ������ - �������
+		   ���� 1.4: �������������� ������ -- �������
 
 
- ** �������� � ������� ������ (Normal mode), ������� i ��� ������� ������. **
+       ** �������� � ������� ������, �������  i  ��� ������� ������. **
 
-  1. ����������� ������ � ������ ������ �����, ���������� --->.
+  1. ����������� ������ � ������ ������ ����, ���������� --->.
 
   2. ��� ����, ����� ������� ������ ������ ���������� ������, ���������
      ������ �� ������ ����� ������� ������� �������� �����.
 
-  3. ������� i � �������� ��������� ����������.
+  3. �������  i  � �������� ��������� ����������.
 
   4. ����� ����������� ���� ������ ������� <ESC> ��� �������� � ������� �����.
-     ��������� ���� 2--4, ���� ����� �� ����� ���������� ���������.
+     ��������� ���� �� 2 �� 4, ���� ����� �� ����� ���������� ���������.
 
----> ����� ������ � ������ �������� .
+---> ����� ������ � ������ ��������� .
 ---> ����� ������ � ���� ������ ��������� �������.
 
-  5. ����� ������� ������� ������, ���������� ������ � ������.
+  5. ����� ������� ������� ������, ���������� � ����� 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		 ���� 1.5: �������������� ������ -- ����������
 
 
+     ** �������� � ������� ������, �������  A  ��� ���������� ������. **
+
+  1. ����������� ������ � ������ ������ ����, ���������� --->.
+     �� ����� �������� �� ����� ������� ���������� ������ �� ���� ������.
+
+  2. �������  A  � �������� ��������� ����������.
+
+  3. ����� ���������� ���������� ������ ������� <ESC> ��� �������� � �������
+     �����.
+
+  4. ����������� ������ �� ��������� ������, ���������� ---> � ��������� ����
+     �� 2 �� 4 ��� ����������� ���� ������.
+
+---> ����� ������ � ���� ������ ������
+     ����� ������ � ���� ������ ��������� �������.
+---> ����� ����� �� ������ ���
+     ����� ����� �� ������ ����� ������.
+
+  5. ����� ������� ���������� ������, ���������� � ����� 1.6.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 1
+			 ���� 1.6: �������������� �����
+
+
+	** �����������  :wq  ��� ���������� ����� � ������ �� Vim. **
+
+  !! ��������! ������, ��� ��������� ����� �� ��������� ���� �����, ��������
+			       ���� ������� !!
+
+  1. ������� �� Vim, ��� �� ��� ������ � ����� 1.2:  :q!
+     ���, ���� � ��� ���� ������ � ������� ���������, ������ ������� ���������
+     � ���.
+
+  2. �� ����������� ��������� �������� ������� ��������� �������:
+			      vim tutor <ENTER>
+     `vim' -- ������� ��� ������� ��������� Vim, � `tutor' -- ��� ����� ���
+     ��������������. ����������� ��� �����, ������� ����� ��������.
+
+  3. ���������� � �������� �����, ��� �� ��������� � ���������� ������.
+
+  4. ��������� ���� � ����������� � ������� �� Vim ��������:  :wq <ENTER>
+
+  5. ���� �� ����� �� vimtutor �� ���� 1, ������������� vimtutor � ����������
+     � ���������� ������.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 1
+
 
   1. ������ ������������ ���� ��������� �� ���������, ���� ��������� hjkl.
-	 h (�����)	j (����)       k (�����)	    l (������)
+	h (�����)	j (����)	k (�����)	l (������)
 
-  2. ��� ������� Vim (�� ����������� % ��������� ��������) ��������:
-     vim ���_����� <ENTER>
+  2. ��� ������� Vim (�� ����������� ��������� ��������) ��������:
+			    vim ���_����� <ENTER>
 
   3. ��� ���������� ������ � Vim ��������:
-     <ESC>   :q!	 <ENTER>  ����� ���������� �� ���������� ���������.
+	<ESC>   :q!   <ENTER>  ����� ���������� �� ���������� ���������.
      ��� ��������:
-     <ESC>   :wq	 <ENTER>  ����� ��������� ���������.
+	<ESC>   :wq   <ENTER>  ����� ��������� ���������.
 
-  4. ��� �������� ������� ��� �������� � ������� ������, ��������: x
+  4. ��� �������� ������� ��� �������� � ������� ������, �������:  x
 
   5. ����� �������� ����� ����� �������� � ������� ������, ��������:
-	 i     ������� �����	<ESC>
+	 i   ������� ����������� �����   <ESC>
+     ����� �������� ����� ����� �������:
+	 a   ������� ����������� �����   <ESC>
 
-���������: ������� <ESC> ���������� ��� � ������� ����� (Normal mode) ����
-	   ������� ������������� � �������� ����������� �������.
+���������! ������� <ESC> ���������� ��� � ������� ����� (Normal mode) ����
+	������ ������������� � �������� ����������� �������.
 
-������ ��������� � ����� 2.
+������ ���������� � ����� 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 2.1: ������� ��������
+			   ���� 2.1: ������� ��������
 
 
-	** �������� dw ��� �������� ������� ������ �� ����� �����. **
+       ** ��������  dw  ��� �������� ������� ������ �� ����� �����. **
 
   1. ������� <ESC>, ����� ������� � ������� �����.
 
-  2. ����������� ������ ����, � ������, ���������� --->.
+  2. ����������� ������ ����, � ������ ���������� --->.
 
   3. ����������� ������ � ������ �����, ������� ������� �������.
 
-  4. ��������  dw , ����� ������� ��� �����.
+  4. ��������  dw  ��� �������� ����� �����.
 
-���������: �� ����� ������ ����� dw �������� � ��������� ������ ������. ����
-	   �� ���-�� �������� �����������, ������� <ESC> � ������� �������.
+���������! �� ����� ������ ����� dw �������� ������ � ����� ������ ������
+	������. ���� �� ���-�� ������� �����������, ������� <ESC> � �������
+	�������.
 
 ---> ��������� ���� ������� � ���� ����������� �������� �������.
 
   5. ��������� ���� 3 � 4, ���� �� ��������� ��� ������ � ���������� �
      ����� 2.2.
 
-
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 2.2: �������������� ������� ��������
+		   ���� 2.2: �������������� ������� ��������
 
 
-	    ** �������� d$ ��� �������� ������ �� ����� ������. **
+	   ** ��������  d$  ��� �������� ������ �� ����� ������. **
 
   1. ������� <ESC>, ����� ������� � ������� �����.
 
-  2. ����������� ������ ����, � ������, ���������� --->.
+  2. ����������� ������ ����, � ������ ���������� --->.
 
-  3. ����������� ������ � ����� ���������� ������ (����� ������ . ).
+  3. ����������� ������ � ����� ���������� ������ (����� ������ �����).
 
-  4. ����� ������� ������� ������, ��������  d$ .
+  4. ��������  d$  ��� �������� ������� ������.
 
 ---> ���-�� ������ ��������� ���� ������ ������. ��������� ���� ������ ������.
 
 
-  5.����� ����� ����������� � ����, ���������� � ����� 2.3.
-
-
-
-
+  5. ����� ����� ����������� � ���, ��� ��� ����������, ���������� � ����� 2.3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 2.3: ������� � �������
+			  ���� 2.3: ������� � �������
+
 
+  ������ �������, ���������� �����, ������� �� ��������� � �������. ������
+  ������� �������� � ����������  d  ���������:
 
-  ������ ������� `��������' d �����:
+  	d   ������
 
-	 [�����]   d	������	    ���	     d	 [�����]   ������
   �����:
-    �����  - ������� ��� ��������� ������� (�������������, �� ���������=1).
-    d      - ������� ��������.
-    ������ - � ��� ������� ������ ���� ��������� (����������� ����).
+    d      - �������� ��������.
+    ������ - ��� ��� ������ ���� ��������� ������� (����������� ����).
 
   ������� ������ ��������:
-    w - �� ������� �� ����� �����, ������� ����������� ������.
-    e - �� ������� �� ����� �����, �� ������� ����������� ������.
+    w - �� ������� �� ����� �����, ������� ����������� ������.
+    e - �� ������� �� ����� �����, �� ������� ����������� ������.
     $ - �� ������� �� ����� ������.
     ^ - �� ������� �� ������ ������.
 
-���������: ������� ������� �� ������ ������� � ������� ������ (Normal mode)
-	   ��� �������������� ������ ���������� ������ ���, ��� ������� �
-	   ������ ��������.
+���������! ������� ������� �� ������ ������� � ������� ������ (Normal mode)
+	��� ���������������� ��������� ���������� ������ ���, ��� �������
+	� ������ ��������.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		���� 2.4: ������������� �ר����� ��� �����������
+
+
+      ** ���� ����� ����� ���������� ����������� ������� � ��� ����������
+			  �������� ���������� ���. **
+
+  1. ����������� ������ � ������ ������ ���������� ---> ����.
+
+  2. ��������  2w  ��� ����������� ������� ����� � ������ ������� �����.
+
+  3. ��������  3e  ��� ����������� ������� ����� � ����� �������� �����.
+
+  4. ��������  0  (����) ��� ����������� � ������ ������.
+
+  5. ��������� ���� 2 � 3 � ���������� �������.
+
+---> ������� ������ �� ���� ��� ������ ����������� �� ���.
 
+  6. ���������� � ����� 2.5.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	       ���� 2.4: ���������� �� ������� `�������-������'
+		 ���� 2.5: ������������� �ר����� ��� ��������
 
 
-		 ** �������� dd ��� �������� ���� ������. **
+	    ** ���� ����� ����� ���������� ������� � ��� ����������
+			  �������� ���������� ���. **
+
+  �������� ����� ����� ����� �������� � ���������� ��������� �������� �
+  ����������� ��������� ���� ��� �������� ���������� ���������� ��������:
+	 d   �����   ������
+
+  1. ����������� ������ � ������� ����� �� ��������� ���� � ���������� --->
+     ������ ����.
+
+  2. ��������  d2w  ��� �������� ���� ���� �� ��������� ����.
+
+  3. ��������� ���� 1 � 2 � ������� ������� ��� �������� ���������������� ����
+     �� ��������� ���� ����� ��������.
+
+---> ��� ��� �� ������ ���� �� ��� �� ���� � �� ��� �������.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 2.6: �������� �� ��������
+
 
-  ���������� ������� ���������� �������� �������� ���� ������, ������������
-  Vim ������, ��� ��� ����� ����� ����� ������ ������� d ������.
+		** ��������   dd   ��� �������� ����� ������. **
+
+  � ����� � ������ �������������� �������� ����� ������, ��������� Vi ������
+  ��� ��������� ������� ��������� �������� ������ ������� ���� d.
 
   1. ����������� ������ ����, �� ������ ������ �����.
+
   2. �������� dd ��� �������� ������.
-  3. ������ ������������� � ��������� ������.
-  4. �������� 2dd (��������� ������� `�����-�������-������'), ����� �������
-     ��� ������.
 
-      1)  ����� � ���� �� �������,
-      2)  �, ��� �������� �������� �����!
-      3)  � ����� �� ``�����'', ``�����'' --- �������!
-      4)  �������� � ����� �� ���� ���������!
-      5)  ��� �������� ��� ����� ��� �����...
-      6)  � ���� �� �������� � ���� `�'
-      7)  � ����� �� ������� �������� �����.
+  3. ������ ������������� � �������� ������.
+
+  4. �������� 2dd ��� �������� ���� �����.
+
+--->  1)  ����� � ���� �� �������,
+--->  2)  �, ��� �������� �������� �����!
+--->  3)  � ����� �� ``�����'', ``�����'' --- �������!
+--->  4)  �������� � ����� �� ���� ���������!
+--->  5)  ��� �������� ��� ����� ��� �����...
+--->  6)  � ���� �� �������� � ���� `�'
+--->  7)  � ����� �� ������� �������� �����.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 2.5: ������� `�����'
+			   ���� 2.7: ������� `������'
 
 
-  ** ������� u	��� ������ ���������� ������ ���������� �������, U ��� ������
-			����������� �� ���� ������. **
+  ** �������  u  ��� ������ ���������� ������ ���������� �������, U ��� ������
+			 ����������� �� ���� ������. **
 
-  1. ����������� ������ ����, � ������, ���������� ---> � ���������� ��� ��
+  1. ����������� ������ ����, � ������ ���������� --->, � ���������� ��� ��
      ������ ������.
-  2. ������� x ��� �������� ������� ������������� �������.
-  3. ������ ������� u ��� ������ (������) ��������� ����������� �������.
-  4. ��������� ��� ������ � ������, ��������� ������� x .
-  5. ������ ������� ��������� U ��� ����, ����� ������� ��� ������ � ��������
-     ���������.
-  6. ������� u ��������� ��� ��� ������ ������� U � ���������� ������.
-  7. ������� ������ CTRL-R (����������� ������� CTRL ������� � ������ �������
-  R)     ��������� ��� ��� �������� ������ (����� ������).
 
----> ���������� ������� � ����� ������ � �������� �� �� �������� `������'.
+  2. �������  x  ��� �������� ������� ������������� �������.
 
-  8. ��� ���� ����� �������� �������. ����� ���������� � ������ ����� 2.
+  3. ������ �������  u  ��� ������ (������) ��������� ����������� �������.
+
+  4. ��������� ��� ������ � ������, ��������� �������  x .
+
+  5. ������ ������� ���������  U  ��� ����, ����� ������� ��� ������
+     � �������� ���������.
+
+  6. �������  u  ��������� ��� ��� ������ �������  U  � ���������� ������.
 
+  7. ������� ������ CTRL-R (�.�. ����������� ������� CTRL ������� � ������
+     ������� ������� R) ��������� ��� ��� �������� ������ (����� ������).
+
+---> ���������� ������� � ����� ������ � �������� �� �� �������� `������'.
+
+  8. ��� ���� ����� �������� �������. ����� ���������� � ������ ����� 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 2
+				 ������ ����� 2
+
 
+  1. ��� �������� ������ �� ������� �� ����� ����� ��������:	dw
 
-  1. ��� �������� ������ �� ������� �� ����� ����� ��������:    dw
+  2. ��� �������� ������ �� ������� �� ����� ������ ��������:	d$
 
-  2. ��� �������� ������ �� ������� �� ����� ������ ��������:    d$
+  3. ��� �������� ���� ������ ��������:		dd
 
-  3. ��� �������� ���� ������ ��������:    dd
+  4. ��� ������� ����������� ������� ���������� ����� ��������:	2w 
 
-  4. ������ ������� � ������� ������ ����� ���:
+  5. ������ ������� � ������� ������ ����� ���:
 
        [�����]   �������   ������     ���     �������	[�����]   ������
      ���:
-       �����   - ������� ��� ��������� ���������� �������
+       [�����] - ������� ��� ��������� ���������� �������, �����������
        ������� - ��� ���������, �������� d ��� ��������
        ������  - �� ��� ������ �������������� �������, �������� w (�����),
 		$ (�� ����� ������), � �.�.
 
-  5. ��� ������ (������) �������������� �������� ��������:  u (�������� u)
-     ��� ������ (������) ���� ��������� � ������ ��������:  U (��������� U)
+  6. ��� �������� � ������ ������ ����������� ����:  0
+
+  7. ��� ������ (������) �������������� �������� ��������:  u  (�������� u)
+     ��� ������ (������) ���� ��������� � ������ ��������:  U  (��������� U)
      ��� ������ ������ ��������:  CTRL-R
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 3.1: ������� �������
+			   ���� 3.1: ������� �������
 
 
-   ** �������� p ��� ������� ���������� ���������� ������ ����� �������. **
+   ** ��������  p  ��� ������� ���������� ��������� ������ ����� �������. **
 
-  1. ����������� ������ ���� � ��������� ������ �� ������.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
-  2. �������� dd ��� �������� ������ � �� ���������� � ������ Vim'�.
+  2. ��������  dd  ��� �������� ������ � � ���������� � ������ Vim'�.
 
   3. ����������� ������ � ������ ��� ��� ������, ���� ������� ��������
-     ��������� ������.
-
-  4. �������� � ������� ������ �������� p ��� ������ ������.
+     �������� ������.
 
-  5. ��������� ���� 2--4, ���� �� ���������� ��� ������ � ������ �������.
+  4. �������� � ������� ������ ��������  p  ��� ������� ������ ���� �������.
 
-     �) � ����� �������� �� ���.
-     �) ����� �� � ����� �������,
-     �) �� ������� ���� ��������
-     �) ��� ���� ����� ������� ������
+  5. ��������� ���� �� 2 �� 4, ���� �� ���������� ��� ������ � ������ �������.
 
+---> �) � ����� �������� �� ���.
+---> �) ����� �� � ����� �������,
+---> �) �� ������� ���� ��������
+---> �) ��� ���� ����� ������� ������
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       ���� 3.2: ������� ������
+			    ���� 3.2: ������� ������
 
 
-	  ** �������� r � ������, ���������� ������ ��� ��������. **
+	  ** ��������  r  � ������, ���������� ������ ��� ��������. **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
   2. ���������� ������ ���, ����� �� ��������� ��� ������ �������.
 
-  3. �������� r	� ����� ������, ������������ ������.
+  3. ��������  r  � ����� ������, ������������ ������.
 
-  4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ����������.
+  4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ���������� ��� ������.
 
 --->  � ������ ������ ���� ������ ���0��� � ������ ������� �� ��������!
 --->  � ������ ������ ���� ������ ���-��� � ������ ������� �� ��������!
 
-  5. ������ ���������� � ����� 3.2.
-
-���������: �������, ��� �� ������ ������� � �������� ������, � �� ������
-	   ���������.
+  5. ������ ���������� � ����� 3.3.
 
+���������! �������, ��� �� ������ ������� � �������� ������, � �� ������
+	���������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 3.3: ������� ���������
+			  ���� 3.3: ������� ���������
 
 
-		** ��� ��������� ����� ����� �������� cw . **
+	    ** ��� ��������� �������� ����� ����� ��������  ce . **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
   2. ����������� ������ ��� ������ `o' � ����� `����'.
 
-  3. �������� cw � ��������� ����� (� ������ ������, �������� `���'.)
+  3. ��������  ce  � ��������� ����� (� ������ ������, �������� `���').
 
   4. ������� <ESC> � ���������� � ��������� ������ (� ������� �������, �������
-     ���� ��������.)
+     ���� ��������).
 
-  5. ��������� ���� 3--4 ���� ������ ����������� �� ������ ���������� �������.
+  5. ��������� ���� 3 � 4 ���� ������ ����������� �� ������ ���������� �������.
 
 ---> ��������� ���� � ���� ������ ������� ��������������.
 ---> ��������� ���� � ���� ������ ������� ��������������.
 
-�������� ��������, ��� cw �� ������ �������� �����, �� � ��������� ��� � �����
-�������.
-
+   �������� ��������, ���  ce  �� ������ ������� �����, �� � ��������� ��� �
+   ����� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  ���� 3.4: ���������� �������� � �������� c
+		  ���� 3.4: ���������� �������� � ��������  c
 
 
-** ������� ������ ������������ � ���� �� ���������, ��� � ������� ��������. **
+ ** ������� ������ ������������ � ���� �� ���������, ��� � ������� ��������. **
 
   1. ������� ��������� ����������� ����� �� �������, ��� � ������� ��������.
-     �� ������ �����:
+     Ÿ ������ �����:
 
-       [�����]   c   ������	   ���	    c	[�����]   ������
+       [�����]   c   ������           ���           c   [�����]   ������
 
   2. ������� ����� ���������: w (�����), $ (����� ������) � �.�.
 
-  3. ����������� ������ ����, � ������, ���������� --->.
+  3. ����������� ������ ����, � ������ ���������� --->.
 
   4. ��������� � ������ ������.
 
-  5. �������� c$ � �������������� ������ ������ ���, ����� ��� ��������� ��
+  5. ��������  c$  � �������������� ������ ������ ���, ����� ��� ��������� ��
      ������, ����� ���� ������� <ESC>.
 
 ---> ����� ���� ������ ��������� � ������, ����� ����� ������� �� ������.
----> ����� ���� ������ ��������� � ������ ������� c$ .
+---> ����� ���� ������ ��������� � ������ �������  c$ .
 
+���������! ������� Backspace ����� �������������� ��� ����������� ��� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 3
+				 ������ ����� 3
 
 
-  1. ��� ������� ������, ������� ������ ��� ��� ������, �������� p . ���
-     ������� ������� ��������� ����� ����� ������� (���� ���� ������� ������,
+  1. ��� ������� ������, ������� ������ ��� ��� �����, ��������  p . ���
+     ������� ������� �������� ����� ����� ������� (���� ���� ������� ������,
      �� ��� ����� �������� � ������ ��� ��������).
 
-  2. ��� ������ ������� ��� �������� �������� r � ����� ���������� ������.
+  2. ��� ������ ������� ��� �������� ��������  r  � ����� ���������� ������.
 
-  3. ������� ��������� ��������� ��� �������� ��������� ������ �� ������� ��
-     ����� ����� �������. ��������, �������� cw ��� ������ �� ������� ��
-     ����� �����, c$ ��� ��������� �� ����� ������.
+  3. ������� ��������� ��������� ��� �������� ��������� ������ �� ������� ��
+     ��������� �����������. ��������, ��������  ce  ��� ������ �� ������� ��
+     ����� �����,  c$  ��� ��������� �� ����� ������.
 
   4. ������ ������� ��������� �����:
 
-	 [�����]   c	������	      ���	c   [�����]   ������
-
-������ ������������� � ���������� �����.
-
-
-
+	 [�����]   c   ������         ���         c   [�����]   ������
 
+������ ���������� � ���������� �����.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	      ���� 4.1: ���������� � ����� � ������������ � ���
+	       ���� 4.1: ���������� � ����� � ������������ � ���
 
 
- ** �������� CTRL-g ����� ������� ���� ����������������� � ����� � ����������
-				    � ���.
-	�������� SHIFT-G ��� ����������� � �������� ������ � �����. **
+       ** �������� CTRL-g ����� ������� ���� ����������������� � ����� �
+     ���������� � �����. ��������  G  (SHIFT-G) ��� ����������� � ��������
+			       ������ � �����. **
 
-  ���������: ���������� ���� ���� ������ ��� ��������� ����� �������!!
+���������! ���������� ���� ���� ������ ��� ��������� ����� �������!
 
-  1. ��������� ������� Ctrl ������� g . ����� ������ �������� ������ ������� �
-     ������ ����� � ������� ������, � ������� �� ����������. ��������� �����
+  1. ��������� ������� Ctrl �������  g . ����� ������ �������� ������ �������
+     � ������ ����� � ������� ������, � ������� �� ����������. ��������� �����
      ������, �� ����������� �� ���� 3.
 
-  2. ������� shift-G ��� ����������� � ����� �����.
-
-  3. �������� ����� ������, � ������� �� ���������� � ����� shift-G. ���
-     ������ ��� � ������, � ������� �� ����, ����� � ������ ��� ������ Ctrl-g.
-     (����� �� ������ �������� �����, ��� �� ����������� �� ������.)
+  2. ��������� ������� Shift �������  g  ��� ����������� � ����� �����.
 
-  4. ���� �� ��������� ��� �������������, ��������� ���� 1--3.
+  3. �������� ����� ������, � ������� �� ���������� � ����� Shift-G. ���
+     ������ ��� � ������, � ������� �� ����, ����� � ������ ��� ������ Ctrl-g.
 
+  4. ���� �� ��������� ��� �������������, ��������� ���� � 1 �� 3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			   ���� 4.2: ������� ������
+			    ���� 4.2: ������� ������
 
-	      ** ��������  /  � ����� ������� ������� �����. **
+
+	       ** ��������  /  � ����� ������� ������� �����. **
 
   1. � ������� ������ (Normal mode) �������� ������  / . �������� ��������,
      ��� �� ������ � �������� �������� ����� ������, ��� ��� ���������� �
-     �������� :	.
+     ��������  : .
 
-  2. ������ �������� '��������' <ENTER>. ��� �� �����, ������� �� ������
+  2. ������ �������� '��������' <ENTER>. ��� �� �����, ������� �� ������
      ������.
 
-  3. ��� ����, ����� ��������� �����, ������ ������� n .
-     ��� ������ ���� ����� � �������� �����������, ������� Shift-N .
+  3. ��� ����, ����� ��������� �����, ������ �������  n .
+     ��� ������ ���� �� ����� � �������� �����������, �������  Shift-N .
+
+  4. ���� �� ������� ����� ������ � �������� �����������, �����������
+     �������  ?  ������  / .
 
-  4. ���� �� ������� ����� ������ � �������� �����������, �����������
-     ������� ? ������ / .
+  5. ��� ����, ����� ��������� ����, ������ �� ������ ����� �������  Ctrl-O.
+     (��������� ������� ������� Ctrl �������  o ). ��������� ��������� ���
+     ��� ����������� ��������. ��� �������� ����� �����������  Ctrl-I .
 
----> ����� �� ��� ������ ���������� ����� �����, ����� ����� ��������� �
-     ������.
+---> "��������" ��� �� ������ ��������� ����� `������';  �������� ��� ������.
 
-  "��������" ��� �� ������ ������������ ����� `������';  �������� ��� ������.
+���������! ���� ��� ������ ����� ��������� ���� �����, �� ����� ����� ���������
+	� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			���� 4.3: ����� ������ ������
 
 
-		** �������� % ��� ������ ������ ),] ��� } . **
+		 ** ��������  %  ��� ������ ������ ), ] ��� } . **
 
-  1. ��������� ������ ��� ����� �� (, [ ��� { � ������ �����, ���������� --->.
+  1. ��������� ������ ��� ����� �� (, [ ��� { � ������ ����, ���������� --->.
 
-  2. ������ �������� ������ % .
+  2. ������ �������� ������  % .
 
   3. ������ ������ ����������� �� ������ ������.
 
-  4. �������� % ��� �������� ������� ����� � ������ ������.
+  4. ��������  %  ��� �������� ������� ����� � ������ ������.
 
 ---> ��� ( ������, ���������� ����� (, ����� [ ] � ����� { } ������. ))
 
-���������: ��� ����� ������ ��� ������� �������� � ������������ ��������!
-
-
-
-
-
+���������! ��� ����� ������ ��� ������� �������� � ������������ ��������!
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		      ���� 4.4: ������ ����������� ������
 
 
-	 ** �������� :s/����/�����/g ��� ������ '����' �� '�����'. **
+	 ** ��������  :s/����/�����/g  ��� ������ '����' �� '�����'. **
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+  1. ����������� ������ ����, � ������ ���������� --->.
 
-  2. �������� :s/�����/����� <ENTER> . �������� �������� �� ��, ��� ��� �������
-     ������� ������ ������ ��������� ��������� � ������.
+  2. ��������  :s/�����/����� <ENTER> . �������� �������� �� ��, ��� ���
+     ������� ������� ������ ������ ��������� ��������� � ������.
 
-  3. ������ �������� :s/�����/�����/g , ���������� ����������� ��������� ��
-     ���� ������. ��� ������� ��� ��������� � ������ ���������.
+  3. ������ ��������  :s/�����/�����/g , ����������� � ����� g ��������
+     ����������� ��������� �� ���� ������. ��� ������� ��� ��������� � ������
+     ���������.
 
 ---> � ����� � ����������� ��������, � ����� ������ ���������� ����, � ����� �
      ������� ����������.
 
   4. ��� ������ ���� ��������� ������������������ �������� ����� �����
      ��������,
-     �������� :#,#s/����/�����/g  ��� #,# --- ������ ���� �����.
-     �������� :%s/����/�����/g    ��� ������ ���� ��������� �� ���� �����.
-
+     ��������  :#,#s/����/�����/g  ��� #,# -- ������ ���� �����.
+     ��������  :%s/����/�����/g    ��� ������ ���� ��������� �� ���� �����.
+     ��������  :%s/����/�����/gc   ��� ������ ���� ��������� �� ���� ����� �
+                                   ������� ������������� ������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 4
-  1. Ctrl-g ���������� ���� ��������� � ����� � ���������� � ���.
-     Shift-G ���������� ��� � ����� �����. �����, �� ������� ������� Shift-G
+				 ������ ����� 4
+
+
+  1. Ctrl-g  ���������� ���� ��������� � ����� � ���������� � ���.
+     Shift-G  ���������� ��� � ����� �����. �����, �� ������� ������� Shift-G
      ��������� ������� � ������ � ���� �������.
+     gg  ���������� ��� � ������ ������ �����.
 
-  2. ������� / � ����� ���� ������ ��������� ���������� ����� ���� ������
-     ������ �� ������.
-     ������� ? � ����� ���� ������ ��������� ���������� ����� ���� ������
+  2. �������  /  � ����� ���� ������ ��������� ���������� ����� ���� ������
+     ���� �� ������.
+     �������  ?  � ����� ���� ������ ��������� ���������� ����� ���� ������
      ����� �� ������.
-     ����� ������ �������� n ��� �������� � ���������� ��������� �������
+     ����� ������ ��������  n  ��� �������� � ���������� ��������� �������
      ������ � ��� �� ����������� ��� Shift-N ��� �������� � ���������������
      �����������.
 
-  3. ������� % , ����� ������ ��������� �� (,),[,],{, ��� } ��������� �����
+  3. �������  % , ����� ������ ��������� �� (,),[,],{, ��� } ��������� �����
      ������ ������.
 
   4. ��� ����������� `�����' ������ ������� `����' � ������, ��������
-     :s/old/new
+	:s/old/new
      ��� ����������� `�����' ������ ���� `����' � ������, ��������
-     :s/old/new/g
+	:s/old/new/g
      ��� ������ � ��������� ����� ����� ��������, ��������
-     :#,#s/old/new/g
+	:#,#s/old/new/g
      ��� ������ ���� ��������� `����' �� `�����' � �����, ��������
-     :%s/old/new/g
+	:%s/old/new/g
      ����� �������� ������ ��� ���������� �������������, �������� 'c'
-     :%s/old/new/gc
+	:%s/old/new/gc
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		   ���� 5.1: ��� ��������� ������� �������
+		    ���� 5.1: ��� ��������� ������� �������
 
 
-    ** �������� :! � ����� ������� �������, ������� ������� ���������. **
+    ** ��������  :!  � ����� ������� �������, ������� ������� ���������. **
 
-  1. �������� ��� �������� ��� ������� : ��� ��������� ������� � ���������
-     ������ ���������. ��� �������� ��� ������ �������.
+  1. �������� ��� �������� ��� �������  :  ��� ��������� ������� � ���������
+     ������ ���������. ��� �������� ��� ������ �������.
 
-  2. ������ �������� ������ ! (��������������� ����). ������ ����� ���������
+  2. ������ �������� ������  !  (��������������� ����). ��� �������� ���������
      ������� �������, ��������� ��������� ��������.
 
-  3. ��� ������� �������� ls ����� ! � ������� <ENTER>. ��� ������� �������
-     ������ ������ � ������� ��������, ����� �����, ��� ���� �� �� ����� ���
-     ������� � ����������� ��������. ��� ���������� :!dir , ���� ����������
-     ������� �� ���������.
-
----> ���������: ����� �������� ����� ��������� ����� ������� �������.
+  3. ��� ������� ��������  ls  �����  !  � ������� <ENTER>. ������� �������
+     ������ ������ � ������� ��������, ����� �����, ��� ���� �� �� ����� ���
+     ������� � ����������� ��������. ��� ����������  :!dir , ���� ������� ls
+     �� ���������.
 
----> ���������: ��� �������, ������������ � : , ������ ����������� ��������
-     <ENTER>.
+���������! ����� �������� ����� ��������� ����� ������� ������� � ���������
+	����������.
 
+���������! ��� �������, ������������ �  : , ������ ����������� ��������
+	<ENTER>. ����� �� ��� �� ������ ����� ���������� ������ ��������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			 ���� 5.2: ��� �������� ����
 
 
-** ��� ���������� ���������, ������������� � �����, �������� :w ���_�����. **
+	      ** ��� ���������� ���������, ������������ � �����,
+			   ��������  :w ���_�����. **
 
-  1. �������� :!dir ��� :!ls ��� ��������� ������ ������ � ������� ��������.
-     ��� ��� ��� ��������, �� ������ ������ <ENTER> ����� ����� ���� ������.
+  1. ��������  :!dir  ���  :!ls  ��� ��������� ������ ������ � �������
+     ��������.  ��� ��� ��� ��������, ����� ����� ������� ���� ������ <ENTER>.
 
-  2. ���������� �������� ��� �����, ������� ��� �� ����������, �������� TEST.
+  2. ���������� �������� ��� �����, ������� ��� �� ����������, �������� TEST.
 
-  3. ������ �������� :w TEST (��� TEST --- ��� ��� �����, ����������� ����.)
+  3. ������ ��������  :w TEST  (��� TEST -- ��� ��� �����, ����������� ����.)
 
-  4. ��� ������� �������� ���� ���� (������� �� Vim) ��� ������ TEST. �����
-     �������������� � ����, ����� �������� :!dir � ����������� �������.
+  4. ������� �������� ���� ���� ���� (������� �� Vim) ��� ������ TEST. �����
+     �������������� � ����, ����� ��������  :!dir  ��� :!ls  � �����������
+     �������.
 
----> ��������, ��� ���� �� ������� �� Vim � ����� ��������� ��� ����� �
-     ������ TEST, ���� ���� ����� ������ ������ �������� � ��� ������, �����
-     �� ��� ���������.
-
-  5. ������ ������� ���� ����, ������ :!del TEST
+���������! ���� �� ������� �� Vim � ����� ��������� ��� ����� � ������ TEST
+	(�.�. ���������  vim TEST ), ���� ���� ����� ������ ������ ��������
+	� ��� ������, ����� �� ��� ���������.
 
+  5. ������ ������� ���� ����, ������ ��� MS-DOS    :!del TEST
+                                      ��� Unix      :!rm TEST
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		       ���� 5.3: ���������� ����������
 
 
-	 ** ��� ���������� ����� �����, �������� :#,# w ���_����� **
-
-  1. ��� ��� �������� :!dir ��� :!ls ��� ��������� ������ ������ � �������
-     �������� � �������� ���������� ���, �������� TEST.
+	   ** ��� ���������� ����� �����, ��������  v  �������� �����
+			  � ��������� �  :w ���_����� **
 
-  2. ����������� ������ � ������ ���� �������� � ������� Ctrl-g ��� ����������
-     ������ ������to. ��������� ���� �����!
+  1. ����������� ������ � ���� ������.
 
-  3. ������ ������������� � ����� �������� � ����� �������� Ctrl-g. ���������
-     � ���� ����� ����!
+  2. �������  v  � ����������� ������ ���� � ������ ����. �������� ��������,
+     ��� ����� ���������.
 
-  4. ��� ���������� ������ ����� ����� �������� :#,# w TEST , ��� #,# --- ���
-     ������, ������� �� ��������� (������, �����), � TEST --- ��� ������ �����.
+  3. �������  :  � ����� ������ ��������  :'<,'> .
 
-  5. ��� � ������, ��������� � ������� ����� ����� �������� :!dir , �� ��
-     �������� ���.
+  4. �������  w TEST  (��� TEST -- ��� �����, ������� ��� �� ����������).
+     �� ������� <ENTER>, ��������� ��� ����� ������ ��������  :'<,'>w TEST.
 
+  5. Vim ������� ��������� ������ � ���� TEST. ��� � ������, ��������� �
+     ������� ����� ����� ��������  :!dir  ���  :!ls . �� �������� ���� ����, ��
+     ����������� � ��������� �����.
 
+���������! �������  v  �������� ���������� �����. �� ������ ���������� ������
+	��� ��������� ������. ����� ��� ���������� ��������� ����� ���������
+	�����-�� ��������, ��������, ������� ��������  d.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		    ���� 5.4: ������ � ����������� ������
+		     ���� 5.4: ������ � ����������� ������
 
-	  ** ��� ������� ����������� �����, ��������  :r FILENAME **
 
-  1. �������� :!dir ��� ����, ����� ��������� � ���, ��� ���� TEST ��� ���
-     ����������.
+	** ��� ������� ����������� �� �����, ��������  :r ���_�����  **
 
-  2. ���������� ������ � ������� ����� ���� ��������.
+  1. ���������� ������ ��� ���� �������.
 
-���������: ����� ���������� ���� 3 �� ������� ���� 5.3.	����� �����
-	   ������������� ����, ����� � ����� �����.
+���������! ����� ���������� ���� 2 �� ������� ����� �� ����� 5.3. �������������
+	���� �� ������ �� ����� �����.
 
-  3. ������ ���������� ��� ���� TEST, ��������� ������� :r TEST , ���
-     TEST --- ��� ��� �����.
+  2. ������ ���������� ��� ���� TEST, ��������� �������  :r TEST , ��� TEST --
+     ��� ��� �����.
 
-���������: ����������� ���� ���� ����� �������� � ��� �����, ��� ���������
-	   ������.
+  3. ��� �������� ��� ���������� ����� ���� ���������, ������������� �� ������
+     � ��������������, ��� ������ � ��� ��� ����� ����� 5.3: �������� � ��
+     ����� TEST.
 
-  4. ����� ��������� � ���, ��� ���� ��������, ������������� ������� ����� ��
-     ������ � ��������, ��� ������ ���������� ��� ����� ����� 5.3, ��������
-     � ���������� �� �����.
+���������! �������� ����� � ����� ������� �������. ��������,  :r !ls  ���������
+	����� ������� ls � ������� ��� ���� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 5
+				 ������ ����� 5
 
 
   1.  :!�������  ��������� ������� �������.
 
       ��������� �������� �������:
-	  :!dir --- ������� ������ ������ � ��������.
-	  :!del FILENAME --- ������� ���� FILENAME.
+      	(MS-DOS)	(Unix)
+	 :!dir		 :!ls		-- ������� ������ ������ � ��������.
+	 :!del ���	 :!rm ���	-- ������� ���� �� �����.
 
-  2.  :w FILENAME ���������� ������� ������������� ���� �� ����
-      ��� ������ FILENAME.
+  2.  :w ���_�����  ���������� ������� ������������� � Vim ���� �� ���� ���
+      ��������� ������.
 
-  3.  :#,#w FILENAME ��������� ������ �� # �� # � ���� FILENAME.
+  3.  v  �����������  :w ���_�����  ��������� ��������� ��������� ������ � ����
+      � ��������� ������.
 
-  4.  :r FILENAME ��������� � ����� ���� FILENAME � �������� ��� � �������
-      ���� ������ �� �������� �������.
+  4.  :r ���_�����  ��������� � ����� ���� � ��������� ������ � �������� ���
+      ���� �������.
 
+  5.  :r !dir  ������ ����� ������� dir � �������� ��� ���� �������.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			   ���� 6.1: ������� ��������
 
 
+   ** ��������  o  ����� ������� ������ ������ ��� �������� � ������� � �����
+			    ������� (Insert mode) **
 
+  1. ����������� ������ ����, � ������ ���������� --->.
 
+  2. ��������  o  (� ������ ��������) ��� ����, ����� ������� ������ ������
+     ���� ������� � ������� � ����� ������� (Insert mode).
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  ���� 6.1: ������� ��������
+  3. ������ �������� �����-������ ����� � ������� <ESC> ��� ������ �� ������
+     �������.
 
+---> ����� �������  o  ������ ������� �� ����� ������ ������ � ������ �������.
 
- ** �������� o ����� ������� ������ ������ ��� �������� � ������� � �����
-			   ������� (Insert mode) **
+  4. ��� �������� ������ ���� �������, ������ �������� ���������  O , ������
+     ��������  o . ���������� ��������� ��� � ������������� �������.
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+---> �������� ����� ������ ��� ����, �������� �� �� ������ � ����� Shift-O.
 
-  2. �������� o (� ������ ��������) ��� ����, ����� ������� ������ ������
-     ���� ������� � ������� � ����� ������� (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 6.2: ������� ����������
+
+
+	    ** ��������  a , ����� �������� ����� ����� �������. **
+
+  1. ����������� ������ ����, � ������ ������ ������ ���������� --->.
 
-  3. ������ ���������� ���������� ---> ������ � ������� <ESC> ��� ������ ��
-     ������ �������.
+  2. ���������  e  ���� ������ �� ������������� �� �����  c��� .
 
----> ����� ������� o ������ �������� �� ����� ������ ������ � ������ �������.
+  3. ��������  a  (� ������ ��������) ��� ���������� ������ ����� �������,
+     ������������ ��� ��������. (��������� A ��������� �������� � �����
+     ������.)
 
-  4. ��� �������� ������ ���� �������, ������ �������� ��������� O, ������
-     �������� o. ���������� ��������� ��� � ������������� �������.
-�������� ����� ������ ��� ����, ����� Shift-O, �������� ������ �� ��� ������.
+  4. �������� ����� ���, ��� �������� � ������ ����. ������� <ESC> ��� ������
+     �� ������ ������� (Insert mode).
 
+  5. �����������  e  ��� �������� � ����� ���������� �������������� ����� �
+     ��������� ���� 3 � 4.
 
+---> ��� ���� �������� ��� ����������� � ������� ������.
+---> ��� ������� �������� ��� ���������������� � ���������� ������. 
 
+���������!  a , i  �  A  ��������� � ���� � ��� �� ����� �������, ��������
+	������ � ���, ��� ����������� �������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 ���� 6.2: ������� ����������
+			���� 6.3: �٨ ���� ������ ������
 
-	    ** �������� a , ����� �������� ����� ����� �������. **
 
-  1. ����������� ������ ����, � ����� ������ ������, ���������� ---> ,
-     ������ $ � ������� ������ (Normal mode).
+       ** �������� ���������  R  ��� ������ ����� ��� ������ �������. **
 
-  2. �������� a (� ������ ��������) ��� ���������� ������ ����� �������,
-     ������������ ��� ��������. (��������� A ��������� �������� � �����
-     ������.)
+  1. ����������� ������ ����, � ������ ������ ���������� --->, � � ������
+     ������� �����  xxx.
 
-���������: ��� ��������� �������� ������� i , ���������� �������, ������ ���
-	   �������, <ESC>, ������-������, �, �������, x , ������ ��� ����,
-	   ����� �������� ���� � ����� ������!
+  2. ������ �������  R  � ������� ����� ��������� ���� �� ������ ������ �����
+     ��������  xxx.
 
-  3. ������ ��������� ������ ������. �������� �����, ��� ���������� ��� �
-     �������� �� �� �����, ��� � ����� �������, �� ����������� �������, �
-     ������� ����� �������� �����.
+  3. ������� <ESC> ��� ������ �� ������ ������. �������� ��� ������� ������
+     �� ��� �������.
 
----> ��� ������� �������� ��� ����������������
----> ��� ������� �������� ��� ���������������� � ���������� ������ � �����
-     ������.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       ���� 6.3: ��� ���� ������ ������
+  4. ��������� ��� ���� ��� ������ ����������  xxx.
 
+---> ���������� 123 � xxx ��� xxx.
+---> ���������� 123 � 456 ��� 579.
 
-       ** �������� ��������� R ��� ������ �����, ��� ������ �������. **
+���������! ����� ������ ����� �� ����� �������, �� ������ �������� ������
+	������� ������������.
 
-  1. ����������� ������ ����, � ������, ���������� --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     ���� 6.4: ����������� � ������� ������
 
-  2. ����������� ������ � ������ ������� �����, ������������� ��
-     ���������������� � ��������� ������, ���������� ---> (����� '���������').
 
-  3. ������ �������� R � �������� ������� ������ � ������ ������, ������
-     ������ ������� ������ ���, ����� ��� ������ ����� �����������.
+	** ����������� �������  y  ��� ����������� �  p  ��� ������� **
 
----> ������ ������ ����� �������� � ���������, ��������� �������.
----> ������ ������ ����� �������� � ������, ��������� R � ������ ����� �����.
+  1. ����������� ������ ����, � ������ ������ ���������� --->, � ����� `�)'.
 
-  4. �������� ��������, ��� ��� ������� <ESC> ��� ����������, �����
-     �� ���������� ����� ����������.
+  2. ������������� � ����� ����������� ������ �����  v  � ����������� ������
+     ����� ������ `������'.
 
+  3. �������  y  ��� ����������� ������������� ������.
 
+  4. ����������� ������ � ����� ��������� ������ �����������  j$ .
 
+  5. �������  p  ��� ������� ������. ����� ������� `������' � ������� <ESC>. 
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			���� 6.4: ��������� ����������
+--->  �) ���� ������� ������.
+      �)
 
+���������! ����� �������� ������������  yw  (�������  y  � ����������  w ) ���
+	����������� ������ �����.
 
-** ��������� ��������� ���, ����� ������������ ������� ��� ������ ��� ������ **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 ���� 6.5: ��������� ����������
 
 
-  1. ������� ����� '������������', ������:
-     /������������
-     ��������� ����� ��������� ���, ������� ������� n
+   ** ��������� ��������� ��� ������������� �������� ��� ������ ��� ������ **
 
-  2. �������� �������� 'ic' (������������ �������), ������:
-     :set ic
+  1. ������� ����� `������������', ������:  /������������  <ENTER>.
+     ��������� ����� ��������� ���, ������� �������  n .
 
-  3. ������ ����� �������� ����� ����� '������������', �����: n
-     ��������� ����� ��������� ���, ������� ������� n
+  2. ���������� �������� `ic' (������������ �������), ������:  :set ic
 
-  4. �������� ��������� 'hlsearch' � 'incsearch':
-     :set hls is
+  3. ������ ����� ��������� ��� �������� ����� ����� `������������',
+     �������:  n
+     ��������, ��� ������ ��������� `������������' � `������������'.
 
-  5. ������ ����� ������� ������� ������ � ����������, ��� ���������:
-     /������������
+  4. ���������� ��������� `hlsearch' � `incsearch':  :set hls is
 
+  5. ������ ����� ������� ������� ������ � ����������, ��� ���������:
+			     /������������ <ENTER>
 
+  6. ��� ����������� ����� �������� ��� ������ ��������:  :set noic
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				������ ����� 6
+���������! ��� ���������� ��������� ���������� ��������:  :nohlsearch
 
+���������! ���� �� ������ ������������ ������� ������ ��� ������ ������,
+	�����������  \�  � ������� ������:  /������������\c  <ENTER>
 
-  1. ������� o ������� ������ ���� ������� � ���������� ������ � ��� � ������
-     �������.
-     ������� ��������� O ������� ������ ���� ������, � ������� ���������
-     ������.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 6
 
-  2. �������� a ��� ������� ������ ����� �������, �� ������� ��������� ������.
-     ������� ��������� A ������������� ���������� ��� ��� ���������� ������
-     � ����� ������.
 
-  3. ������� ��������� R ��������� ��� � ����� ������ �� ��� ���, ���� ��
-     ����� ������ ������� <ESC> ��� ����������.
+  1. �������  o  ��� �������� ������ ���� ������� � �������� � ����� �������.
+     �������  O  ��� �������� ������ ���� �������.
 
-  4. ������ ":set xxx" �� ������� �������� �������� "xxx"
+  2. �������  a  ��� ������� ������ ����� �������.
+     �������  A  ��� ������� ������ � ����� ������.
 
+  3. �������  e  �������� ������ � ����� �����.
 
+  4. �������  y  �������� �����,  p  -- ��������� ������������� �����.
 
+  5. ������� ���������  R  ��������� � ����� ������ �� ������� �������  <ESC> .
 
+  6. �������� `:set xxx' ��� ��������� ��������� `xxx', ��������� ���������:
 
+	`ic'	`ignorecase'	������������� �������� ��� ������
+	`is'	`incsearch'	����������� ��������� ���������� ��� ������
+	`hls'	`hlsearch'	��������� ���� ���������� ��� ������
 
+  7. �������� `no' ����� ���������� ��� ��� ����������:  :set noic
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		 ���� 7: ������� ��������� ���������� �������
+			  ���� 7.1: ���������� �������
+
 
-	       ** ����������� ���������� ���������� ������� **
+		** ����������� ���������� ���������� ������� **
 
   Vim �������� ������ ���������� ���������� ��������. ��� ������ ����������
-  ���� �� ���� ���������:
+  ���� �� ��� ���������:
 	- ������� ������� <HELP> (���� ������� ������� �� ����������)
 	- ������� ������� <F1> (���� ������� ������� �� ����������)
 	- ��������   :help <ENTER>
 
+  ���������� ����� � ���� ������� ��� ��������� ������������� � ��� ���
+  �������� �������.
+  �������  CTRL-W CTRL-W  ��� �������� �� ���� � ����.
   ��������   :q <ENTER>   ����� ������� ���� �������.
 
-  �� ������ ����� ������� ��� ������ ������� ��� �������, ������ �����
-  ��������������� �������� ������� ":help". ���������� ��������� (�� ��������
-  ������ <ENTER>):
+  �� ������ ����� ������� ��� ������ ������� ��� �������, ����� ���������������
+  �������� ������� `:help'. ���������� ��������� (�� �������� ������ <ENTER>):
+
+	:help w
+	:help c_CTRL-D
+	:help insert-index
+	:help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     ���� 7.2: �������� ���������� ��������
+
 
-  :help w
-  :help c_<T
-  :help insert-index
+			 ** ������� ����������� Vim **
 
+  Vim ����� ������� ������ ������������, ��� Vi, �� ����������� �� ��� ��
+  ��������� ���������. ��� ������������� ������� ������������ ��� �������
+  ������� ���� `vimrc'.
 
+  1. �������������� ����� ���� `vimrc'. ��� ������������ ������� ��
+     ������������ �������:
+	:e ~/.vimrc		��� Unix
+	:e $VIM/_vimrc		��� MS-Windows
 
+  2. ������ ���������� ������ ����� `vimrc':
+	:r $VIMRUNTIME/vimrc_example.vim
 
+  3. �������� ��������� ���� ����� ���� `vimrc':
+	:w
+
+  ������ ��� ��������� ������� Vim ����� �������� ��������� ����������. ���
+  ���������, �������������� ����, ����� ���� ��������� � ���� `vimrc'.
+  ��� ���������� ���������� ��������  :help vimrc-intro
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		     ���� 8: �������� ���������� �������
+			      ���� 7.3: ����������
 
-			** ������� ����������� Vim **
 
-  Vim ����� ������� ������ ������������, ��� Vi, ������ ������������ �� ���
-  ��������� �� ���������. ��� ����, ����� ������ ������������ �����
-  ����������� ��� ������� ������� ���� "vimrc".
+	 ** ��������� ������ ����� ��������� �����  CTRL-D  �  <TAB> **
 
-  1. �������������� ���� "vimrc", ��� ������������ ������� �� ������������
-     �������:
+  1. ��������������, ��� Vim �� � ������ �������������:  :set nocp
 
-       :edit ~/.vimrc			��� Unix
-       :edit $VIM/_vimrc		��� MS-Windows
+  2. ���������� ����� ����� ���� � ��������:  :!ls  ���  :!dir
 
-  2. ������ ���������� ������ ����� "vimrc":
+  3. �������� ������ �������:  :e
 
-       :read $VIMRUNTIME/vimrc_example.vim
+  4. �������  CTRL-D  � Vim ��������� ������ ������ ������������ �� `e'.
 
-  3. �������� ����:
+  5. �������  <TAB>  � Vim �������� �������� ������� �� `:edit'.
 
-       :write
+  6. ������ �������� ������ � ������ ������������� ����� �����:  :edit ���
 
-  ������ ��� ��������� ������� Vim ����� �������� ��������� ����������. ���
-  ���������, �������������� ����, ����� ���� ��������� � ���� "vimrc".
+  7. �������  <TAB>  � Vim �������� ��� �����, ���� ��� ����������.
+
+���������! ���������� �������� ��� ������ ������. ���������� ������  CTRL-D  �
+	<TAB>. ��� �������� ������� ��� �������  :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 ������ ����� 7
+
+
+  1. ��������  :help  ��� ������� <F1>, ��� <Help> ��� �������� ���� �������.
+
+  2. ��������  :help cmd  ��� ������ ������� �� �������.
+
+  3. �������  CTRL-W CTRL-W  ��� �������� � ������� ����.
+
+  4. ��������  :q  ��� �������� ���� ������� (���� ��� �������).
+
+  5. ��� �������� ����� �������� �������� ��������� �������� `vimrc'.
+
+  6. ��� ������  :  �������, ������� CTRL-D ��� ����������� ���������
+     ����������. ������� <TAB> ��� ������������� ����������.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  �� ���� ����������� ������� Vim. �� ��� ������������ ��� ����, ����� ����
-  ����� ������������� � ��������� Vim, ����������� ��� ����, ����� � ���������
-  ������������ ���. ������� ����� �� �������, ��������� Vim ����� ����� �����
-  ������. ���������� ������ ����������� ������������: ":help user-manual".
+
+  �� ���� ����������� ������� Vim. �� ��� ������������ ���� ����� �������������
+  � ��������� Vim, ����������� ��� ����, ����� � �������� ������������ ���.
+  ������� ���� �� �������, ��������� Vim ����� ����� ����� ������. ����������
+  ������ ����������� ������������: `:help user-manual'.
 
   ��� ����������� ������ ������������� �����:
-	Vim - Vi Improved - �����: Steve Oualline
-	��������: New Riders
-  ��� ����� ��������� ��������� Vim. �������� ������� ��������. ��������
-  ��������� �������� � �����������.
-  ��������� �� See http://iccf-holland.org/click5.html
+	Vim - Vi Improved, �����: Steve Oualline, ��������: New Riders
+
+  ��� ����� ��������� ��������� Vim. �������� ������� ��� ����� ��������.
+  �������� ��������� �������� � �����������.
+  ��. http://iccf-holland.org/click5.html
 
   ��������� ����� ����� ���������� �������� � ��������� ������ Vi, ��� Vim,
   ������ ����� �������������:
-	Learning the Vi Editor - �����: Linda Lamb
-	��������: O'Reilly & Associates Inc.
-  ��� ������� ����� ��� ����, ����� ������ ���, ��� ������ ����� ����������� �
-  Vi. ������ ������� ����� �������� ���������� � Vim.
+	Learning the Vi Editor, �����: Linda Lamb,
+				��������: O'Reilly & Associates Inc.
+
+  ��� ������� �����, ����� ������ ��, ��� ������ ����� ������� � Vi. ������
+  ������� ����� �������� ���������� � Vim.
 
-  ���� ������� ��� ������� Michael C. Pierce � Robert K. Ware, Colorado School
-  of Mines � �������������� ����, ������������ Charles Smith, Colorado State
+  ���� ������� ������� Michael C. Pierce � Robert K. Ware, Colorado School of
+  Mines � �������������� ����, ������� ��������� Charles Smith, Colorado State
   University. E-mail: bware@mines.colorado.edu.
 
-  ���������� ��� Vim Bram Moolenaar.
+  ���������� ��� Vim ������ ��������� (Bram Moolenaar).
+
+  �������:
+  	������ ������� <a_kissel@eudoramail.com>, 2002.
+	������ ����� <alyoshin.s@gmail.com>, 2014.
+
+  Translators:
+  	Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+  	Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
 
-  �������: ������ ������� <a_kissel@eudoramail.com>, 2002.
-  Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/runtime/tutor/tutor.ru.utf-8 b/runtime/tutor/tutor.ru.utf-8
index c12de27d80..69a237ea79 100644
--- a/runtime/tutor/tutor.ru.utf-8
+++ b/runtime/tutor/tutor.ru.utf-8
@@ -1,29 +1,32 @@
 ===============================================================================
-=    Д о б р о   п о ж а л о в а т ь   в   у ч е б н и к   VIM  -  Версия 1.5 =
+=   Д о б р о   п о ж а л о в а т ь   в   у ч е б н и к   VIM  --  версия 1.7 =
 ===============================================================================
-     Vim --- это очень мощный редактор, имеющий множество команд, слишком
-     много для того, чтобы их все можно было описать в таком учебнике, как
-     этот. Этот учебник призван объяснить достаточное число команд для того,
-     чтобы Вы могли с легкостью использовать Vim в качестве редактора общего
+
+     Vim -- это очень мощный редактор, имеющий множество команд, слишком много
+     для того, чтобы их все можно было описать в таком учебнике, как этот.
+     Этот учебник призван объяснить достаточное число команд для того, чтобы
+     вы могли с лёгкостью использовать Vim в качестве редактора общего
      назначения.
 
      Вам потребуется приблизительно 25-30 минут на освоение данного учебника в
-     зависимости от того, сколько времени Вы потратите на эксперименты.
+     зависимости от того, сколько времени вы потратите на эксперименты.
 
-     Команды в уроках будут модифицировать текст. Создайте копию этого файла,
-     чтобы попрактиковаться на ней (если Вы запустили "vimtutor", то это уже
-     копия).
+     Внимание! Командами в уроках вы будете изменять этот текст. Создайте
+     копию этого файла, чтобы попрактиковаться на ней (если вы запустили
+     "vimtutor", то это уже копия).
 
      Важно помнить, что этот учебник предназначен для обучения в процессе
-     использования. Это означает, что Вы должны запускать команды для того,
-     чтобы как следует их изучить. Если Вы просто прочитаете текст, то
-     забудете команды!
+     использования. Это означает, что вы должны запускать команды для того,
+     чтобы как следует их изучить. Если вы просто прочитаете этот текст, то
+     не запомните команды!
 
-     Теперь убедитесь в том, что клавиша CapsLock не включена и нажмите
-     клавишу   j   несколько раз, так, чтобы Урок 1.1 полностью поместился на
+     Теперь убедитесь в том, что клавиша CapsLock не включена, и нажмите
+     клавишу  j  несколько раз, так, чтобы Урок 1.1 полностью поместился на
      экране.
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			Урок 1.1:  ПЕРЕМЕЩЕНИЕ КУРСОРА
+			 Урок 1.1:  ПЕРЕМЕЩЕНИЕ КУРСОРА
+
 
 ** Для перемещения курсора нажмите клавиши h,j,k,l так, как показано ниже. **
 	     ^
@@ -33,802 +36,972 @@
 	     v
   1. Подвигайте курсор по экрану, пока не почувствуете себя уверенно.
 
-  2. Надавите клавишу `вниз' (j) пока она не начнет повторяться.
----> Теперь Вы знаете, как перейти к следующему уроку.
+  2. Надавите клавишу `вниз' (j) пока она не начнёт повторяться.
+     Теперь вы знаете, как перейти к следующему уроку.
 
   3. Используя клавишу `вниз' перейдите к Уроку 1.2.
 
-Замечание: Если вы пока не уверены в том, что набираете, нажмите <ESC> для
-	   перехода в обычный режим (Normal mode). После этого перенаберите
-	   требуемую команду.
+Замечание! Если вы пока не уверены в том, что набираете, нажмите <ESC> для
+	перехода в обычный режим (Normal mode). После этого перенаберите
+	требуемую команду.
+
+Замечание! Обычные клавиши управления курсором (стрелки) также должны
+	работать. Однако, клавиши hjkl позволят вам перемещаться
+	значительно быстрее, как только вы научитесь ими пользоваться.
 
-Замечание: Обычные клавиши управления курсором (стрелки) также должны
-	   работать. Однако, клавиши hjkl позволят Вам перемещаться
-	   значительно быстрее, как только Вы научитесь ими пользоваться.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  Урок 1.2: ЗАПУСК И ЗАВЕРШЕНИЕ РАБОТЫ С VIM
+		      Урок 1.2: ЗАВЕРШЕНИЕ РАБОТЫ С VIM
+
 
-!! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
+  !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
 			       урок целиком !!
 
-  1. Нажмите клавишу <ESC> (для того, чтобы удостовериться, что Вы в обычном
+  1. Нажмите клавишу <ESC> (для того, чтобы удостовериться, что вы в обычном
      режиме (Normal mode)).
 
   2. Наберите:			:q! <ENTER>.
+     (Это означает, что вы должны набрать три символа :q! и нажать клавишу
+     ввод.) Это позволит вам выйти из редактора БЕЗ СОХРАНЕНИЯ любых сделанных
+     изменений.
 
----> Это позволит Вам выйти из редактора БЕЗ СОХРАНЕНИЯ любых сделанных
-     изменений. Если Вы хотите сохранить изменения и выйти:
-				:wq  <ENTER>
+  3. Когда вы увидите приглашение командной оболочки, наберите команду,
+     которая привела вас в этот учебник. Это может быть:
+				vimtutor <ENTER>
 
-  3. Когда Вы увидите приглашение командной оболочки, наберите команду,
-     которая привела Вас в этот учебник. Это может быть
-				vimtutor ru <ENTER>
-     Обычно можно использовать:	vim tutor.ru <ENTER>
+  4. Если вы уверены в том, что запомнили эти шаги, выполните шаги от 1 до 3
+     чтобы выйти снова запустить редактор.
 
----> 'vim' позволяет запустить редактор vim, 'tutor.ru' --- это файл, который
-     Вы будете редактировать.
+Замечание!  :q! <ENTER>  отбрасывает любые сделанные вами изменения. Через
+	несколько уроков вы узнаете как сохранять изменения в файл.
+
+  5. Переместите курсор вниз к Уроку 1.3.
 
-  4. Если Вы уверены в том, что запомнили эти шаги, выполните шаги от 1 до 3
-     чтобы выйти снова запустить редактор. Затем переместите курсор вниз к
-     Уроку 1.3.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  Урок 1.3: РЕДАКТИРОВАНИЕ ТЕКСТА - УДАЛЕНИЕ
+		  Урок 1.3: РЕДАКТИРОВАНИЕ ТЕКСТА -- УДАЛЕНИЕ
 
 
-** Находясь в обычном режиме нажмите x, чтобы удалить символ под курсором. **
+** Находясь в обычном режиме нажмите  x  для удаления символа под курсором. **
 
-  1. Переместите курсор к строке внизу, помеченной --->.
+  1. Переместите курсор к строке ниже, помеченной --->.
 
   2. Для исправления ошибок, переместите курсор, пока он не окажется над
      удаляемым символом.
 
-  3. Нажмите клавишу x для удаления требуемого символа.
+  3. Нажмите клавишу  x  для удаления требуемого символа.
 
-  4. Повторите шаги 2--4 пока строка не будет исправлена.
+  4. Повторите шаги со 2 по 4 пока строка не будет исправлена.
 
 ---> От тттопота копытт пппыль ппо ппполю леттитт.
 
-  5. Теперь, когда строка откорректирована, переходите к уроку 1.4.
-
-ЗАМЕЧАНИЕ: В ходе освоения этого учебника не пытайтесь запоминать, учите
-	   в процессе использования.
+  5. Теперь, когда строка откорректирована, переходите к Уроку 1.4.
 
+Замечание! В ходе освоения этого учебника не пытайтесь запоминать, учите
+	в процессе использования.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  Урок 1.4: РЕДАКТИРОВАНИЕ ТЕКСТА - ВСТАВКА
+		   Урок 1.4: РЕДАКТИРОВАНИЕ ТЕКСТА -- ВСТАВКА
 
 
- ** Находясь в обычном режиме (Normal mode), нажмите i для вставки текста. **
+       ** Находясь в обычном режиме, нажмите  i  для вставки текста. **
 
-  1. Переместите курсор к первой строке внизу, помеченной --->.
+  1. Переместите курсор к первой строке ниже, помеченной --->.
 
   2. Для того, чтобы сделать первую строку идентичной второй, поместите
      курсор на символ ПЕРЕД которым следует вставить текст.
 
-  3. Нажмите i и наберите требуемые добавления.
+  3. Нажмите  i  и наберите требуемые добавления.
 
   4. После исправления всех ошибок нажмите <ESC> для возврата в обычный режим.
-     Повторите шаги 2--4, пока фраза не будет исправлена полностью.
+     Повторите шаги со 2 по 4, пока фраза не будет исправлена полностью.
 
----> Часть текста в строке беследно .
+---> Часть текста в строке бесследно .
 ---> Часть текста в этой строке бесследно пропала.
 
-  5. Когда освоите вставку текста, переходите дальше к Резюме.
+  5. Когда освоите вставку текста, переходите к Уроку 1.5.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		 Урок 1.5: РЕДАКТИРОВАНИЕ ТЕКСТА -- ДОБАВЛЕНИЕ
 
 
+     ** Находясь в обычном режиме, нажмите  A  для добавления текста. **
+
+  1. Переместите курсор к первой строке ниже, помеченной --->.
+     Не имеет значения на каком символе расположен курсор на этой строке.
+
+  2. Нажмите  A  и наберите требуемые добавления.
+
+  3. После добавления требуемого текста нажмите <ESC> для возврата в обычный
+     режим.
+
+  4. Переместите курсор на следующую строку, помеченную ---> и повторите шаги
+     со 2 по 4 для исправления этой строки.
+
+---> Часть текста в этой строке бессле
+     Часть текста в этой строке бесследно пропала.
+---> Здесь также не достаёт час
+     Здесь также не достаёт части текста.
+
+  5. Когда освоите добавление текста, переходите к Уроку 1.6.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 1
+			 Урок 1.6: РЕДАКТИРОВАНИЕ ФАЙЛА
+
+
+	** Используйте  :wq  для сохранения файла и выхода из Vim. **
+
+  !! ВНИМАНИЕ! Прежде, чем выполнять любой из описанных ниже шагов, прочтите
+			       урок целиком !!
+
+  1. Выйдите из Vim, как вы это узнали в Уроке 1.2:  :q!
+     Или, если у вас есть доступ к другому терминалу, можете сделать следующее
+     в нём.
+
+  2. По приглашению командной оболочки введите следующую команду:
+			      vim tutor <ENTER>
+     `vim' -- команда для запуска редактора Vim, а `tutor' -- имя файла для
+     редактирования. Используете имя файла, который можно изменять.
+
+  3. Вставляйте и удаляйте текст, как вы научились в предыдущих уроках.
+
+  4. Сохраните файл с изменениями и выйдите из Vim выполнив:  :wq <ENTER>
+
+  5. Если вы вышли из vimtutor на шаге 1, перезапустите vimtutor и переходите
+     к следующему Резюме.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 РЕЗЮМЕ УРОКА 1
+
 
   1. Курсор перемещается либо клавишами со стрелками, либо клавишами hjkl.
-	 h (влево)	j (вниз)       k (вверх)	    l (вправо)
+	h (влево)	j (вниз)	k (вверх)	l (вправо)
 
-  2. Для запуска Vim (из приглашения % командной оболочки) наберите:
-     vim ИМЯ_ФАЙЛА <ENTER>
+  2. Для запуска Vim (из приглашения командной оболочки) наберите:
+			    vim ИМЯ_ФАЙЛА <ENTER>
 
   3. Для завершения работы с Vim наберите:
-     <ESC>   :q!	 <ENTER>  чтобы отказаться от сохранения изменений.
+	<ESC>   :q!   <ENTER>  чтобы отказаться от сохранения изменений.
      Или наберите:
-     <ESC>   :wq	 <ENTER>  чтобы сохранить изменения.
+	<ESC>   :wq   <ENTER>  чтобы сохранить изменения.
 
-  4. Для удаления символа под курсором в обычном режиме, наберите: x
+  4. Для удаления символа под курсором в обычном режиме, нажмите:  x
 
   5. Чтобы вставить текст перед курсором в обычном режиме, наберите:
-	 i     вводите текст	<ESC>
+	 i   вводите вставляемый текст   <ESC>
+     Чтобы добавить текст после курсора:
+	 a   вводите добавляемый текст   <ESC>
 
-ЗАМЕЧАНИЕ: Нажатие <ESC> переместит Вас в обычный режим (Normal mode) либо
-	   прервет нежелательную и частично завершенную команду.
+Замечание! Нажатие <ESC> переместит вас в обычный режим (Normal mode) либо
+	прервёт нежелательную и частично завершённую команду.
 
-Теперь переходим к Уроку 2.
+Теперь переходите к Уроку 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  Урок 2.1: КОМАНДЫ УДАЛЕНИЯ
+			   Урок 2.1: КОМАНДЫ УДАЛЕНИЯ
 
 
-	** Наберите dw для удаления участка текста до конца слова. **
+       ** Наберите  dw  для удаления участка текста до конца слова. **
 
   1. Нажмите <ESC>, чтобы перейти в обычный режим.
 
-  2. Переместите курсор вниз, к строке, помеченной --->.
+  2. Переместите курсор вниз, к строке помеченной --->.
 
   3. Переместите курсор в начало слова, которое следует удалить.
 
-  4. Наберите  dw , чтобы удалить это слово.
+  4. Наберите  dw  для удаления этого слова.
 
-ЗАМЕЧАНИЕ: Во время набора буквы dw появятся в последней строке экрана. Если
-	   Вы что-то наберете неправильно, нажмите <ESC> и начните сначала.
+Замечание! Во время набора буквы dw появятся справа в самой нижней строке
+	экрана. Если вы что-то наберёте неправильно, нажмите <ESC> и начните
+	сначала.
 
 ---> Несколько слов рафинад в этом предложении автокран излишни.
 
   5. Повторите шаги 3 и 4, пока не исправите все ошибки и переходите к
      Уроку 2.2.
 
-
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  Урок 2.2: ДОПОЛНИТЕЛЬНЫЕ КОМАНДЫ УДАЛЕНИЯ
+		   Урок 2.2: ДОПОЛНИТЕЛЬНЫЕ КОМАНДЫ УДАЛЕНИЯ
 
 
-	    ** Наберите d$ для удаления текста до конца строки. **
+	   ** Наберите  d$  для удаления текста до конца строки. **
 
   1. Нажмите <ESC>, чтобы перейти в обычный режим.
 
-  2. Переместите курсор вниз, к строке, помеченной --->.
+  2. Переместите курсор вниз, к строке помеченной --->.
 
-  3. Переместите курсор к концу правильной строки (ПОСЛЕ первой . ).
+  3. Переместите курсор к концу правильной строки (ПОСЛЕ первой точки).
 
-  4. Чтобы удалить остаток строки, наберите  d$ .
+  4. Наберите  d$  для удаления остатка строки.
 
 ---> Кто-то набрал окончание этой строки дважды. окончание этой строки дважды.
 
 
-  5.Чтобы лучше разобраться в этом, переходите к Уроку 2.3.
-
-
-
-
+  5. Чтобы лучше разобраться в том, как это происходит, переходите к Уроку 2.3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 Урок 2.3: КОМАНДЫ И ОБЪЕКТЫ
+			  Урок 2.3: КОМАНДЫ И ОБЪЕКТЫ
+
 
+  Многие команды, изменяющие текст, состоят из оператора и объекта. Формат
+  команды удаления с оператором  d  следующий:
 
-  Формат команды `удаление' d таков:
+  	d   объект
 
-	 [число]   d	объект	    ИЛИ	     d	 [число]   объект
   Здесь:
-    число  - сколько раз исполнить команду (необязательно, по умолчанию=1).
-    d      - команда удаления.
-    объект - с чем команда должна быть выполнена (перечислено ниже).
+    d      - оператор удаления.
+    объект - над чем должна быть выполнена команда (перечислено ниже).
 
   Краткий список объектов:
-    w - от курсора до конца слова, включая завершающий пробел.
-    e - от курсора до конца слова, НЕ включая завершающий пробел.
+    w - от курсора до конца слова, включая последующий пробел.
+    e - от курсора до конца слова, НЕ включая последующий пробел.
     $ - от курсора до конца строки.
     ^ - от курсора до начала строки.
 
-ЗАМЕЧАНИЕ: Простое нажатие на символ объекта в обычном режиме (Normal mode)
-	   без дополнительных команд передвинет курсор так, как указано в
-	   списке объектов.
+Замечание! Простое нажатие на символ объекта в обычном режиме (Normal mode)
+	без предварительного оператора переместит курсор так, как указано
+	в списке объектов.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		Урок 2.4: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ ПЕРЕМЕЩЕНИЯ
+
+
+      ** Ввод числа перед оператором перемещения приведёт к его повторению
+			  заданное количество раз. **
+
+  1. Переместите курсор к началу строки отмеченной ---> ниже.
+
+  2. Наберите  2w  для перемещения курсора вперёд к началу второго слова.
+
+  3. Наберите  3e  для перемещения курсора вперёд к концу третьего слова.
+
+  4. Наберите  0  (нуль) для перемещения к началу строки.
+
+  5. Повторите шаги 2 и 3 с различными числами.
+
+---> Обычная строка из слов для вашего перемещения по ней.
 
+  6. Переходите к Уроку 2.5.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	       Урок 2.4: ИСКЛЮЧЕНИЕ ИЗ ПРАВИЛА `КОМАНДА-ОБЪЕКТ'
+		 Урок 2.5: ИСПОЛЬЗОВАНИЕ СЧЁТЧИКА ДЛЯ УДАЛЕНИЯ
 
 
-		 ** Наберите dd для удаления всей строки. **
+	    ** Ввод числа перед оператором приведёт к его повторению
+			  заданное количество раз. **
+
+  Добавьте число перед перед объектом в комбинацию оператора удаления и
+  перемещения указанную выше для удаления указанного количества объектов:
+	 d   число   объект
+
+  1. Переместите курсор к первому слову из прописных букв в отмеченной --->
+     строке ниже.
+
+  2. Наберите  d2w  для удаления двух слов из прописных букв.
+
+  3. Повторите шаги 1 и 2 с другими числами для удаления последовательных слов
+     из прописных букв одной командой.
+
+---> эта АБВ ГД строка ЕЖЗИ КЛ МНО из слов П РС ТУФ очищена.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 Урок 2.6: ОПЕРАЦИИ СО СТРОКАМИ
+
 
-  Вследствие частого применения операции удаления всей строки, разработчики
-  Vim решили, что для этого проще всего просто набрать d дважды.
+		** Наберите   dd   для удаления целой строки. **
+
+  В связи с частой необходимостью удаления целой строки, создатели Vi решили
+  для упрощения сделать возможным удаление строки набором двух d.
 
   1. Переместите курсор вниз, ко второй строке фразы.
+
   2. Наберите dd для удаления строки.
-  3. Теперь переместитесь к четвертой строке.
-  4. Наберите 2dd (вспомните правило `число-команда-объект'), чтобы удалить
-     две строки.
 
-      1)  Летом я хожу на стадион,
-      2)  О, как внезапно кончился диван!
-      3)  Я болею за ``Зенит'', ``Зенит'' --- чемпион!
-      4)  Печально я гляжу на наше поколение!
-      5)  Его грядущее иль пусто иль темно...
-      6)  Я сижу на скамейке в ложе `Б'
-      7)  И играю на большой жестяной трубе.
+  3. Теперь переместитесь к четвёртой строке.
+
+  4. Наберите 2dd для удаления двух строк.
+
+--->  1)  Летом я хожу на стадион,
+--->  2)  О, как внезапно кончился диван!
+--->  3)  Я болею за ``Зенит'', ``Зенит'' --- чемпион!
+--->  4)  Печально я гляжу на наше поколение!
+--->  5)  Его грядущее иль пусто иль темно...
+--->  6)  Я сижу на скамейке в ложе `Б'
+--->  7)  И играю на большой жестяной трубе.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  Урок 2.5: КОМАНДА `ОТКАТ'
+			   Урок 2.7: КОМАНДА `ОТМЕНА'
 
 
-  ** Нажмите u	для отмены результата работы предыдущей команды, U для отмены
-			исправлений во всей строке. **
+  ** Нажмите  u  для отмены результата работы предыдущей команды, U для отмены
+			 исправлений во всей строке. **
 
-  1. Переместите курсор вниз, к строке, помеченной ---> и установите его на
+  1. Переместите курсор вниз, к строке помеченной --->, и установите его на
      первую ошибку.
-  2. Нажмите x для удаления первого неправильного символа.
-  3. Теперь нажмите u для отмены (отката) последней выполненной команды.
-  4. Исправьте все ошибки в строке, используя команду x .
-  5. Теперь нажмите заглавную U для того, чтобы вернуть всю строку в исходное
-     состояние.
-  6. Нажмите u несколько раз для отмены команды U и предыдущих команд.
-  7. Нажмите теперь CTRL-R (удерживайте клавишу CTRL нажатой в момент нажатия
-  R)     несколько раз для возврата команд (откат отката).
 
----> Испрравьте оошибки в этойй строке и вернитте их сс помощьью `отката'.
+  2. Нажмите  x  для удаления первого неправильного символа.
 
-  8. Это были очень полезные команды. Далее переходите к Резюме Урока 2.
+  3. Теперь нажмите  u  для отмены (отката) последней выполненной команды.
+
+  4. Исправьте все ошибки в строке, используя команду  x .
+
+  5. Теперь нажмите заглавную  U  для того, чтобы вернуть всю строку
+     в исходное состояние.
+
+  6. Нажмите  u  несколько раз для отмены команды  U  и предыдущих команд.
 
+  7. Нажмите теперь CTRL-R (т.е. удерживайте клавишу CTRL нажатой в момент
+     нажатия клавиши R) несколько раз для возврата команд (откат отката).
+
+---> Испрравьте оошибки в этойй строке и вернитте их сс помощьью `отмены'.
+
+  8. Это были очень полезные команды. Далее переходите к Резюме Урока 2.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 2
+				 РЕЗЮМЕ УРОКА 2
+
 
+  1. Для удаления текста от курсора до конца слова наберите:	dw
 
-  1. Для удаления текста от курсора до конца слова наберите:    dw
+  2. Для удаления текста от курсора до конца строки наберите:	d$
 
-  2. Для удаления текста от курсора до конца строки наберите:    d$
+  3. Для удаления всей строки наберите:		dd
 
-  3. Для удаления всей строки наберите:    dd
+  4. Для повтора перемещения введите количество перед командой:	2w 
 
-  4. Формат команды в обычном режиме имеет вид:
+  5. Формат команды в обычном режиме имеет вид:
 
        [число]   команда   объект     ИЛИ     команда	[число]   объект
      где:
-       число   - сколько раз повторить выполнение команды
+       [число] - сколько раз повторить выполнение команды, опционально
        команда - что выполнить, например d для удаления
        объект  - на что должна воздействовать команда, например w (слово),
 		$ (до конца строки), и т.д.
 
-  5. Для отмены (отката) предшествующих действий наберите:  u (строчная u)
-     Для отмены (отката) всех изменений в строке наберите:  U (прописная U)
+  6. Для перехода к началу строки используйте нуль:  0
+
+  7. Для отмены (отката) предшествующих действий наберите:  u  (строчная u)
+     Для отмены (отката) всех изменений в строке наберите:  U  (прописная U)
      Для отмены отката наберите:  CTRL-R
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  Урок 3.1: КОМАНДА ВСТАВКИ
+			   Урок 3.1: КОМАНДА ВСТАВКИ
 
 
-   ** Наберите p для вставки последнего удаленного текста после курсора. **
+   ** Наберите  p  для вставки последнего удалённого текста после курсора. **
 
-  1. Переместите курсор вниз к последней строке из набора.
+  1. Переместите курсор вниз, к строке помеченной --->.
 
-  2. Наберите dd для удаления строки и ее сохранения в буфере Vim'а.
+  2. Наберите  dd  для удаления строки и её сохранения в буфере Vim'а.
 
   3. Переместите курсор к строке НАД тем местом, куда следует вставить
-     удаленную строку.
-
-  4. Находясь в обычном режиме наберите p для замены строки.
+     удалённую строку.
 
-  5. Повторите шаги 2--4, пока не расставите все строки в нужном порядке.
+  4. Находясь в обычном режиме наберите  p  для вставки строки ниже курсора.
 
-     г) И лучше выдумать не мог.
-     б) Когда не в шутку занемог,
-     в) Он уважать себя заставил
-     а) Мой дядя самых честных правил
+  5. Повторите шаги со 2 по 4, пока не расставите все строки в нужном порядке.
 
+---> г) И лучше выдумать не мог.
+---> б) Когда не в шутку занемог,
+---> в) Он уважать себя заставил
+---> а) Мой дядя самых честных правил
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       Урок 3.2: КОМАНДА ЗАМЕНЫ
+			    Урок 3.2: КОМАНДА ЗАМЕНЫ
 
 
-	  ** Наберите r и символ, заменяющий символ под курсором. **
+	  ** Наберите  r  и символ, заменяющий символ под курсором. **
 
-  1. Переместите курсор вниз, к строке, помеченной --->.
+  1. Переместите курсор вниз, к строке помеченной --->.
 
   2. Установите курсор так, чтобы он находился над первой ошибкой.
 
-  3. Наберите r	и затем символ, исправляющий ошибку.
+  3. Наберите  r  и затем символ, исправляющий ошибку.
 
-  4. Повторите шаги 2 и 3, пока первая строка не будет исправлена.
+  4. Повторите шаги 2 и 3, пока первая строка не будет исправлена как вторая.
 
 --->  В момегт набтра этой чтроки кое0кто с трудом попвдал по клваишам!
 --->  В момент набора этой строки кое-кто с трудом попадал по клавишам!
 
-  5. Теперь переходите к Уроку 3.2.
-
-ЗАМЕЧАНИЕ: Помните, что вы должны учиться в процессе работы, а не просто
-	   запоминая.
+  5. Теперь переходите к Уроку 3.3.
 
+Замечание! Помните, что вы должны учиться в процессе работы, а не просто
+	запоминая.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 Урок 3.3: КОМАНДА ИЗМЕНЕНИЯ
+			  Урок 3.3: КОМАНДА ИЗМЕНЕНИЯ
 
 
-		** Для изменения части слова наберите cw . **
+	    ** Для изменения конечной части слова наберите  ce . **
 
-  1. Переместите курсор вниз, к строке, помеченной --->.
+  1. Переместите курсор вниз, к строке помеченной --->.
 
   2. Расположите курсор над буквой `o' в слове `сола'.
 
-  3. Наберите cw и исправьте слово (в данном случае, наберите `лов'.)
+  3. Наберите  ce  и исправьте слово (в данном случае, наберите `лов').
 
   4. Нажмите <ESC> и переходите к следующей ошибке (к первому символу, который
-     надо изменить.)
+     надо изменить).
 
-  5. Повторите шаги 3--4 пока первое предложение не станет идентичным второму.
+  5. Повторите шаги 3 и 4 пока первое предложение не станет идентичным второму.
 
 ---> Несколько сола в эьгц строке тпгшцбь редалзкуюиесвх.
 ---> Несколько слов в этой строке требуют редактирования.
 
-Обратите внимание, что cw не только заменяет слово, но и переводит вас в режим
-вставки.
-
+   Обратите внимание, что  ce  не только удаляет слово, но и переводит вас в
+   режим вставки.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		  Урок 3.4: ПРОДОЛЖАЕМ ИЗМЕНЯТЬ С КОМАНДОЙ c
+		  Урок 3.4: ПРОДОЛЖАЕМ ИЗМЕНЯТЬ С КОМАНДОЙ  c
 
 
-** Команда замены используется с теми же объектами, что и команда удаления. **
+ ** Команда замены используется с теми же объектами, что и команда удаления. **
 
   1. Команда изменения применяется таким же образом, как и команда удаления.
-     Ее формат таков:
+     Её формат таков:
 
-       [число]   c   объект	   ИЛИ	    c	[число]   объект
+       [число]   c   объект           ИЛИ           c   [число]   объект
 
   2. Объекты также совпадают: w (слово), $ (конец строки) и т.п.
 
-  3. Переместите курсор вниз, к строке, помеченной --->.
+  3. Переместите курсор вниз, к строке помеченной --->.
 
   4. Перейдите к первой ошибке.
 
-  5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со
+  5. Наберите  c$  и отредактируйте первую строку так, чтобы она совпадала со
      второй, после чего нажмите <ESC>.
 
 ---> Конец этой строки нуждается в помощи, чтобы стать похожим на второй.
----> Конец этой строки нуждается в помощи команды c$ .
+---> Конец этой строки нуждается в помощи команды  c$ .
 
+Замечание! Клавиша Backspace может использоваться для исправления при наборе.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 3
+				 РЕЗЮМЕ УРОКА 3
 
 
-  1. Для вставки текста, который только что был удален, наберите p . Эта
-     команда вставит удаленный текст ПОСЛЕ курсора (если была удалена строка,
+  1. Для вставки текста, который только что был удалён, наберите  p . Эта
+     команда вставит удалённый текст ПОСЛЕ курсора (если была удалена строка,
      то она будет помещена в строке под курсором).
 
-  2. Для замены символа под курсором наберите r и затем заменяющий символ.
+  2. Для замены символа под курсором наберите  r  и затем заменяющий символ.
 
-  3. Команда изменения позволяет Вам изменить указанный объект от курсора до
-     конца этого объекта. Например, наберите cw для замены от курсора до
-     конца слова, c$ для изменения до конца строки.
+  3. Команда изменения позволяет вам изменить указанный объект от курсора до
+     окончания перемещения. Например, наберите  ce  для замены от курсора до
+     конца слова,  c$  для изменения до конца строки.
 
   4. Формат команды изменения таков:
 
-	 [число]   c	объект	      ИЛИ	c   [число]   объект
-
-Теперь отправляйтесь к следующему уроку.
-
-
-
+	 [число]   c   объект         ИЛИ         c   [число]   объект
 
+Теперь переходите к следующему уроку.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-	      Урок 4.1: ИНФОРМАЦИЯ О ФАЙЛЕ И РАСПОЛОЖЕНИЕ В НЕМ
+	       Урок 4.1: ИНФОРМАЦИЯ О ФАЙЛЕ И РАСПОЛОЖЕНИИ В НЕМ
 
 
- ** Наберите CTRL-g чтобы увидеть Ваше месторасположение в файле и информацию
-				    о нем.
-	Наберите SHIFT-G для перемещения к заданной строке в файле. **
+       ** Наберите CTRL-g чтобы увидеть ваше месторасположение в файле и
+     информацию о файле. Наберите  G  (SHIFT-G) для перемещения к заданной
+			       строке в файле. **
 
-  Замечание: Прочитайте весь урок прежде чем выполнять любые команды!!
+Замечание! Прочитайте весь урок прежде чем выполнять любые команды!
 
-  1. Удерживая клавишу Ctrl нажмите g . Внизу экрана появится строка статуса с
-     именем файла и номером строки, в которой Вы находитесь. Запомните номер
+  1. Удерживая клавишу Ctrl нажмите  g . Внизу экрана появится строка статуса
+     с именем файла и номером строки, в которой вы находитесь. Запомните номер
      строки, он потребуется на Шаге 3.
 
-  2. Нажмите shift-G для перемещения к концу файла.
-
-  3. Наберите номер строки, в которой вы находились и затем shift-G. Это
-     вернет Вас к строке, в которой Вы были, когда в первый раз нажали Ctrl-g.
-     (Когда Вы будете набирать цифры, они НЕ отобразятся на экране.)
+  2. Удерживая клавишу Shift нажмите  g  для перемещения к концу файла.
 
-  4. Если Вы запомнили все вышесказанное, выполните шаги 1--3.
+  3. Наберите номер строки, в которой вы находились и затем Shift-G. Это
+     вернёт вас к строке, в которой вы были, когда в первый раз нажали Ctrl-g.
 
+  4. Если вы запомнили все вышесказанное, выполните шаги с 1 по 3.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			   Урок 4.2: КОМАНДА ПОИСКА
+			    Урок 4.2: КОМАНДА ПОИСКА
 
-	      ** Наберите  /  и затем введите искомую фразу. **
+
+	       ** Наберите  /  и затем введите искомую фразу. **
 
   1. В обычном режиме (Normal mode) наберите символ  / . Обратите внимание,
      что он вместе с курсором появится внизу экрана, как это происходит с
-     командой :	.
+     командой  : .
 
-  2. Теперь наберите 'ошшшибка' <ENTER>. Это то слово, которое Вы будете
+  2. Теперь наберите 'ошшшибка' <ENTER>. Это то слово, которое вы будете
      искать.
 
-  3. Для того, чтобы повторить поиск, просто нажмите n .
-     Для поиска этой фразы в обратном направлении, нажмите Shift-N .
+  3. Для того, чтобы повторить поиск, просто нажмите  n .
+     Для поиска этой же фразы в обратном направлении, нажмите  Shift-N .
+
+  4. Если вы желаете сразу искать в обратном направлении, используйте
+     команду  ?  вместо  / .
 
-  4. Если Вы желаете сразу искать в обратном направлении, используйте
-     команду ? вместо / .
+  5. Для того, чтобы вернуться туда, откуда вы начали поиск нажмите  Ctrl-O.
+     (Удерживая нажатой клавишу Ctrl нажмите  o ). Повторите несколько раз
+     для дальнейшего перехода. Для перехода вперёд используйте  Ctrl-I .
 
----> Когда Вы при поиске достигнете конца файла, поиск будет продолжен с
-     начала.
+---> "ошшшибка" это не способ написания слова `ошибка';  ошшшибка это ошибка.
 
-  "ошшшибка" это не способ произнесения слова `ошибка';  ошшшибка это ошибка.
+Замечание! Если при поиске будет достигнут конц файла, то поиск будет продолжен
+	с начала.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			Урок 4.3: ПОИСК ПАРНЫХ СКОБОК
 
 
-		** Наберите % для поиска парных ),] или } . **
+		 ** Наберите  %  для поиска парных ), ] или } . **
 
-  1. Поместите курсор над любой из (, [ или { в строке внизу, помеченной --->.
+  1. Поместите курсор над любой из (, [ или { в строке ниже, помеченной --->.
 
-  2. Теперь наберите символ % .
+  2. Теперь наберите символ  % .
 
   3. Курсор должен перескочить на парную скобку.
 
-  4. Наберите % для возврата курсора назад к первой скобке.
+  4. Наберите  %  для возврата курсора назад к первой скобке.
 
 ---> Это ( строка, содержащая такие (, такие [ ] и такие { } скобки. ))
 
-Замечание: Это очень удобно при отладке программ с пропущенными скобками!
-
-
-
-
-
+Замечание! Это очень удобно при отладке программ с пропущенными скобками!
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		      Урок 4.4: СПОСОБ ИСПРАВЛЕНИЯ ОШИБОК
 
 
-	 ** Наберите :s/было/стало/g для замены 'было' на 'стало'. **
+	 ** Наберите  :s/было/стало/g  для замены 'было' на 'стало'. **
 
-  1. Переместите курсор вниз, к строке, помеченной --->.
+  1. Переместите курсор вниз, к строке помеченной --->.
 
-  2. Наберите :s/уводю/увожу <ENTER> . Обратите внимание на то, что эта команда
-     заменит только первое найденное вхождение в строке.
+  2. Наберите  :s/уводю/увожу <ENTER> . Обратите внимание на то, что эта
+     команда заменит только первое найденное вхождение в строке.
 
-  3. Теперь наберите :s/уводю/увожу/g , означающее подстановку глобально во
-     всей строке. Это заменит все найденные в строке вхождения.
+  3. Теперь наберите  :s/уводю/увожу/g , добавленная в конце g означает
+     подстановку глобально во всей строке. Это заменит все найденные в строке
+     вхождения.
 
 ---> Я уводю к отверженным селеньям, я уводю сквозь вековечный стон, я уводю к
      забытым поколеньям.
 
   4. Для замены всех вхождений последовательности символов между двумя
      строками,
-     наберите :#,#s/было/стало/g  где #,# --- номера этих строк.
-     Наберите :%s/было/стало/g    для замены всех вхождений во всем файле.
-
+     наберите  :#,#s/было/стало/g  где #,# -- номера этих строк.
+     Наберите  :%s/было/стало/g    для замены всех вхождений во всем файле.
+     Наберите  :%s/было/стало/gc   для поиска всех вхождений во всем файле и
+                                   запроса подтверждения замены.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 4
-  1. Ctrl-g показывает ваше положение в файле и информацию о нем.
-     Shift-G перемещает Вас в конец файла. Номер, за которым следует Shift-G
+				 РЕЗЮМЕ УРОКА 4
+
+
+  1. Ctrl-g  показывает ваше положение в файле и информацию о нем.
+     Shift-G  перемещает вас в конец файла. Номер, за которым следует Shift-G
      позволяет перейти к строке с этим номером.
+     gg  перемещает вас к первой строке файла.
 
-  2. Нажатие / и затем ввод строки позволяет произвести поиск этой строки
-     ВПЕРЕД по тексту.
-     Нажатие ? и затем ввод строки позволяет произвести поиск этой строки
+  2. Нажатие  /  и затем ввод строки позволяет произвести поиск этой строки
+     ВПЕРЁД по тексту.
+     Нажатие  ?  и затем ввод строки позволяет произвести поиск этой строки
      НАЗАД по тексту.
-     После поиска наберите n для перехода к следующему вхождению искомой
+     После поиска наберите  n  для перехода к следующему вхождению искомой
      строки в том же направлении или Shift-N для перехода в противоположном
      направлении.
 
-  3. Нажатие % , когда курсор находится на (,),[,],{, или } позволяет найти
+  3. Нажатие  % , когда курсор находится на (,),[,],{, или } позволяет найти
      парную скобку.
 
   4. Для подстановки `стало' вместо первого `было' в строке, наберите
-     :s/old/new
+	:s/old/new
      Для подстановки `стало' вместо всех `было' в строке, наберите
-     :s/old/new/g
+	:s/old/new/g
      Для замены в интервале между двумя строками, наберите
-     :#,#s/old/new/g
+	:#,#s/old/new/g
      Для замены всех вхождений `было' на `стало' в файле, наберите
-     :%s/old/new/g
+	:%s/old/new/g
      Чтобы редактор каждый раз запрашивал подтверждение, добавьте 'c'
-     :%s/old/new/gc
+	:%s/old/new/gc
+
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		   Урок 5.1: КАК ВЫПОЛНИТЬ ВНЕШНЮЮ КОМАНДУ
+		    Урок 5.1: КАК ВЫПОЛНИТЬ ВНЕШНЮЮ КОМАНДУ
 
 
-    ** Наберите :! и затем внешнюю команду, которую следует выполнить. **
+    ** Наберите  :!  и затем внешнюю команду, которую следует выполнить. **
 
-  1. Наберите уже знакомую Вам команду : для установки курсора в командную
-     строку редактора. Это позволит Вам ввести команду.
+  1. Наберите уже знакомую вам команду  :  для установки курсора в командную
+     строку редактора. Это позволит вам ввести команду.
 
-  2. Теперь наберите символ ! (восклицательный знак). Теперь можно исполнить
+  2. Теперь наберите символ  !  (восклицательный знак). Это позволит выполнить
      внешнюю команду, используя командную оболочку.
 
-  3. Для примера наберите ls после ! и нажмите <ENTER>. Эта команда выведет
-     список файлов в текущем каталоге, точно также, как если бы Вы ввели эту
-     команду в приглашении оболочки. Или попробуйте :!dir , если предыдущая
-     команда не сработала.
-
----> Замечание: Таким способом можно выполнить любую внешнюю команду.
+  3. Для примера наберите  ls  после  !  и нажмите <ENTER>. Команда выведет
+     список файлов в текущем каталоге, точно также, как если бы вы ввели эту
+     команду в приглашении оболочки. Или попробуйте  :!dir , если команда ls
+     не сработала.
 
----> Замечание: Все команды, начинающиеся с : , должны завершаться нажатием
-     <ENTER>.
+Замечание! Таким способом можно выполнить любую внешнюю команду с указанием
+	аргументов.
 
+Замечание! Все команды, начинающиеся с  : , должны завершаться нажатием
+	<ENTER>. Далее на это не всегда будет обращаться особое внимание.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 			 Урок 5.2: КАК ЗАПИСАТЬ ФАЙЛ
 
 
-** Для сохранения изменений, произведенных в файле, наберите :w ИМЯ_ФАЙЛА. **
+	      ** Для сохранения изменений, произведённых в файле,
+			   наберите  :w ИМЯ_ФАЙЛА. **
 
-  1. Наберите :!dir или :!ls для получения списка файлов в текущем каталоге.
-     Как Вам уже известно, Вы должны нажать <ENTER> после ввода этих команд.
+  1. Наберите  :!dir  или  :!ls  для получения списка файлов в текущем
+     каталоге.  Как вам уже известно, после ввода команды надо нажать <ENTER>.
 
-  2. Придумайте название для файла, которое еще не существует, например TEST.
+  2. Придумайте название для файла, которое ещё не существует, например TEST.
 
-  3. Теперь наберите :w TEST (где TEST --- это имя файла, придуманное Вами.)
+  3. Теперь наберите  :w TEST  (где TEST -- это имя файла, придуманное вами.)
 
-  4. Эта команда сохранит весь файл (Учебник по Vim) под именем TEST. Чтобы
-     удостовериться в этом, снова наберите :!dir и просмотрите каталог.
+  4. Команда сохранит весь этот файл (Учебник по Vim) под именем TEST. Чтобы
+     удостовериться в этом, снова наберите  :!dir  или :!ls  и просмотрите
+     каталог.
 
----> Заметьте, что если Вы выйдете из Vim и затем запустите его снова с
-     файлом TEST, этот файл будет точной копией учебника в тот момент, когда
-     Вы его сохранили.
-
-  5. Теперь удалите этот файл, набрав :!del TEST
+Замечание! Если вы выйдете из Vim и затем запустите его снова с файлом TEST
+	(т.е. выполните  vim TEST ), этот файл будет точной копией учебника
+	в тот момент, когда вы его сохранили.
 
+  5. Теперь удалите этот файл, набрав для MS-DOS    :!del TEST
+                                      для Unix      :!rm TEST
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 		       Урок 5.3: ВЫБОРОЧНОЕ СОХРАНЕНИЕ
 
 
-	 ** Для сохранения части файла, наберите :#,# w ИМЯ_ФАЙЛА **
-
-  1. Еще раз наберите :!dir или :!ls для получения списка файлов в текущем
-     каталоге и выберите подходящее имя, например TEST.
+	   ** Для сохранения части файла, наберите  v  выберите часть
+			  и сохраните её  :w ИМЯ_ФАЙЛА **
 
-  2. Переместите курсор к началу этой страницы и нажмите Ctrl-g для нахождения
-     номера строкиto. ЗАПОМНИТЕ ЭТОТ НОМЕР!
+  1. Переместите курсор к этой строке.
 
-  3. Теперь переместитесь в конец страницы и вновь наберите Ctrl-g. ЗАПОМНИТЕ
-     И ЭТОТ НОМЕР ТОЖЕ!
+  2. Нажмите  v  и переместите курсор ниже к пятому шагу. Обратите внимание,
+     что текст подсвечен.
 
-  4. Для сохранения ТОЛЬКО ЧАСТИ файла наберите :#,# w TEST , где #,# --- это
-     номера, которые Вы запомнили (начало, конец), а TEST --- имя вашего файла.
+  3. Нажмите  :  и внизу экрана появится  :'<,'> .
 
-  5. Как и прежде, убедитесь в наличии этого файла командой :!dir , но НЕ
-     УДАЛЯЙТЕ его.
+  4. Введите  w TEST  (где TEST -- имя файла, который ещё не существует).
+     До нажатия <ENTER>, проверьте что внизу экрана написано  :'<,'>w TEST.
 
+  5. Vim запишет выбранные строки в файл TEST. Как и прежде, убедитесь в
+     наличии этого файла командой  :!dir  или  :!ls . НЕ УДАЛЯЙТЕ этот файл, он
+     потребуется в следующем уроке.
 
+Замечание! Нажатие  v  начинает визуальный выбор. Вы можете перемещать курсор
+	для изменения выбора. Затем для выбранного фрагмента можно выполнить
+	какой-то оператор, например, удалить нажатием  d.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		    Урок 5.4: ЧТЕНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ
+		     Урок 5.4: ЧТЕНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ
 
-	  ** Для вставки содержимого файла, наберите  :r FILENAME **
 
-  1. Наберите :!dir для того, чтобы убедиться в том, что файл TEST все еще
-     существует.
+	** Для вставки содержимого из файла, наберите  :r ИМЯ_ФАЙЛА  **
 
-  2. Установите курсор в верхней части этой страницы.
+  1. Установите курсор над этой строкой.
 
-Замечание: После выполнения шага 3 Вы увидите Урок 5.3.	После этого
-	   перемещайтесь ВНИЗ, снова к этому уроку.
+Замечание! После выполнения Шага 2 вы увидите текст из Урока 5.3. Переместитесь
+	ВНИЗ по тексту до этого урока.
 
-  3. Теперь прочитайте Ваш файл TEST, используя команду :r TEST , где
-     TEST --- это имя файла.
+  2. Теперь прочитайте ваш файл TEST, используя команду  :r TEST , где TEST --
+     это имя файла.
 
-Замечание: Прочитанный Вами файл будет вставлен в том месте, где находится
-	   курсор.
+  3. Для проверки что содержимое файла было вставлено, переместитесь по тексту
+     и удостоверьтесь, что теперь в нём две копии Урока 5.3: исходная и из
+     файла TEST.
 
-  4. Чтобы убедиться в том, что файл прочитан, переместитесь немного назад по
-     тексту и заметьте, что теперь существуют две копии Урока 5.3, исходная
-     и полученная из файла.
+Замечание! Вставить можно и вывод внешней команды. Например,  :r !ls  прочитает
+	вывод команды ls и вставит его ниже курсора.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 5
+				 РЕЗЮМЕ УРОКА 5
 
 
   1.  :!команда  исполняет внешнюю команду.
 
       Некоторые полезные примеры:
-	  :!dir --- выводит список файлов в каталоге.
-	  :!del FILENAME --- удаляет файл FILENAME.
+      	(MS-DOS)	(Unix)
+	 :!dir		 :!ls		-- вывести список файлов в каталоге.
+	 :!del ИМЯ	 :!rm ИМЯ	-- удалить файл по имени.
 
-  2.  :w FILENAME записывает текущий редактируемый файл на диск
-      под именем FILENAME.
+  2.  :w ИМЯ_ФАЙЛА  записывает текущий редактируемый в Vim файл на диск под
+      указанным именем.
 
-  3.  :#,#w FILENAME сохраняет строки от # до # в файл FILENAME.
+  3.  v  перемещение  :w ИМЯ_ФАЙЛА  сохраняет визуально выбранные строки в файл
+      с указанным именем.
 
-  4.  :r FILENAME считывает с диска файл FILENAME и помещает его в текущий
-      файл следом за позицией курсора.
+  4.  :r ИМЯ_ФАЙЛА  считывает с диска файл с указанным именем и помещает его
+      ниже курсора.
 
+  5.  :r !dir  читает вывод команды dir и помещает его ниже курсора.
 
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			   Урок 6.1: КОМАНДА СОЗДАНИЯ
 
 
+   ** Наберите  o  чтобы создать пустую строку под курсором и перейти в режим
+			    вставки (Insert mode) **
 
+  1. Переместите курсор вниз, к строке помеченной --->.
 
+  2. Наберите  o  (в нижнем регистре) для того, чтобы создать пустую строку
+     НИЖЕ курсора и перейти в режим вставки (Insert mode).
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			  Урок 6.1: КОМАНДА СОЗДАНИЯ
+  3. Теперь наберите какой-нибудь текст и нажмите <ESC> для выхода из режима
+     вставки.
 
+---> После нажатия  o  курсор перейдёт на новую пустую строку в режиме вставки.
 
- ** Наберите o чтобы создать пустую строку под курсором и перейти в режим
-			   вставки (Insert mode) **
+  4. Для создания строки ВЫШЕ курсора, просто наберите заглавную  O , вместо
+     строчной  o . Попробуйте проделать это с нижеследующей строкой.
 
-  1. Переместите курсор вниз, к строке, помеченной --->.
+---> Создайте новую строку над этой, поместив на неё курсор и нажав Shift-O.
 
-  2. Наберите o (в нижнем регистре) для того, чтобы создать пустую строку
-     НИЖЕ курсора и перейти в режим вставки (Insert mode).
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 Урок 6.2: КОМАНДА ДОБАВЛЕНИЯ
+
+
+	    ** Наберите  a , чтобы вставить текст ПОСЛЕ курсора. **
+
+  1. Переместите курсор вниз, в начало первой строки помеченной --->.
 
-  3. Теперь скопируйте помеченную ---> строку и нажмите <ESC> для выхода из
-     режима вставки.
+  2. Набирайте  e  пока курсор не переместиться на конец  cтро .
 
----> После нажатия o курсор перейдет на новую пустую строку в режиме вставки.
+  3. Наберите  a  (в нижнем регистре) для добавления текста ПОСЛЕ символа,
+     находящегося под курсором. (Заглавная A позволяет добавить в конец
+     строки.)
 
-  4. Для создания строки ВЫШЕ курсора, просто наберите заглавную O, вместо
-     строчной o. Попробуйте проделать это с нижеследующей строкой.
-Создайте новую строку над этой, нажав Shift-O, поместив курсор на эту строку.
+  4. Допишите слово так, как показано в строке ниже. Нажмите <ESC> для выхода
+     из режима вставки (Insert mode).
 
+  5. Используйте  e  для перехода к концу следующего незавершённого слова и
+     повторите шаги 3 и 4.
 
+---> Эта стро позволит вам попрактиков в добавле текста.
+---> Эта строчка позволит вам попрактиковаться в добавлении текста. 
 
+Замечание!  a , i  и  A  переводят в один и тот же режим вставки, различие
+	только в том, где вставляются символы.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			 Урок 6.2: КОМАНДА ДОБАВЛЕНИЯ
+			Урок 6.3: ЕЩЁ ОДИН СПОСОБ ЗАМЕНЫ
 
-	    ** Наберите a , чтобы вставить текст ПОСЛЕ курсора. **
 
-  1. Переместите курсор вниз, в конец первой строки, помеченной ---> ,
-     набрав $ в обычном режиме (Normal mode).
+       ** Наберите заглавную  R  для замены более чем одного символа. **
 
-  2. Наберите a (в нижнем регистре) для добавления текста ПОСЛЕ символа,
-     находящегося под курсором. (Заглавная A позволяет добавить в конец
-     строки.)
+  1. Переместите курсор вниз, к первой строке помеченной --->, и в начало
+     первого слова  xxx.
 
-Замечание: Это позволяет избежать нажатия i , последнего символа, текста для
-	   вставки, <ESC>, курсор-вправо, и, наконец, x , просто для того,
-	   чтобы добавить тест в конец строки!
+  2. Теперь нажмите  R  и введите число указанный ниже во второй строке чтобы
+     заменить  xxx.
 
-  3. Теперь завершите первую строку. Заметьте также, что добавление это в
-     точности то же самое, что и режим вставки, за исключением позиции, в
-     которую будет вставлен текст.
+  3. Нажмите <ESC> для выхода из режима замены. Заметьте что остаток строки
+     не был изменён.
 
----> Эта строчка позволит Вам попрактиковаться
----> Эта строчка позволит Вам попрактиковаться в добавлении текста в конец
-     строки.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		       Урок 6.3: ЕЩЕ ОДИН СПОСОБ ЗАМЕНЫ
+  4. Повторите эти шаги для замены оставшихся  xxx.
 
+---> Добавление 123 к xxx даёт xxx.
+---> Добавление 123 к 456 даёт 579.
 
-       ** Наберите заглавную R для замены более, чем одного символа. **
+Замечание! Режим замены похож на режим вставки, но каждый введённый символ
+	удаляет существующий.
 
-  1. Переместите курсор вниз, к строке, помеченной --->.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     Урок 6.4: КОПИРОВАНИЕ И ВСТАВКА ТЕКСТА
 
-  2. Расположите курсор в начале первого слова, отличающегося от
-     соответствующего в следующей строке, помеченной ---> (слово 'последней').
 
-  3. Теперь наберите R и замените остаток текста в первой строке, набрав
-     поверх старого текста так, чтобы обе строки стали одинаковыми.
+	** Используйте команду  y  для копирования и  p  для вставки **
 
----> Первую строку можно сравнять с последней, используя клавиши.
----> Первую строку можно сравнять с второй, используя R и набрав новый текст.
+  1. Переместите курсор вниз, к первой строке помеченной --->, и после `а)'.
 
-  4. Обратите внимание, что при нажатии <ESC> для завершения, любой
-     не измененный текст сохранится.
+  2. Переключитесь в режим визуального выбора нажав  v  и переместите курсор
+     перед словом `первый'.
 
+  3. Введите  y  для копирования подсвеченного текста.
 
+  4. Переместите курсор в конец следующей строки комбинацией  j$ .
 
+  5. Нажмите  p  для вставки текста. Затем введите `второй' и нажмите <ESC>. 
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-			Урок 6.4: УСТАНОВКА ПАРАМЕТРОВ
+--->  а) Этот элемент первый.
+      б)
 
+Замечание! Также возможно использовать  yw  (команду  y  с оператором  w ) для
+	копирования одного слова.
 
-** Установим параметры так, чтобы игнорировать регистр при поиске или замене **
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+			 Урок 6.5: УСТАНОВКА ПАРАМЕТРОВ
 
 
-  1. Поищите слово 'игнорировать', набрав:
-     /игнорировать
-     Повторите поиск несколько раз, нажимая клавишу n
+   ** Установка параметра для игнорирования регистра при поиске или замене **
 
-  2. Включите параметр 'ic' (Игнорировать регистр), набрав:
-     :set ic
+  1. Найдите слово `игнорировать', набрав:  /игнорировать  <ENTER>.
+     Повторите поиск несколько раз, нажимая клавишу  n .
 
-  3. Теперь снова сделайте поиск слова 'игнорировать', нажав: n
-     Повторите поиск несколько раз, нажимая клавишу n
+  2. Установите параметр `ic' (игнорировать регистр), набрав:  :set ic
 
-  4. Включите параметры 'hlsearch' и 'incsearch':
-     :set hls is
+  3. Теперь снова несколько раз сделайте поиск слова `игнорировать',
+     нажимая:  n
+     Заметьте, что теперь находятся `Игнорировать' и `ИГНОРИРОВАТЬ'.
 
-  5. Теперь опять введите команду поиска и посмотрите, что получится:
-     /игнорировать
+  4. Установите параметры `hlsearch' и `incsearch':  :set hls is
 
+  5. Теперь опять введите команду поиска и посмотрите, что получится:
+			     /игнорировать <ENTER>
 
+  6. Для возвращения учёта регистра при поиске наберите:  :set noic
 
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-				РЕЗЮМЕ УРОКА 6
+Замечание! Для отключения подсветки совпадений наберите:  :nohlsearch
 
+Замечание! Если вы хотите игнорировать регистр только для одного поиска,
+	используйте  \с  в команде поиска:  /игнорировать\c  <ENTER>
 
-  1. Нажатие o создает строку НИЖЕ курсора и перемещает курсор в нее в режиме
-     вставки.
-     Нажатие заглавной O создает строку ВЫШЕ строки, в которой находится
-     курсор.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 РЕЗЮМЕ УРОКА 6
 
-  2. Наберите a для вставки текста ПОСЛЕ символа, на котором находится курсор.
-     Нажатие заглавной A автоматически перемещает Вас для добавления текста
-     в конец строки.
 
-  3. Нажатие заглавной R переводит Вас в режим замены до тех пор, пока не
-     будет нажата клавиша <ESC> для завершения.
+  1. Нажмите  o  для создания строки НИЖЕ курсора и перехода в режим вставки.
+     Нажмите  O  для создания строки ВЫШЕ курсора.
 
-  4. Набрав ":set xxx" вы сможете включить параметр "xxx"
+  2. Нажмите  a  для вставки текста ПОСЛЕ курсора.
+     Нажмите  A  для вставки текста в конец строки.
 
+  3. Команда  e  подводит курсор к концу слова.
 
+  4. Команда  y  копирует текст,  p  -- вставляет скопированный текст.
 
+  5. Нажатие заглавной  R  переводит в режим замены до нажатия клавиши  <ESC> .
 
+  6. Наберите `:set xxx' для включения параметра `xxx', некоторые параметры:
 
+	`ic'	`ignorecase'	игнорирование регистра при поиске
+	`is'	`incsearch'	отображение частичных совпадений при поиске
+	`hls'	`hlsearch'	подсветка всех совпадений при поиске
 
+  7. Добавьте `no' перед параметром для его отключения:  :set noic
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		 Урок 7: КОМАНДЫ ПОЛУЧЕНИЯ ВСТРОЕННОЙ СПРАВКИ
+			  Урок 7.1: ВСТРОЕННАЯ СПРАВКА
+
 
-	       ** Используйте встроенную справочную систему **
+		** Используйте встроенную справочную систему **
 
   Vim обладает мощной встроенной справочной системой. Для начала попробуйте
-  один из трех вариантов:
+  один из трёх вариантов:
 	- нажмите клавишу <HELP> (если таковая имеется на клавиатуре)
 	- нажмите клавишу <F1> (если таковая имеется на клавиатуре)
 	- наберите   :help <ENTER>
 
+  Прочитайте текст в окне справки для получения представления о том как
+  работает справка.
+  Нажмите  CTRL-W CTRL-W  для перехода от окна к окну.
   Наберите   :q <ENTER>   чтобы закрыть окно справки.
 
-  Вы можете найти справку для любого понятия или команды, просто задав
-  соответствующий аргумент команде ":help". Попробуйте следующее (не забудьте
-  нажать <ENTER>):
+  Вы можете найти справку для любого понятия или команды, задав соответствующий
+  аргумент команде `:help'. Попробуйте следующее (не забудьте нажать <ENTER>):
+
+	:help w
+	:help c_CTRL-D
+	:help insert-index
+	:help user-manual
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+		     Урок 7.2: СОЗДАНИЕ СТАРТОВОГО СЦЕНАРИЯ
+
 
-  :help w
-  :help c_<T
-  :help insert-index
+			 ** Включим возможности Vim **
 
+  Vim имеет намного больше возможностей, чем Vi, но большинство из них по
+  умолчанию выключены. Для использования больших возможностей вам следует
+  создать файл `vimrc'.
 
+  1. Отредактируйте новый файл `vimrc'. Его расположение зависит от
+     используемой системы:
+	:e ~/.vimrc		для Unix
+	:e $VIM/_vimrc		для MS-Windows
 
+  2. Теперь прочитайте пример файла `vimrc':
+	:r $VIMRUNTIME/vimrc_example.vim
 
+  3. Запишите созданный вами новый файл `vimrc':
+	:w
+
+  Теперь при следующем запуске Vim будет включена подсветка синтаксиса. Все
+  настройки, предпочитаемые вами, могут быть добавлены в файл `vimrc'.
+  Для дальнейшей информации наберите  :help vimrc-intro
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-		     Урок 8: СОЗДАНИЕ СТАРТОВОГО СКРИПТА
+			      Урок 7.3: ДОПОЛНЕНИЕ
 
-			** Включим возможности Vim **
 
-  Vim имеет намного больше возможностей, чем Vi, однако большинствао из них
-  выключены по умолчанию. Для того, чтобы начать использовать новые
-  возможности Вам следует создать файл "vimrc".
+	 ** Командную строку можно дополнить нажав  CTRL-D  и  <TAB> **
 
-  1. Отредактируйте файл "vimrc", его расположение зависит от используемой
-     системы:
+  1. Удостоверьтесь, что Vim не в режиме совместимости:  :set nocp
 
-       :edit ~/.vimrc			для Unix
-       :edit $VIM/_vimrc		для MS-Windows
+  2. Посмотрите какие файлы есть в каталоге:  :!ls  или  :!dir
 
-  2. Теперь прочитайте пример файла "vimrc":
+  3. Наберите начало команды:  :e
 
-       :read $VIMRUNTIME/vimrc_example.vim
+  4. Нажмите  CTRL-D  и Vim отобразит список команд начинающихся на `e'.
 
-  3. Запишите файл:
+  5. Нажмите  <TAB>  и Vim дополнит название команды до `:edit'.
 
-       :write
+  6. Теперь добавьте пробел и начало существующего имени файла:  :edit ФАЙ
 
-  Теперь при следующем запуске Vim будет включена подсветка синтаксиса. Все
-  настройки, предпочитаемые Вами, могут быть добавлены в файл "vimrc".
+  7. Нажмите  <TAB>  и Vim дополнит имя файла, если оно уникальное.
+
+Замечание! Дополнение работает для многих команд. Попробуйте нажать  CTRL-D  и
+	<TAB>. Это особенно полезно для команды  :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+				 РЕЗЮМЕ УРОКА 7
+
+
+  1. Наберите  :help  или нажмите <F1>, или <Help> для открытия окна справки.
+
+  2. Наберите  :help cmd  для поиска справки по команде.
+
+  3. Нажмите  CTRL-W CTRL-W  для перехода к другому окну.
+
+  4. Наберите  :q  для закрытия окна справки (если оно активно).
+
+  5. Для хранения ваших настроек создайте стартовый сценарий `vimrc'.
+
+  6. При наборе  :  команды, нажмите CTRL-D для отображения возможных
+     дополнений. Нажмите <TAB> для использования дополнения.
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  На этом завершается Учебник Vim. Он был предназначен для того, чтобы дать
-  общее представление о редакторе Vim, достаточное для того, чтобы с легкостью
-  использовать его. Учебник далек от полноты, поскольку Vim имеет очень много
-  команд. Прочитайте теперь руководство пользователя: ":help user-manual".
+
+  На этом завершается Учебник Vim. Он был предназначен дать общее представление
+  о редакторе Vim, достаточное для того, чтобы с лёгкостью использовать его.
+  Учебник далёк от полноты, поскольку Vim имеет очень много команд. Прочитайте
+  теперь руководство пользователя: `:help user-manual'.
 
   Для дальнейшего чтения рекомендуется книга:
-	Vim - Vi Improved - Автор: Steve Oualline
-	Издатель: New Riders
-  Эта книга полностью посвящена Vim. Особенно полезна новичкам. Содержит
-  множество примеров и иллюстраций.
-  Взгляните на See http://iccf-holland.org/click5.html
+	Vim - Vi Improved, автор: Steve Oualline, издатель: New Riders
+
+  Эта книга полностью посвящена Vim. Особенно полезна она будет новичкам.
+  Содержит множество примеров и иллюстраций.
+  См. http://iccf-holland.org/click5.html
 
   Следующая книга более почтенного возраста и посвящена больше Vi, чем Vim,
   однако также рекомендуется:
-	Learning the Vi Editor - Автор: Linda Lamb
-	Издатель: O'Reilly & Associates Inc.
-  Это хорошая книга для того, чтобы узнать все, что только можно проделывать с
-  Vi. Шестое издание также включает информацию о Vim.
+	Learning the Vi Editor, автор: Linda Lamb,
+				издатель: O'Reilly & Associates Inc.
+
+  Это хорошая книга, чтобы узнать всё, что только можно сделать в Vi. Шестое
+  издание также включает информацию о Vim.
 
-  Этот учебник был написан Michael C. Pierce и Robert K. Ware, Colorado School
-  of Mines с использованием идей, предложенных Charles Smith, Colorado State
+  Этот учебник написал Michael C. Pierce и Robert K. Ware, Colorado School of
+  Mines с использованием идей, которые предложил Charles Smith, Colorado State
   University. E-mail: bware@mines.colorado.edu.
 
-  Доработано для Vim Bram Moolenaar.
+  Доработано для Vim Брамом Моленаром (Bram Moolenaar).
+
+  Перевод:
+  	Андрей Киселев <a_kissel@eudoramail.com>, 2002.
+	Сергей Алёшин <alyoshin.s@gmail.com>, 2014.
+
+  Translators:
+  	Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
+  	Sergey Alyoshin <alyoshin.s@gmail.com>, 2014.
 
-  Перевод: Андрей Киселев <a_kissel@eudoramail.com>, 2002.
-  Translator: Andrey Kiselev <a_kissel@eudoramail.com>, 2002.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/src/po/ru.cp1251.po b/src/po/ru.cp1251.po
index 8205c813db..6582507ebd 100644
--- a/src/po/ru.cp1251.po
+++ b/src/po/ru.cp1251.po
@@ -7,10 +7,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: vim_7.4_ru\n"
+"Project-Id-Version: vim_ru\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-24 12:18+0400\n"
-"PO-Revision-Date: 2014-03-24 12:18 +0400\n"
+"POT-Creation-Date: 2014-10-10 11:52+0400\n"
+"PO-Revision-Date: 2014-10-10 12:00+0400\n"
 "Last-Translator: Sergey Alyoshin <alyoshin.s@gmail.com>\n"
 "Language-Team: \n"
 "Language: Russian\n"
@@ -203,6 +203,21 @@ msgstr "
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    ������=%ld  id=%d  ���=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: ���� ���������� ����������� �������"
+
+msgid "Enter encryption key: "
+msgstr "������� ������ ��� ����������: "
+
+msgid "Enter same key again: "
+msgstr "��������� ���� ������: "
+
+msgid "Keys don't match!"
+msgstr "�������� ������ �� ���������!"
+
+msgid "[crypted]"
+msgstr "[�����������]"
+
 #, c-format
 msgid "E96: Can not diff more than %ld buffers"
 msgstr "E96: ������� �� ��������� ����� �� ����� ��� � %ld �������"
@@ -659,9 +674,16 @@ msgstr "E258: 
 msgid "sort() argument"
 msgstr "��������� sort()"
 
+msgid "uniq() argument"
+msgstr "��������� uniq()"
+
 msgid "E702: Sort compare function failed"
 msgstr "E702: ��������� ���������� ������� ��������� ��� ����������"
 
+msgid "E882: Uniq compare function failed"
+msgstr ""
+"E882: ��������� ���������� ������� ��������� ��� �������� ��������������"
+
 msgid "(Invalid)"
 msgstr "(�����������)"
 
@@ -759,10 +781,12 @@ msgid "E129: Function name required"
 msgstr "E129: ��������� ��� �������"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr ""
-"E128: ��� ������� ������ ���������� � ��������� ����� ��� ��������� "
-"���������: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: ��� ������� ������ ���������� � ��������� ����� ��� \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: ��� ������� �� ����� ��������� ���������: %s"
 
 #, c-format
 msgid "E131: Cannot delete function %s: It is in use"
@@ -880,6 +904,10 @@ msgstr "E138: 
 msgid "Writing viminfo file \"%s\""
 msgstr "������ ����� viminfo \"%s\""
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: ���������� ������������� ���� viminfo � %s!"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1080,6 +1108,10 @@ msgstr "E158: 
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: ������������ ID ������: %ld"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: ���������� �������� ������ %s"
+
 msgid " (NOT FOUND)"
 msgstr " (�� �������)"
 
@@ -1663,12 +1695,6 @@ msgstr "[
 msgid "[converted]"
 msgstr "[��������������]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[�����������]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[������ �������������� � ������ %ld]"
@@ -1689,9 +1715,6 @@ msgstr "
 msgid "can't read output of 'charconvert'"
 msgstr "���������� ��������� ����� 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: ���� ���������� ����������� �������"
-
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: ��� ���������� ���������� ��� ������ acwrite"
 
@@ -2654,6 +2677,13 @@ msgstr ""
 "E263: � ��������� ��� ������� �� ��������, ��������� �� ��������� ���������� "
 "Python"
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: � ��������� ��� ������� �� ��������, ��������� �� �������� ������ "
+"Python site."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: ���������� ��������� ����������� ����� Python"
 
@@ -4068,15 +4098,6 @@ msgstr "E548: 
 msgid "E549: Illegal percentage"
 msgstr "E549: ������������ �������� ���������"
 
-msgid "Enter encryption key: "
-msgstr "������� ������ ��� ����������: "
-
-msgid "Enter same key again: "
-msgstr "��������� ���� ������: "
-
-msgid "Keys don't match!"
-msgstr "�������� ������ �� ���������!"
-
 msgid "E854: path too long for completion"
 msgstr "E854: ������� ������� ���� ��� ��������������"
 
@@ -4248,6 +4269,13 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: ����������� ��� �������� %d"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: ������ ������ � ������� ��������� �� ����� ��������� ���� ��� ����� "
+"�����"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "�������: %ld; "
@@ -4565,6 +4593,19 @@ msgstr ""
 "\n"
 "���������� ���������� �������� ������������ ��� "
 
+msgid "Could not set security context "
+msgstr "���������� ���������� �������� ������������ "
+
+msgid " for "
+msgstr " ��� "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "���������� �������� �������� ������������ "
+
+msgid ". Removing it!\n"
+msgstr ". ����� �����!\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -4834,6 +4875,10 @@ msgstr "E554: 
 msgid "External submatches:\n"
 msgstr "������� ���������������:\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (���. ��������� ���) ���������� ��������� %s"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
@@ -6232,6 +6277,9 @@ msgstr "E446: 
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: ���� \"%s\" �� ������ �� ��������� �����"
 
+msgid "List or number required"
+msgstr "��������� ������ ��� �����"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: ���������� ��������� ���������� %s"
@@ -6888,3 +6936,4 @@ msgid ""
 msgstr ""
 "������ ��� ��������� ����: sys.path �� �������� �������\n"
 "������� �������� vim.VIM_SPECIAL_PATH � sys.path"
+
diff --git a/src/po/ru.po b/src/po/ru.po
index 1d7f16deb0..2c15b757b7 100644
--- a/src/po/ru.po
+++ b/src/po/ru.po
@@ -7,10 +7,10 @@
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: vim_7.4_ru\n"
+"Project-Id-Version: vim_ru\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-24 12:18+0400\n"
-"PO-Revision-Date: 2014-03-24 12:18 +0400\n"
+"POT-Creation-Date: 2014-10-10 11:52+0400\n"
+"PO-Revision-Date: 2014-10-10 12:00+0400\n"
 "Last-Translator: Sergey Alyoshin <alyoshin.s@gmail.com>\n"
 "Language-Team: \n"
 "Language: Russian\n"
@@ -203,6 +203,21 @@ msgstr "Значки для %s:"
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    строка=%ld  id=%d  имя=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Файл зашифрован неизвестным методом"
+
+msgid "Enter encryption key: "
+msgstr "Введите пароль для шифрования: "
+
+msgid "Enter same key again: "
+msgstr "Повторите ввод пароля: "
+
+msgid "Keys don't match!"
+msgstr "Введённые пароли не совпадают!"
+
+msgid "[crypted]"
+msgstr "[зашифровано]"
+
 #, c-format
 msgid "E96: Can not diff more than %ld buffers"
 msgstr "E96: Следить за отличиями можно не более чем в %ld буферах"
@@ -659,9 +674,16 @@ msgstr "E258: Не могу ответить клиенту"
 msgid "sort() argument"
 msgstr "параметра sort()"
 
+msgid "uniq() argument"
+msgstr "параметра uniq()"
+
 msgid "E702: Sort compare function failed"
 msgstr "E702: Неудачное завершение функции сравнения при сортировке"
 
+msgid "E882: Uniq compare function failed"
+msgstr ""
+"E882: Неудачное завершение функции сравнения при проверке единственности"
+
 msgid "(Invalid)"
 msgstr "(Неправильно)"
 
@@ -759,10 +781,12 @@ msgid "E129: Function name required"
 msgstr "E129: Требуется имя функции"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr ""
-"E128: Имя функции должно начинаться с заглавной буквы или содержать "
-"двоеточие: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: Имя функции должно начинаться с заглавной буквы или \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Имя функции не может содержать двоеточие: %s"
 
 #, c-format
 msgid "E131: Cannot delete function %s: It is in use"
@@ -880,6 +904,10 @@ msgstr "E138: Невозможно записать файл viminfo %s!"
 msgid "Writing viminfo file \"%s\""
 msgstr "Запись файла viminfo \"%s\""
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Невозможно переименовать файл viminfo в %s!"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1080,6 +1108,10 @@ msgstr "E158: Неправильное имя буфера: %s"
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: Неправильный ID значка: %ld"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Невозможно изменить значок %s"
+
 msgid " (NOT FOUND)"
 msgstr " (НЕ НАЙДЕНО)"
 
@@ -1663,12 +1695,6 @@ msgstr "[БЕЗ преобразований]"
 msgid "[converted]"
 msgstr "[перекодировано]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[зашифровано]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[ОШИБКА ПРЕОБРАЗОВАНИЯ в строке %ld]"
@@ -1689,9 +1715,6 @@ msgstr "Преобразование с помощью 'charconvert' не вып
 msgid "can't read output of 'charconvert'"
 msgstr "невозможно прочитать вывод 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Файл зашифрован неизвестным методом"
-
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: Нет подходящих автокоманд для буфера acwrite"
 
@@ -2654,6 +2677,13 @@ msgstr ""
 "E263: К сожалению эта команда не работает, поскольку не загружена библиотека "
 "Python"
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: К сожалению эта команда не работает, поскольку не загружен модуль "
+"Python site."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: Невозможно выполнить рекурсивный вызов Python"
 
@@ -4068,15 +4098,6 @@ msgstr "E548: Требуется ввести цифру"
 msgid "E549: Illegal percentage"
 msgstr "E549: Недопустимое значение процентов"
 
-msgid "Enter encryption key: "
-msgstr "Введите пароль для шифрования: "
-
-msgid "Enter same key again: "
-msgstr "Повторите ввод пароля: "
-
-msgid "Keys don't match!"
-msgstr "Введённые пароли не совпадают!"
-
 msgid "E854: path too long for completion"
 msgstr "E854: слишком большой путь для автодополнения"
 
@@ -4248,6 +4269,13 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: Неизвестный тип регистра %d"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: шаблон поиска и регистр выражения не могут содержать двух или более "
+"строк"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "Колонок: %ld; "
@@ -4565,6 +4593,19 @@ msgstr ""
 "\n"
 "Невозможно установить контекст безопасности для "
 
+msgid "Could not set security context "
+msgstr "Невозможно установить контекст безопасности "
+
+msgid " for "
+msgstr " для "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Невозможно получить контекст безопасности "
+
+msgid ". Removing it!\n"
+msgstr ". Будет удалён!\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -4834,6 +4875,10 @@ msgstr "E554: Синтаксическая ошибка в %s{...}"
 msgid "External submatches:\n"
 msgstr "Внешние подсоответствия:\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (рег. выражение НКА) невозможно повторить %s"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
@@ -6232,6 +6277,9 @@ msgstr "E446: Нет имени файла в позиции курсора"
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: Файл \"%s\" не найден по известным путям"
 
+msgid "List or number required"
+msgstr "Требуется список или число"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: Невозможно загрузить библиотеку %s"
@@ -6888,3 +6936,4 @@ msgid ""
 msgstr ""
 "Ошибка при установке пути: sys.path не является списком\n"
 "Следует добавить vim.VIM_SPECIAL_PATH в sys.path"
+

From be96524903230963fe6349d8a4a72ab4402aafc4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 16 Oct 2014 16:16:37 +0200
Subject: [PATCH 202/473] updated for version 7.4.480 Problem:    MS-Windows:
 Can't build. Solution:   Remove goto, use a flag instead.

---
 src/os_win32.c | 32 +++++++++++++++++---------------
 src/version.c  |  2 ++
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/os_win32.c b/src/os_win32.c
index a831ada54c..c03b963c4f 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -4646,9 +4646,10 @@ mch_call_shell(
     int		x = 0;
     int		tmode = cur_tmode;
 #ifdef FEAT_TITLE
-    char szShellTitle[512];
-
+    char	szShellTitle[512];
 # ifdef FEAT_MBYTE
+    int		did_set_title = FALSE;
+
     /* Change the title to reflect that we are in a subshell. */
     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
     {
@@ -4671,25 +4672,26 @@ mch_call_shell(
 			wcscat(szShellTitle, wn);
 		    SetConsoleTitleW(szShellTitle);
 		    vim_free(wn);
-		    goto didset;
+		    did_set_title = TRUE;
 		}
 	    }
 	}
     }
-#endif
-    /* Change the title to reflect that we are in a subshell. */
-    if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
-    {
-	if (cmd == NULL)
-	    strcat(szShellTitle, " :sh");
-	else
+    if (!did_set_title)
+# endif
+	/* Change the title to reflect that we are in a subshell. */
+	if (GetConsoleTitle(szShellTitle, sizeof(szShellTitle) - 4) > 0)
 	{
-	    strcat(szShellTitle, " - !");
-	    if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
-		strcat(szShellTitle, cmd);
+	    if (cmd == NULL)
+		strcat(szShellTitle, " :sh");
+	    else
+	    {
+		strcat(szShellTitle, " - !");
+		if ((strlen(szShellTitle) + strlen(cmd) < sizeof(szShellTitle)))
+		    strcat(szShellTitle, cmd);
+	    }
+	    SetConsoleTitle(szShellTitle);
 	}
-	SetConsoleTitle(szShellTitle);
-    }
 #endif
 
     out_flush();
diff --git a/src/version.c b/src/version.c
index 3388fafec6..01fdef61c7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    480,
 /**/
     479,
 /**/

From f83a1f54d78bb560d7c1cf861860a7b2dca68ffd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 16 Oct 2014 16:16:37 +0200
Subject: [PATCH 203/473] Added tag v7-4-480 for changeset e3149e2b4152

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3d11c64162..3509022505 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3202,3 +3202,4 @@ af998690a8841d4df95cea0bed4246f2ba98e247 v7-4-472
 f21a2f67bdbb7bb7c5c2352186757c3fd2471ce2 v7-4-477
 fcb898dea2bc8b6e89172cb48ef26c56cb79cfdd v7-4-478
 e0f2ed0efb49d1d01b978f8a7f0db5cc8813cb1b v7-4-479
+e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480

From 176ef6f87cc4cd741d5899b6b873c3336246e2dd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 16 Oct 2014 20:35:36 +0200
Subject: [PATCH 204/473] updated for version 7.4.481 Problem:    Compiler
 warning on MS-Windows. Solution:   Add type casts. (Ken Takata)

---
 src/os_mswin.c | 5 +++--
 src/version.c  | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/os_mswin.c b/src/os_mswin.c
index dfd40af8de..0dfd7d6091 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1644,10 +1644,11 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
 	    char_u  *to_free = NULL;
 	    int     maxlen;
 
-	    acp_to_enc(printer_name, STRLEN(printer_name), &to_free, &maxlen);
+	    acp_to_enc(printer_name, (int)STRLEN(printer_name), &to_free,
+								    &maxlen);
 	    if (to_free != NULL)
 		printer_name = to_free;
-	    acp_to_enc(port_name, STRLEN(port_name), &to_free, &maxlen);
+	    acp_to_enc(port_name, (int)STRLEN(port_name), &to_free, &maxlen);
 	    if (to_free != NULL)
 		port_name = to_free;
 	}
diff --git a/src/version.c b/src/version.c
index 01fdef61c7..7923a4d936 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    481,
 /**/
     480,
 /**/

From 409d719686588ea1fe9b2b5df2d536153fe36008 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 16 Oct 2014 20:35:36 +0200
Subject: [PATCH 205/473] Added tag v7-4-481 for changeset 15e88e3750e3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3509022505..508ed10d68 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3203,3 +3203,4 @@ f21a2f67bdbb7bb7c5c2352186757c3fd2471ce2 v7-4-477
 fcb898dea2bc8b6e89172cb48ef26c56cb79cfdd v7-4-478
 e0f2ed0efb49d1d01b978f8a7f0db5cc8813cb1b v7-4-479
 e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
+15e88e3750e3b1458b0d38c2f16ed784e51a4f3b v7-4-481

From 8a4a5f3d36b3cd9eb8c50ea269ce491a0d444108 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 14:15:17 +0200
Subject: [PATCH 206/473] updated for version 7.4.482 Problem:    When
 'balloonexpr' results in a list, the text has a trailing 	    newline.
 (Lcd) Solution:   Remove one trailing newline.

---
 src/gui_beval.c | 11 +++++++++++
 src/version.c   |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/src/gui_beval.c b/src/gui_beval.c
index ae78456607..b3e51fb843 100644
--- a/src/gui_beval.c
+++ b/src/gui_beval.c
@@ -30,6 +30,7 @@ general_beval_cb(beval, state)
     long	winnr = 0;
     char_u	*bexpr;
     buf_T	*save_curbuf;
+    size_t	len;
 # ifdef FEAT_WINDOWS
     win_T	*cw;
 # endif
@@ -83,6 +84,16 @@ general_beval_cb(beval, state)
 	    vim_free(result);
 	    result = eval_to_string(bexpr, NULL, TRUE);
 
+	    /* Remove one trailing newline, it is added when the result was a
+	     * list and it's hardly every useful.  If the user really wants a
+	     * trailing newline he can add two and one remains. */
+	    if (result != NULL)
+	    {
+		len = STRLEN(result);
+		if (len > 0 && result[len - 1] == NL)
+		    result[len - 1] = NUL;
+	    }
+
 	    if (use_sandbox)
 		--sandbox;
 	    --textlock;
diff --git a/src/version.c b/src/version.c
index 7923a4d936..7540f8ddc4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    482,
 /**/
     481,
 /**/

From 5fb67392ddb3888ac2fcbf3de4f72708fbc60422 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 14:15:17 +0200
Subject: [PATCH 207/473] Added tag v7-4-482 for changeset 488bb7c4ace0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 508ed10d68..7403aea916 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3204,3 +3204,4 @@ fcb898dea2bc8b6e89172cb48ef26c56cb79cfdd v7-4-478
 e0f2ed0efb49d1d01b978f8a7f0db5cc8813cb1b v7-4-479
 e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 15e88e3750e3b1458b0d38c2f16ed784e51a4f3b v7-4-481
+488bb7c4ace08fc93dd5405e7146cc82e32bebf1 v7-4-482

From 35032469a45cfcd798b08b1133be9613b738791e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 16:22:17 +0200
Subject: [PATCH 208/473] updated for version 7.4.483 Problem:    A 0x80 byte
 is not handled correctly in abbreviations. Solution:   Unescape special
 characters. Add a test. (Christian Brabandt)

---
 src/getchar.c               | 16 +++++++++++++++-
 src/testdir/Make_amiga.mak  |  1 +
 src/testdir/Make_dos.mak    |  1 +
 src/testdir/Make_ming.mak   |  1 +
 src/testdir/Make_os2.mak    |  1 +
 src/testdir/Make_vms.mms    |  1 +
 src/testdir/Makefile        |  1 +
 src/testdir/test_mapping.in | 15 +++++++++++++++
 src/testdir/test_mapping.ok |  2 ++
 src/version.c               |  2 ++
 10 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 src/testdir/test_mapping.in
 create mode 100644 src/testdir/test_mapping.ok

diff --git a/src/getchar.c b/src/getchar.c
index 9edb767e1b..cc93a7dd81 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4443,6 +4443,7 @@ check_abbr(c, ptr, col, mincol)
 #endif
     int		is_id = TRUE;
     int		vim_abbr;
+    int		qlen;		/* length of q, CSI/K_SPECIAL unescaped */
 
     if (typebuf.tb_no_abbr_cnt)	/* abbrev. are not recursive */
 	return FALSE;
@@ -4520,6 +4521,19 @@ check_abbr(c, ptr, col, mincol)
 #else
 	mp = first_abbr;
 #endif
+	qlen = mp->m_keylen;
+	if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
+	{
+	    char_u	*q = vim_strsave(mp->m_keys);
+
+	    /* might have CSI escaped mp->m_keys */
+	    if (q != NULL)
+	    {
+		vim_unescape_csi(q);
+		qlen = STRLEN(q);
+		vim_free(q);
+	    }
+	}
 	for ( ; mp;
 #ifdef FEAT_LOCALMAP
 		mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
@@ -4528,7 +4542,7 @@ check_abbr(c, ptr, col, mincol)
 	{
 	    /* find entries with right mode and keys */
 	    if (       (mp->m_mode & State)
-		    && mp->m_keylen == len
+		    && qlen == len
 		    && !STRNCMP(mp->m_keys, ptr, (size_t)len))
 		break;
 	}
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 5012812448..c0df2c1b56 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -43,6 +43,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_insertcount.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
 		test_utf8.out
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 38264f2eaf..91500439fd 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -42,6 +42,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_insertcount.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
 		test_utf8.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 782f89d646..247c0f259d 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -62,6 +62,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_insertcount.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
 		test_utf8.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index d3e833793a..cfade3f7f7 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -44,6 +44,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_insertcount.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
 		test_utf8.out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 3c7afc346d..6483b7ce3a 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -103,6 +103,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_insertcount.out \
 	 test_listlbr.out \
 	 test_listlbr_utf8.out \
+	 test_mapping.out \
 	 test_options.out \
 	 test_qf_title.out \
 	 test_utf8.out
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 59fe011696..41f25cfbd1 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -40,6 +40,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_insertcount.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
+		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
 		test_utf8.out
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
new file mode 100644
index 0000000000..55dac09bed
--- /dev/null
+++ b/src/testdir/test_mapping.in
@@ -0,0 +1,15 @@
+Test for mappings and abbreviations
+
+STARTTEST
+:so small.vim
+:so mbyte.vim
+: " abbreviations with р (0x80) should work
+:inoreab чкпр   vim
+GAчкпр 
+
+:/^test/,$w! test.out
+:qa!
+ENDTEST
+
+test starts here:
+
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
new file mode 100644
index 0000000000..abdaea6a36
--- /dev/null
+++ b/src/testdir/test_mapping.ok
@@ -0,0 +1,2 @@
+test starts here:
+vim
diff --git a/src/version.c b/src/version.c
index 7540f8ddc4..7d1a1914b6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    483,
 /**/
     482,
 /**/

From a151de4e61e0b71429bd5a048422349e178fdc28 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 16:22:18 +0200
Subject: [PATCH 209/473] Added tag v7-4-483 for changeset 3eb160c5b3a1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7403aea916..72d35d970c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3205,3 +3205,4 @@ e0f2ed0efb49d1d01b978f8a7f0db5cc8813cb1b v7-4-479
 e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 15e88e3750e3b1458b0d38c2f16ed784e51a4f3b v7-4-481
 488bb7c4ace08fc93dd5405e7146cc82e32bebf1 v7-4-482
+3eb160c5b3a195855cbe21309e6b9b375de63803 v7-4-483

From 18b2e1fbd6d03b084d6716752eb41d5abb842e63 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 18:17:09 +0200
Subject: [PATCH 210/473] updated for version 7.4.484 Problem:    Compiler
 warning on MS-Windows. (Ken Takata) Solution:   Add type cast.

---
 src/getchar.c | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/getchar.c b/src/getchar.c
index cc93a7dd81..cafa660c43 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4530,7 +4530,7 @@ check_abbr(c, ptr, col, mincol)
 	    if (q != NULL)
 	    {
 		vim_unescape_csi(q);
-		qlen = STRLEN(q);
+		qlen = (int)STRLEN(q);
 		vim_free(q);
 	    }
 	}
diff --git a/src/version.c b/src/version.c
index 7d1a1914b6..e0efbb6c35 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    484,
 /**/
     483,
 /**/

From ad94a08376e0fd2e88a07ff02b9a6a7c59cbcd94 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 18:17:09 +0200
Subject: [PATCH 211/473] Added tag v7-4-484 for changeset 76526e7100b0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 72d35d970c..15877a739f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3206,3 +3206,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 15e88e3750e3b1458b0d38c2f16ed784e51a4f3b v7-4-481
 488bb7c4ace08fc93dd5405e7146cc82e32bebf1 v7-4-482
 3eb160c5b3a195855cbe21309e6b9b375de63803 v7-4-483
+76526e7100b0c61d9cfbe79edc855f6798363627 v7-4-484

From bf4f05f64c071957039e91d9a4fb04572653109f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 19:35:31 +0200
Subject: [PATCH 212/473] updated for version 7.4.485 Problem:    Abbreviations
 don't work. (Toothpik) Solution:   Move the length computation inside the for
 loop.  Compare against 	    the unescaped key.

---
 src/getchar.c | 36 ++++++++++++++++++++----------------
 src/version.c |  2 ++
 2 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/src/getchar.c b/src/getchar.c
index cafa660c43..c9ee4d0510 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4443,7 +4443,6 @@ check_abbr(c, ptr, col, mincol)
 #endif
     int		is_id = TRUE;
     int		vim_abbr;
-    int		qlen;		/* length of q, CSI/K_SPECIAL unescaped */
 
     if (typebuf.tb_no_abbr_cnt)	/* abbrev. are not recursive */
 	return FALSE;
@@ -4521,29 +4520,34 @@ check_abbr(c, ptr, col, mincol)
 #else
 	mp = first_abbr;
 #endif
-	qlen = mp->m_keylen;
-	if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
-	{
-	    char_u	*q = vim_strsave(mp->m_keys);
-
-	    /* might have CSI escaped mp->m_keys */
-	    if (q != NULL)
-	    {
-		vim_unescape_csi(q);
-		qlen = (int)STRLEN(q);
-		vim_free(q);
-	    }
-	}
 	for ( ; mp;
 #ifdef FEAT_LOCALMAP
 		mp->m_next == NULL ? (mp = mp2, mp2 = NULL) :
 #endif
 		(mp = mp->m_next))
 	{
+	    int		qlen = mp->m_keylen;
+	    char_u	*q = mp->m_keys;
+	    int		match;
+
+	    if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL)
+	    {
+		/* might have CSI escaped mp->m_keys */
+		q = vim_strsave(mp->m_keys);
+		if (q != NULL)
+		{
+		    vim_unescape_csi(q);
+		    qlen = (int)STRLEN(q);
+		}
+	    }
+
 	    /* find entries with right mode and keys */
-	    if (       (mp->m_mode & State)
+	    match =    (mp->m_mode & State)
 		    && qlen == len
-		    && !STRNCMP(mp->m_keys, ptr, (size_t)len))
+		    && !STRNCMP(q, ptr, (size_t)len);
+	    if (q != mp->m_keys)
+		vim_free(q);
+	    if (match)
 		break;
 	}
 	if (mp != NULL)
diff --git a/src/version.c b/src/version.c
index e0efbb6c35..774480c004 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    485,
 /**/
     484,
 /**/

From e7202d8c5b6db2377bdea42cdcee67436e452a38 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 19:35:32 +0200
Subject: [PATCH 213/473] Added tag v7-4-485 for changeset 7844d92941fd

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 15877a739f..e1521bc212 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3207,3 +3207,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 488bb7c4ace08fc93dd5405e7146cc82e32bebf1 v7-4-482
 3eb160c5b3a195855cbe21309e6b9b375de63803 v7-4-483
 76526e7100b0c61d9cfbe79edc855f6798363627 v7-4-484
+7844d92941fdc10653ff5a6925346a02bb7f5404 v7-4-485

From c792039f303f204551650f3ffa63102bb1cb6e03 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 20:01:58 +0200
Subject: [PATCH 214/473] updated for version 7.4.486 Problem:    Check for
 writing to a yank register is wrong. Solution:   Negate the check. (Zyx). 
 Also clean up the #ifdefs.

---
 src/ex_cmds.h  |  2 --
 src/ex_docmd.c | 59 ++++++++++++++++----------------------------------
 src/version.c  |  2 ++
 3 files changed, 21 insertions(+), 42 deletions(-)

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 56dfe8ea7c..93c77764a0 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1153,8 +1153,6 @@ EX(CMD_tilde,		"~",		do_sub,
 #endif
 };
 
-#define USER_CMDIDX(idx) ((int)(idx) < 0)
-
 #ifndef DO_DECLARE_EXCMD
 typedef enum CMD_index cmdidx_T;
 
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c957b5e735..15ce34247c 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -49,10 +49,15 @@ static void ex_delcommand __ARGS((exarg_T *eap));
 static char_u *get_user_command_name __ARGS((int idx));
 # endif
 
+/* Wether a command index indicates a user command. */
+# define IS_USER_CMDIDX(idx) ((int)(idx) < 0)
+
 #else
 # define ex_command	ex_ni
 # define ex_comclear	ex_ni
 # define ex_delcommand	ex_ni
+/* Wether a command index indicates a user command. */
+# define IS_USER_CMDIDX(idx) (FALSE)
 #endif
 
 #ifdef FEAT_EVAL
@@ -2190,11 +2195,8 @@ do_one_cmd(cmdlinep, sourcing,
 	goto doend;
     }
 
-    ni = (
-#ifdef FEAT_USR_CMDS
-	    !USER_CMDIDX(ea.cmdidx) &&
-#endif
-	    (cmdnames[ea.cmdidx].cmd_func == ex_ni
+    ni = (!IS_USER_CMDIDX(ea.cmdidx)
+	    && (cmdnames[ea.cmdidx].cmd_func == ex_ni
 #ifdef HAVE_EX_SCRIPT_NI
 	     || cmdnames[ea.cmdidx].cmd_func == ex_script_ni
 #endif
@@ -2229,9 +2231,7 @@ do_one_cmd(cmdlinep, sourcing,
 /*
  * 5. parse arguments
  */
-#ifdef FEAT_USR_CMDS
-    if (!USER_CMDIDX(ea.cmdidx))
-#endif
+    if (!IS_USER_CMDIDX(ea.cmdidx))
 	ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
 
     if (!ea.skip)
@@ -2252,10 +2252,7 @@ do_one_cmd(cmdlinep, sourcing,
 	}
 
 	if (text_locked() && !(ea.argt & CMDWIN)
-# ifdef FEAT_USR_CMDS
-		&& !USER_CMDIDX(ea.cmdidx)
-# endif
-	   )
+		&& !IS_USER_CMDIDX(ea.cmdidx))
 	{
 	    /* Command not allowed when editing the command line. */
 #ifdef FEAT_CMDWIN
@@ -2273,9 +2270,7 @@ do_one_cmd(cmdlinep, sourcing,
 	if (!(ea.argt & CMDWIN)
 		&& ea.cmdidx != CMD_edit
 		&& ea.cmdidx != CMD_checktime
-# ifdef FEAT_USR_CMDS
-		&& !USER_CMDIDX(ea.cmdidx)
-# endif
+		&& !IS_USER_CMDIDX(ea.cmdidx)
 		&& curbuf_locked())
 	    goto doend;
 #endif
@@ -2468,10 +2463,8 @@ do_one_cmd(cmdlinep, sourcing,
     /* accept numbered register only when no count allowed (:put) */
     if (       (ea.argt & REGSTR)
 	    && *ea.arg != NUL
-#ifdef FEAT_USR_CMDS
-	    /* Do not allow register = for user commands */
-	    && (!USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
-#endif
+	       /* Do not allow register = for user commands */
+	    && (!IS_USER_CMDIDX(ea.cmdidx) || *ea.arg != '=')
 	    && !((ea.argt & COUNT) && VIM_ISDIGIT(*ea.arg)))
     {
 #ifndef FEAT_CLIPBOARD
@@ -2482,14 +2475,8 @@ do_one_cmd(cmdlinep, sourcing,
 	    goto doend;
 	}
 #endif
-	if (
-#ifdef FEAT_USR_CMDS
-	    valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
-						   && USER_CMDIDX(ea.cmdidx)))
-#else
-	    valid_yank_reg(*ea.arg, ea.cmdidx != CMD_put)
-#endif
-	   )
+	if (valid_yank_reg(*ea.arg, (ea.cmdidx != CMD_put
+					      && !IS_USER_CMDIDX(ea.cmdidx))))
 	{
 	    ea.regname = *ea.arg++;
 #ifdef FEAT_EVAL
@@ -2663,10 +2650,7 @@ do_one_cmd(cmdlinep, sourcing,
      * number.  Don't do this for a user command.
      */
     if ((ea.argt & BUFNAME) && *ea.arg != NUL && ea.addr_count == 0
-# ifdef FEAT_USR_CMDS
-	    && !USER_CMDIDX(ea.cmdidx)
-# endif
-	    )
+	    && !IS_USER_CMDIDX(ea.cmdidx))
     {
 	/*
 	 * :bdelete, :bwipeout and :bunload take several arguments, separated
@@ -2704,7 +2688,7 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
 
 #ifdef FEAT_USR_CMDS
-    if (USER_CMDIDX(ea.cmdidx))
+    if (IS_USER_CMDIDX(ea.cmdidx))
     {
 	/*
 	 * Execute a user-defined command.
@@ -2763,11 +2747,8 @@ do_one_cmd(cmdlinep, sourcing,
     }
 #ifdef FEAT_EVAL
     do_errthrow(cstack,
-	    (ea.cmdidx != CMD_SIZE
-# ifdef FEAT_USR_CMDS
-	     && !USER_CMDIDX(ea.cmdidx)
-# endif
-	    ) ? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
+	    (ea.cmdidx != CMD_SIZE && !IS_USER_CMDIDX(ea.cmdidx))
+			? cmdnames[(int)ea.cmdidx].cmd_name : (char_u *)NULL);
 #endif
 
     if (verbose_save >= 0)
@@ -3361,9 +3342,7 @@ set_one_cmd_context(xp, buff)
 /*
  * 5. parse arguments
  */
-#ifdef FEAT_USR_CMDS
-    if (!USER_CMDIDX(ea.cmdidx))
-#endif
+    if (!IS_USER_CMDIDX(ea.cmdidx))
 	ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
 
     arg = skipwhite(p);
diff --git a/src/version.c b/src/version.c
index 774480c004..c470959c68 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    486,
 /**/
     485,
 /**/

From 671c00ba7277773128d5b07afc67efc05c5ce864 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 20:01:59 +0200
Subject: [PATCH 215/473] Added tag v7-4-486 for changeset b8caf7045e3d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e1521bc212..fcf366c3b1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3208,3 +3208,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 3eb160c5b3a195855cbe21309e6b9b375de63803 v7-4-483
 76526e7100b0c61d9cfbe79edc855f6798363627 v7-4-484
 7844d92941fdc10653ff5a6925346a02bb7f5404 v7-4-485
+b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486

From b5345b9cbf3512e0dc6197b0ff8003106429f1f5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 20:57:15 +0200
Subject: [PATCH 216/473] updated for version 7.4.487 Problem:    ":sign jump"
 may use another window even though the file is 	    already edited in
 the current window. Solution:   First check if the file is in the current
 window. (James McCoy)

---
 src/testdir/Make_amiga.mak |  2 ++
 src/testdir/Make_dos.mak   |  1 +
 src/testdir/Make_ming.mak  |  1 +
 src/testdir/Make_os2.mak   |  1 +
 src/testdir/Make_vms.mms   |  1 +
 src/testdir/Makefile       |  1 +
 src/version.c              |  2 ++
 src/window.c               | 30 +++++++++++-------------------
 8 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index c0df2c1b56..58316fc7f2 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -46,6 +46,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
+		test_signs.out \
 		test_utf8.out
 
 .SUFFIXES: .in .out
@@ -179,4 +180,5 @@ test_listlbr.out: test_listlbr.in
 test_listlbr_utf8.out: test_listlbr_utf8.in
 test_options.out: test_options.in
 test_qf_title.out: test_qf_title.in
+test_signs.out: test_signs.in
 test_utf8.out: test_utf8.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 91500439fd..abcabce03e 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -45,6 +45,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
+		test_signs.out \
 		test_utf8.out
 
 SCRIPTS32 =	test50.out test70.out
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 247c0f259d..2a124b1b83 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -65,6 +65,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
+		test_signs.out \
 		test_utf8.out
 
 SCRIPTS32 =	test50.out test70.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index cfade3f7f7..5f3dc13930 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -47,6 +47,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
+		test_signs.out \
 		test_utf8.out
 
 .SUFFIXES: .in .out
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 6483b7ce3a..e105376baf 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -106,6 +106,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_mapping.out \
 	 test_options.out \
 	 test_qf_title.out \
+	 test_signs.out \
 	 test_utf8.out
 
 # Known problems:
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 41f25cfbd1..6b3bf9b7e1 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -43,6 +43,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_mapping.out \
 		test_options.out \
 		test_qf_title.out \
+		test_signs.out \
 		test_utf8.out
 
 SCRIPTS_GUI = test16.out
diff --git a/src/version.c b/src/version.c
index c470959c68..b6f750cdcc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    487,
 /**/
     486,
 /**/
diff --git a/src/window.c b/src/window.c
index fda9199b2e..b975a61420 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4407,20 +4407,19 @@ win_enter_ext(wp, undo_sync, curwin_invalid, trigger_enter_autocmds, trigger_lea
 buf_jump_open_win(buf)
     buf_T	*buf;
 {
-# ifdef FEAT_WINDOWS
-    win_T	*wp;
+    win_T	*wp = NULL;
 
-    for (wp = firstwin; wp != NULL; wp = wp->w_next)
-	if (wp->w_buffer == buf)
-	    break;
+    if (curwin->w_buffer == buf)
+	wp = curwin;
+# ifdef FEAT_WINDOWS
+    else
+	for (wp = firstwin; wp != NULL; wp = wp->w_next)
+	    if (wp->w_buffer == buf)
+		break;
     if (wp != NULL)
 	win_enter(wp, FALSE);
-    return wp;
-# else
-    if (curwin->w_buffer == buf)
-	return curwin;
-    return NULL;
 # endif
+    return wp;
 }
 
 /*
@@ -4432,12 +4431,10 @@ buf_jump_open_win(buf)
 buf_jump_open_tab(buf)
     buf_T	*buf;
 {
+    win_T	*wp = buf_jump_open_win(buf);
 # ifdef FEAT_WINDOWS
-    win_T	*wp;
     tabpage_T	*tp;
 
-    /* First try the current tab page. */
-    wp = buf_jump_open_win(buf);
     if (wp != NULL)
 	return wp;
 
@@ -4455,13 +4452,8 @@ buf_jump_open_tab(buf)
 		break;
 	    }
 	}
-
-    return wp;
-# else
-    if (curwin->w_buffer == buf)
-	return curwin;
-    return NULL;
 # endif
+    return wp;
 }
 #endif
 

From 39f598e1e1b3eacb82d1ed54ec8a6cbf752007a8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 20:57:15 +0200
Subject: [PATCH 217/473] Added tag v7-4-487 for changeset 1f9577e9ef1b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index fcf366c3b1..9fdc9fb5d8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3209,3 +3209,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 76526e7100b0c61d9cfbe79edc855f6798363627 v7-4-484
 7844d92941fdc10653ff5a6925346a02bb7f5404 v7-4-485
 b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
+1f9577e9ef1b22cf701b58d418a4ce00071405ed v7-4-487

From 10bba308228cf97261434ccc50e1719e1a482903 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 21 Oct 2014 22:36:31 +0200
Subject: [PATCH 218/473] Add the missing test files.

---
 src/testdir/test_signs.in | 22 ++++++++++++++++++++++
 src/testdir/test_signs.ok |  2 ++
 2 files changed, 24 insertions(+)
 create mode 100644 src/testdir/test_signs.in
 create mode 100644 src/testdir/test_signs.ok

diff --git a/src/testdir/test_signs.in b/src/testdir/test_signs.in
new file mode 100644
index 0000000000..a2f15e9323
--- /dev/null
+++ b/src/testdir/test_signs.in
@@ -0,0 +1,22 @@
+Tests for signs
+STARTTEST
+:so small.vim
+:if !has("signs")
+:  e! test.ok
+:  wq! test.out
+:endif
+:"
+:sign define JumpSign text=x
+:exe 'sign place 42 line=2 name=JumpSign buffer=' . bufnr('')
+:" Split the window to the bottom to verify :sign-jump will stay in the current
+:" window if the buffer is displayed there
+:bot split
+:exe 'sign jump 42 buffer=' . bufnr('')
+:call append(line('$'), winnr())
+:$-1,$w! test.out
+ENDTEST
+
+STARTTEST
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test_signs.ok b/src/testdir/test_signs.ok
new file mode 100644
index 0000000000..1f8c977ecc
--- /dev/null
+++ b/src/testdir/test_signs.ok
@@ -0,0 +1,2 @@
+
+2

From faeea8a20accec3797d89a017213aab00ce2ff0c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 22 Oct 2014 22:09:01 +0200
Subject: [PATCH 219/473] updated for version 7.4.488 Problem:    test_mapping
 fails for some people. Solution:   Set the 'encoding' option. (Ken Takata)

---
 src/testdir/test_mapping.in | 1 +
 src/version.c               | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
index 55dac09bed..e2572772c1 100644
--- a/src/testdir/test_mapping.in
+++ b/src/testdir/test_mapping.in
@@ -3,6 +3,7 @@ Test for mappings and abbreviations
 STARTTEST
 :so small.vim
 :so mbyte.vim
+:set encoding=utf-8
 : " abbreviations with р (0x80) should work
 :inoreab чкпр   vim
 GAчкпр 
diff --git a/src/version.c b/src/version.c
index b6f750cdcc..e720782c79 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    488,
 /**/
     487,
 /**/

From 10ded419a21fa693d2768f5f05c902927c7c0cd8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 22 Oct 2014 22:09:01 +0200
Subject: [PATCH 220/473] Added tag v7-4-488 for changeset 3ec6e0ef4a67

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9fdc9fb5d8..9bad060518 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3210,3 +3210,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 7844d92941fdc10653ff5a6925346a02bb7f5404 v7-4-485
 b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 1f9577e9ef1b22cf701b58d418a4ce00071405ed v7-4-487
+3ec6e0ef4a67cb6030466bcd4d5d9f2fdd4f70b0 v7-4-488

From 96335fa808bbcd485de9d802b62ae81ea30d2ec8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 12:42:01 +0100
Subject: [PATCH 221/473] updated for version 7.4.489 Problem:    Cursor
 movement still wrong when 'lbr' is set and there is a 	    number column.
 (Hirohito Higashi) Solution:   Add correction for number column. (Hiroyuki
 Takagi)

---
 src/charset.c | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/charset.c b/src/charset.c
index 918f9a5142..e9745c09a2 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1184,6 +1184,8 @@ win_lbr_chartabsize(wp, line, s, col, headp)
 	{
 	    col -= W_WIDTH(wp);
 	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
+	    if (numberextra > 0)
+		col %= numberextra;
 	    if (*p_sbr != NUL)
 	    {
 		colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
diff --git a/src/version.c b/src/version.c
index e720782c79..1ef081855a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    489,
 /**/
     488,
 /**/

From 68d40f15fa82a923d83887145b4bc440c2b6b669 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 12:42:01 +0100
Subject: [PATCH 222/473] Added tag v7-4-489 for changeset 31c78e590806

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9bad060518..5f4fc0b7e0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3211,3 +3211,4 @@ e3149e2b415260e7a3d8c9d51ee56d185e6bb1d7 v7-4-480
 b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 1f9577e9ef1b22cf701b58d418a4ce00071405ed v7-4-487
 3ec6e0ef4a67cb6030466bcd4d5d9f2fdd4f70b0 v7-4-488
+31c78e59080674530e5a2d2c00c343a5cab76dd0 v7-4-489

From db80fcda0f287cd44c04d18b8adb5421c83cb145 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 13:54:25 +0100
Subject: [PATCH 223/473] updated for version 7.4.490 Problem:    Cannot
 specify the buffer to use for "do" and "dp", making them 	    useless
 for three-way diff. Solution:   Use the count as the buffer number. (James
 McCoy)

---
 src/diff.c         | 12 ++++++++++--
 src/normal.c       |  4 ++--
 src/proto/diff.pro |  2 +-
 src/version.c      |  2 ++
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/diff.c b/src/diff.c
index d324f99d87..caee6e5a53 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -2107,12 +2107,20 @@ diff_infold(wp, lnum)
  * "dp" and "do" commands.
  */
     void
-nv_diffgetput(put)
+nv_diffgetput(put, count)
     int		put;
+    long	count;
 {
     exarg_T	ea;
+    char_u	buf[30];
 
-    ea.arg = (char_u *)"";
+    if (count == 0)
+	ea.arg = (char_u *)"";
+    else
+    {
+	vim_snprintf((char *)buf, 30, "%ld", count);
+	ea.arg = buf;
+    }
     if (put)
 	ea.cmdidx = CMD_diffput;
     else
diff --git a/src/normal.c b/src/normal.c
index 0116d058ba..bd5bacd59a 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -9284,7 +9284,7 @@ nv_put(cap)
 	if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'p')
 	{
 	    clearop(cap->oap);
-	    nv_diffgetput(TRUE);
+	    nv_diffgetput(TRUE, cap->opcount);
 	}
 	else
 #endif
@@ -9407,7 +9407,7 @@ nv_open(cap)
     if (cap->oap->op_type == OP_DELETE && cap->cmdchar == 'o')
     {
 	clearop(cap->oap);
-	nv_diffgetput(FALSE);
+	nv_diffgetput(FALSE, cap->opcount);
     }
     else
 #endif
diff --git a/src/proto/diff.pro b/src/proto/diff.pro
index 18c42651fd..3234fde1a6 100644
--- a/src/proto/diff.pro
+++ b/src/proto/diff.pro
@@ -18,7 +18,7 @@ int diffopt_changed __ARGS((void));
 int diffopt_horizontal __ARGS((void));
 int diff_find_change __ARGS((win_T *wp, linenr_T lnum, int *startp, int *endp));
 int diff_infold __ARGS((win_T *wp, linenr_T lnum));
-void nv_diffgetput __ARGS((int put));
+void nv_diffgetput __ARGS((int put, long count));
 void ex_diffgetput __ARGS((exarg_T *eap));
 int diff_mode_buf __ARGS((buf_T *buf));
 int diff_move_to __ARGS((int dir, long count));
diff --git a/src/version.c b/src/version.c
index 1ef081855a..3fc09c83c5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    490,
 /**/
     489,
 /**/

From d97ab12984baf13359de45f4c388ddd979ef3ab6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 13:54:25 +0100
Subject: [PATCH 224/473] Added tag v7-4-490 for changeset df92c2b2a179

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5f4fc0b7e0..71c82b8c3e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3212,3 +3212,4 @@ b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 1f9577e9ef1b22cf701b58d418a4ce00071405ed v7-4-487
 3ec6e0ef4a67cb6030466bcd4d5d9f2fdd4f70b0 v7-4-488
 31c78e59080674530e5a2d2c00c343a5cab76dd0 v7-4-489
+df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490

From 6f87acde627c7fae3789fe7d4d1c04ce81c00643 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 15:45:52 +0100
Subject: [PATCH 225/473] updated for version 7.4.491 Problem:    When
 winrestview() has a negative "topline" value there are 	    display
 errors. Solution:   Correct a negative value to 1. (Hirohito Higashi)

---
 src/eval.c    | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index 8f62cb2e83..f5aa7e919e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -19576,7 +19576,7 @@ f_winrestview(argvars, rettv)
 # endif
 	changed_window_setting();
 
-	if (curwin->w_topline == 0)
+	if (curwin->w_topline <= 0)
 	    curwin->w_topline = 1;
 	if (curwin->w_topline > curbuf->b_ml.ml_line_count)
 	    curwin->w_topline = curbuf->b_ml.ml_line_count;
diff --git a/src/version.c b/src/version.c
index 3fc09c83c5..71258da12d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    491,
 /**/
     490,
 /**/

From 324aef4a0a4ce513b7209091eb448dc48293973c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 15:45:52 +0100
Subject: [PATCH 226/473] Added tag v7-4-491 for changeset 5f54e1995751

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 71c82b8c3e..d7a054fc81 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3213,3 +3213,4 @@ b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 3ec6e0ef4a67cb6030466bcd4d5d9f2fdd4f70b0 v7-4-488
 31c78e59080674530e5a2d2c00c343a5cab76dd0 v7-4-489
 df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
+5f54e1995751392b4cfa48d8b49f9fcf195bb239 v7-4-491

From 3c299f9d2fdce6a888cd03ab5949144d1413b19f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 19:20:36 +0100
Subject: [PATCH 227/473] updated for version 7.4.492 Problem:    In Insert
 mode, after inserting a newline that inserts a comment 	    leader,
 CTRL-O moves to the right. (ZyX) Issue 57. Solution:   Correct the condition
 for moving the cursor back to the NUL. 	    (Christian Brabandt)

---
 src/edit.c           | 8 ++++++--
 src/testdir/test4.in | 3 +++
 src/testdir/test4.ok | 3 +++
 src/version.c        | 2 ++
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/edit.c b/src/edit.c
index 8243890c52..ee63daa1c7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -6916,8 +6916,12 @@ stop_insert(end_insert_pos, esc, nomove)
 	    }
 	    if (curwin->w_cursor.lnum != tpos.lnum)
 		curwin->w_cursor = tpos;
-	    else if (cc != NUL)
-		++curwin->w_cursor.col;	/* put cursor back on the NUL */
+	    else
+	    {
+		tpos.col++;
+		if (cc != NUL && gchar_pos(&tpos) == NUL)
+		    ++curwin->w_cursor.col;	/* put cursor back on the NUL */
+	    }
 
 	    /* <C-S-Right> may have started Visual mode, adjust the position for
 	     * deleted characters. */
diff --git a/src/testdir/test4.in b/src/testdir/test4.in
index 4aa2fe5a86..b8bd9fc9cf 100644
--- a/src/testdir/test4.in
+++ b/src/testdir/test4.in
@@ -17,6 +17,9 @@ othis should be auto-indented
 G?this is a
 othis should be in column 1:wq " append text without autoindent to Xxx
 G:r Xxx             " include Xxx in the current file
+:set fo+=r          " issue #57 do not move cursor on <c-o> when autoindent is set
+Go# abcdef2hi
+d0o# abcdef2hid0
 :?startstart?,$w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test4.ok b/src/testdir/test4.ok
index dffecda4d2..d032e4c319 100644
--- a/src/testdir/test4.ok
+++ b/src/testdir/test4.ok
@@ -15,3 +15,6 @@ vim: set noai :
 	this is a test
 this should be in column 1
 end of test file Xxx
+# abc
+def
+def
diff --git a/src/version.c b/src/version.c
index 71258da12d..69538140c1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    492,
 /**/
     491,
 /**/

From 7f393646cf71624ac1b7f85e9afd2a15e9bab012 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 19:20:36 +0100
Subject: [PATCH 228/473] Added tag v7-4-492 for changeset 5e998fc610d5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d7a054fc81..2eed4f7baf 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3214,3 +3214,4 @@ b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 31c78e59080674530e5a2d2c00c343a5cab76dd0 v7-4-489
 df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
 5f54e1995751392b4cfa48d8b49f9fcf195bb239 v7-4-491
+5e998fc610d5b23ea55ef64c8f5291522ff3b4a5 v7-4-492

From f17e8fcb70db206e98ccb349efdebc925303037b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 19:51:36 +0100
Subject: [PATCH 229/473] updated for version 7.4.493 Problem:    A TextChanged
 autocommand is triggered when saving a file. 	    (William Gardner)
 Solution:   Update last_changedtick after calling unchanged(). (Christian 
     Brabandt)

---
 src/fileio.c  | 7 +++++++
 src/version.c | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/src/fileio.c b/src/fileio.c
index c7e846b82a..0843d04296 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4877,6 +4877,13 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
 	    )
     {
 	unchanged(buf, TRUE);
+#ifdef FEAT_AUTOCMD
+	/* buf->b_changedtick is always incremented in unchanged() but that
+	 * should not trigger a TextChanged event. */
+	if (last_changedtick + 1 == buf->b_changedtick
+					       && last_changedtick_buf == buf)
+	    last_changedtick = buf->b_changedtick;
+#endif
 	u_unchanged(buf);
 	u_update_save_nr(buf);
     }
diff --git a/src/version.c b/src/version.c
index 69538140c1..378818e66d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    493,
 /**/
     492,
 /**/

From 748d52fb24078e26ea83ab18ead7dbfea03bad82 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Fri, 31 Oct 2014 19:51:36 +0100
Subject: [PATCH 230/473] Added tag v7-4-493 for changeset a0daa5feaccb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2eed4f7baf..b96f40e337 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3215,3 +3215,4 @@ b8caf7045e3d838849cde86f3eb0142e50482276 v7-4-486
 df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
 5f54e1995751392b4cfa48d8b49f9fcf195bb239 v7-4-491
 5e998fc610d5b23ea55ef64c8f5291522ff3b4a5 v7-4-492
+a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493

From 5ce1dbb542e184761e511487a56d26767c659548 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 09:53:23 +0100
Subject: [PATCH 231/473] updated for version 7.4.494 Problem:    Cursor shape
 is wrong after a CompleteDone autocommand. Solution:   Update the cursor and
 mouse shape after ":normal" restores the 	    state. (Jacob Niehus)

---
 src/ex_docmd.c | 9 ++++++++-
 src/version.c  | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 15ce34247c..35e44f0f3c 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9526,8 +9526,15 @@ ex_normal(eap)
     msg_didout |= save_msg_didout;	/* don't reset msg_didout now */
 
     /* Restore the state (needed when called from a function executed for
-     * 'indentexpr'). */
+     * 'indentexpr'). Update the mouse and cursor, they may have changed. */
     State = save_State;
+#ifdef FEAT_MOUSE
+    setmouse();
+#endif
+#ifdef CURSOR_SHAPE
+    ui_cursor_shape();		/* may show different cursor shape */
+#endif
+
 #ifdef FEAT_MBYTE
     vim_free(arg);
 #endif
diff --git a/src/version.c b/src/version.c
index 378818e66d..ec0e667e2f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    494,
 /**/
     493,
 /**/

From 22f128a1196204204c521804c5b85f0e1045c742 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 09:53:23 +0100
Subject: [PATCH 232/473] Added tag v7-4-494 for changeset 85d8cde3b432

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b96f40e337..6c5e582b05 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3216,3 +3216,4 @@ df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
 5f54e1995751392b4cfa48d8b49f9fcf195bb239 v7-4-491
 5e998fc610d5b23ea55ef64c8f5291522ff3b4a5 v7-4-492
 a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
+85d8cde3b432ae627382e1f2222aa8368f5837b8 v7-4-494

From b97429511d3c1a0fc1987610e4c85bec2281a34c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 13:43:21 +0100
Subject: [PATCH 233/473] updated for version 7.4.495 Problem:    XPM isn't
 used correctly in the Cygwin Makefile. Solution:   Include the rules like in
 Make_ming.mak. (Ken Takata)

---
 src/Make_cyg.mak | 21 ++++++++++++++++++++-
 src/version.c    |  2 ++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index abd35a6a42..ff40548df9 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -485,13 +485,32 @@ USE_STDCPLUS = yes
 endif
 
 ##############################
+ifndef XPM
+ifeq ($(ARCH),i386)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i486)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i586)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i686)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),x86-64)
+XPM = xpm/x64
+endif
+endif
+ifdef XPM
 ifneq ($(XPM),no)
 # Only allow XPM for a GUI build.
 DEFINES += -DFEAT_XPM_W32
-INCLUDES += -I$(XPM)/include
+INCLUDES += -I$(XPM)/include -I$(XPM)/../include
 EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
 EXTRA_LIBS += -L$(XPM)/lib -lXpm
 endif
+endif
 
 ##############################
 EXE = gvim$(DEBUG_SUFFIX).exe
diff --git a/src/version.c b/src/version.c
index ec0e667e2f..4b75a58a51 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    495,
 /**/
     494,
 /**/

From d1c20dff1d781f7d567238c1543aaf31140c70b4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 13:43:21 +0100
Subject: [PATCH 234/473] Added tag v7-4-495 for changeset 0079791cbbea

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6c5e582b05..78735f509f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3217,3 +3217,4 @@ df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
 5e998fc610d5b23ea55ef64c8f5291522ff3b4a5 v7-4-492
 a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 85d8cde3b432ae627382e1f2222aa8368f5837b8 v7-4-494
+0079791cbbeaaad9ff4391097c2f7896114d6022 v7-4-495

From 7f9e59b98449cf07fbccc13dd073bc0baacab72b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 13:53:32 +0100
Subject: [PATCH 235/473] updated for version 7.4.496 Problem:    Many lines
 are both in Make_cyg.mak and Make_ming.mak Solution:   Move the common parts
 to one file. (Ken Takata)

---
 Filelist              |   1 +
 src/INSTALLpc.txt     |  25 +-
 src/Make_cyg.mak      | 766 ++------------------------------------
 src/Make_cyg_ming.mak | 847 ++++++++++++++++++++++++++++++++++++++++++
 src/Make_ming.mak     | 817 +---------------------------------------
 src/Make_mvc.mak      |  15 +-
 src/version.c         |   2 +
 7 files changed, 923 insertions(+), 1550 deletions(-)
 create mode 100644 src/Make_cyg_ming.mak

diff --git a/Filelist b/Filelist
index dd09b840ca..fd145bd16a 100644
--- a/Filelist
+++ b/Filelist
@@ -277,6 +277,7 @@ SRC_DOS =	\
 		src/Make_bc3.mak \
 		src/Make_bc5.mak \
 		src/Make_cyg.mak \
+		src/Make_cyg_ming.mak \
 		src/Make_djg.mak \
 		src/Make_ivc.mak \
 		src/Make_dvc.mak \
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 370c208eec..24fb4f0aad 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -228,11 +228,15 @@ at:
 
     http://www.mingw.org/
 
+or you can use 'MinGW-w64' compiler.
+
+    http://mingw-w64.sourceforge.net/
+
 Once you have downloaded the compiler binaries, unpack them on your hard disk
 somewhere, and put them on your PATH.  If you are on Win95/98 you can edit
 your AUTOEXEC.BAT file with a line like:
 
-    set PATH=C:\GCC-2.95.2\BIN;%PATH%
+    set PATH=C:\MinGW\bin;%PATH%
 
 or on NT/2000/XP, go to the Control Panel, (Performance and Maintenance),
 System, Advanced, and edit the environment from there.
@@ -240,10 +244,10 @@ System, Advanced, and edit the environment from there.
 Test if gcc is on your path.  From a CMD (or COMMAND on '95/98) window:
 
     C:\> gcc --version
-    2.95.2
+    gcc (GCC) 4.8.1
 
-    C:\> make --version
-    GNU Make version 3.77 (...etc...)
+    C:\> mingw32-make --version
+    GNU Make 3.82.90 (...etc...)
 
 Now you are ready to rock 'n' roll.  Unpack the vim sources (look on
 www.vim.org for exactly which version of the vim files you need).
@@ -255,7 +259,7 @@ Change directory to 'vim\src':
 
 and you type:
 
-    make -f Make_ming.mak gvim.exe
+    mingw32-make -f Make_ming.mak gvim.exe
 
 After churning for a while, you will end up with 'gvim.exe' in the 'vim\src'
 directory.
@@ -264,7 +268,7 @@ You should not need to do *any* editing of any files to get vim compiled this
 way.  If, for some reason, you want the console-mode-only version of vim (this
 is NOT recommended on Win32, especially on '95/'98!!!), you can use:
 
-    make -f Make_ming.mak GUI=no vim.exe
+    mingw32-make -f Make_ming.mak GUI=no vim.exe
 
 If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
 (also free!) and compress the file (typical compression is 50%). UPX can be
@@ -291,8 +295,7 @@ You need to uncomment lines in Make_ming.mak to have NLS defined.
 Use Make_cyg.mak with Cygwin's GCC. See
     http://users.skynet.be/antoine.mechelynck/vim/compile.htm
 
-The Cygnus one many not fully work yet.
-With Cygnus gcc you can use the Unix Makefile instead (you need to get the
+With Cygnus gcc you should use the Unix Makefile instead (you need to get the
 Unix archive then).  Then you get a Cygwin application (feels like Vim is
 running on Unix), while with Make_cyg.mak you get a Windows application (like
 with the other makefiles).
@@ -316,9 +319,9 @@ your Linux (or other unix) box.  To do this, you need to follow a few steps:
 	http://www.mingw.org/wiki/LinuxCrossMinGW
 	http://www.libsdl.org/extras/win32/cross/README.txt
     2) Get and unpack both the Unix sources and the extra archive
-    3) in 'Make_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
-       Make further changes to 'Make_ming.mak' as you wish.
-       If your cross-compiler prefix differs from the predefined value,
+    3) in 'Make_cyg_ming.mak', set 'CROSS' to 'yes' instead of 'no'.
+       Make further changes to 'Make_cyg_ming.mak' and 'Make_ming.mak' as you
+       wish.  If your cross-compiler prefix differs from the predefined value,
        set 'CROSS_COMPILE' corresponding.
     4) make -f Make_ming.mak gvim.exe
 
diff --git a/src/Make_cyg.mak b/src/Make_cyg.mak
index ff40548df9..828666ce0a 100644
--- a/src/Make_cyg.mak
+++ b/src/Make_cyg.mak
@@ -1,754 +1,52 @@
 #
-# Makefile for VIM on Win32, using Cygnus gcc
-# Updated by Dan Sharp.
-# Last Change: 2014 Aug 10
+# Makefile for VIM on Win32, using MinGW cross compiler on Cygwin
 #
 # Also read INSTALLpc.txt!
 #
 # This compiles Vim as a Windows application.  If you want Vim to run as a
 # Cygwin application use the Makefile (just like on Unix).
 #
-# GUI		no or yes: set to yes if you want the GUI version (yes)
-# DIRECTX	no or yes: set to yes if you want use DirectWrite (no)
-# PERL		define to path to Perl dir to get Perl support (not defined)
-#   PERL_VER	  define to version of Perl being used (56)
-#   DYNAMIC_PERL  no or yes: set to yes to load the Perl DLL dynamically (yes)
-# PYTHON	define to path to Python dir to get PYTHON support (not defined)
-#   PYTHON_VER	    define to version of Python being used (22)
-#   DYNAMIC_PYTHON  no or yes: use yes to load the Python DLL dynamically (yes)
-# PYTHON3	define to path to Python3 dir to get PYTHON3 support (not defined)
-#   PYTHON3_VER	    define to version of Python3 being used (22)
-#   DYNAMIC_PYTHON3  no or yes: use yes to load the Python3 DLL dynamically (yes)
-# TCL		define to path to TCL dir to get TCL support (not defined)
-#   TCL_VER	define to version of TCL being used (83)
-#   DYNAMIC_TCL no or yes: use yes to load the TCL DLL dynamically (yes)
-# RUBY		define to path to Ruby dir to get Ruby support (not defined)
-#   RUBY_VER		define to version of Ruby being used (16)
-#   RUBY_VER_LONG	same, but in format with dot. (1.6)
-#	    You must set RUBY_VER_LONG when changing RUBY_VER.
-#	    You must set RUBY_API_VER version to RUBY_VER_LONG.
-#	    Don't set ruby API version to RUBY_VER like 191.
-#   DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (yes)
-# MZSCHEME	define to path to MzScheme dir to get MZSCHEME support (not defined)
-#   MZSCHEME_VER      define to version of MzScheme being used (209_000)
-#   DYNAMIC_MZSCHEME  no or yes: use yes to load the MzScheme DLLs dynamically (yes)
-#   MZSCHEME_DLLS     path to MzScheme DLLs (libmzgc and libmzsch), for "static" build.
-#   MZSCHEME_USE_RACKET  define to use "racket" instead of "mzsch".
-# LUA	define to path to Lua dir to get Lua support (not defined)
-#   LUA_VER	    define to version of Lua being used (51)
-#   DYNAMIC_LUA  no or yes: use yes to load the Lua DLL dynamically (yes)
-# GETTEXT	no or yes: set to yes for dynamic gettext support (yes)
-# ICONV		no or yes: set to yes for dynamic iconv support (yes)
-# MBYTE		no or yes: set to yes to include multibyte support (yes)
-# IME		no or yes: set to yes to include IME support (yes)
-#   DYNAMIC_IME no or yes: set to yes to load imm32.dll dynamically (yes)
-# OLE		no or yes: set to yes to make OLE gvim (no)
-# DEBUG		no or yes: set to yes if you wish a DEBUGging build (no)
-# CPUNR		No longer supported, use ARCH.
-# ARCH		i386 through pentium4: select -march argument to compile with
-#               (i386)
-# USEDLL	no or yes: set to yes to use the Runtime library DLL (no)
-#		For USEDLL=yes the cygwin1.dll is required to run Vim.
-#		For "no" the mingw-gcc-g++ package or the mingw64-i686-gcc-g++
-#		package is required to compile Vim.  Or set CC to gcc-3 and add
-#		-L/lib/w32api to EXTRA_LIBS.
-# POSTSCRIPT	no or yes: set to yes for PostScript printing (no)
-# FEATURES	TINY, SMALL, NORMAL, BIG or HUGE (BIG)
-# WINVER	Lowest Win32 version to support.  (0x0500)
-# CSCOPE	no or yes: to include cscope interface support (yes)
-# OPTIMIZE	SPACE, SPEED, or MAXSPEED: set optimization level (MAXSPEED)
-# NETBEANS	no or yes: to include netbeans interface support (yes when GUI
-#		is yes)
-# NBDEBUG	no or yes: to include netbeans interface debugging support (no)
-# XPM		define to path to XPM dir to get XPM image support (not defined)
-#>>>>> choose options:
-ifndef GUI
-GUI=yes
-endif
-
-ifndef FEATURES
-FEATURES = BIG
-endif
-
-ifndef GETTEXT
-GETTEXT = yes
-endif
-
-ifndef ICONV
-ICONV = yes
-endif
-
-ifndef MBYTE
-MBYTE = yes
-endif
-
-ifndef IME
-IME = yes
-endif
-
-ifndef ARCH
-ARCH = i386
-endif
+# The old Make_cyg.mak (maintained by Dan Sharp et al.) was merged into
+# Make_cyg_ming.mak.  Note: USEDLL option was removed.
+# This file contains Cygwin specific settings. Common settings are contained
+# in Make_cyg_ming.mak.
+#
+# Last updated by Ken Takata.
+# Last Change: 2014 Oct 21
 
-ifndef DIRECTX
-DIRECTX = no
-endif
 
-ifndef WINVER
-WINVER = 0x0500
-endif
+# uncomment 'PERL' if you want a perl-enabled version
+#PERL=/cygdrive/c/perl
 
-ifndef CSCOPE
-CSCOPE = yes
-endif
+# uncomment 'LUA' if you want a Lua-enabled version
+#LUA=/cygdrive/c/lua
 
-ifndef NETBEANS
-ifeq ($(GUI),yes)
-NETBEANS = yes
-endif
-endif
+# uncomment 'MZSCHEME' if you want a MzScheme-enabled version
+#MZSCHEME=/cygdrive/d/plt
 
-ifndef OPTIMIZE
-OPTIMIZE = MAXSPEED
-endif
+# uncomment 'PYTHON' if you want a python-enabled version
+#PYTHON=/cygdrive/c/python20
 
+# uncomment 'PYTHON3' if you want a python3-enabled version
+#PYTHON3=/cygdrive/c/python31
 
-# Link against the shared version of libstdc++ by default.  Set
-# STATIC_STDCPLUS to "yes" to link against static version instead.
-ifndef STATIC_STDCPLUS
-STATIC_STDCPLUS=no
-endif
+# uncomment 'TCL' if you want a Tcl-enabled version
+#TCL=/cygdrive/c/tcl
 
-### See feature.h for a list of optionals.
-### Any other defines can be included here.
+# uncomment 'RUBY' if you want a Ruby-enabled version
+#RUBY=/cygdribe/c/ruby
 
-DEFINES = -DWIN32 -DHAVE_PATHDEF -DFEAT_$(FEATURES) \
-	  -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
-ifeq ($(ARCH),x86-64)
-DEFINES+=-DMS_WIN64
-endif
-INCLUDES = -march=$(ARCH) -Iproto
 
-#>>>>> name of the compiler and linker, name of lib directory
-ifeq (yes, $(USEDLL))
-# CROSS_COMPILE is used for the gvimext DLL.
+# Use MinGW(-w64) cross compiler.
+# There are three MinGW packages in Cygwin:
+#   32-bit: mingw-gcc-g++ and mingw64-i686-gcc-g++
+#   64-bit: mingw64-x86_64-gcc-g++
+# You may also need to set 'ARCH' in Make_cyg_ming.mak.
 CROSS_COMPILE = i686-pc-mingw32-
-CC = gcc
-RC = windres
-else
-# i686-pc-mingw32-gcc, i686-w64-mingw32-gcc or gcc-3 can be used.
-CROSS_COMPILE = i686-pc-mingw32-
-CC = $(CROSS_COMPILE)gcc
-RC = $(CROSS_COMPILE)windres
-endif
-
-##############################
-# DYNAMIC_PERL=yes and no both work
-##############################
-ifdef PERL
-DEFINES += -DFEAT_PERL
-INCLUDES += -I$(PERL)/lib/CORE
-EXTRA_OBJS += $(OUTDIR)/if_perl.o
-
-ifndef DYNAMIC_PERL
-DYNAMIC_PERL = yes
-endif
-
-ifndef PERL_VER
-PERL_VER = 56
-endif
-
-ifeq (yes, $(DYNAMIC_PERL))
-DEFINES += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
-else
-EXTRA_LIBS += -L$(PERL)/lib/CORE -lperl$(PERL_VER)
-endif
-endif
-
-##############################
-# DYNAMIC_PYTHON=yes works.
-# DYNAMIC_PYTHON=no does not (unresolved externals on link).
-##############################
-ifdef PYTHON
-DEFINES += -DFEAT_PYTHON
-EXTRA_OBJS += $(OUTDIR)/if_python.o
-
-ifndef DYNAMIC_PYTHON
-DYNAMIC_PYTHON = yes
-endif
-
-ifndef PYTHON_VER
-PYTHON_VER = 22
-endif
-
-ifeq (yes, $(DYNAMIC_PYTHON))
-DEFINES += -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\"
-else
-EXTRA_LIBS += $(PYTHON)/libs/python$(PYTHON_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_PYTHON3=yes works.
-# DYNAMIC_PYTHON3=no does not (unresolved externals on link).
-##############################
-ifdef PYTHON3
-DEFINES += -DFEAT_PYTHON3
-EXTRA_OBJS += $(OUTDIR)/if_python3.o
-
-ifndef DYNAMIC_PYTHON3
-DYNAMIC_PYTHON3 = yes
-endif
-
-ifndef PYTHON3_VER
-PYTHON3_VER = 31
-endif
-
-ifeq (yes, $(DYNAMIC_PYTHON3))
-DEFINES += -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python$(PYTHON3_VER).dll\"
-else
-EXTRA_LIBS += $(PYTHON3)/libs/python$(PYTHON3_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_RUBY=yes works.
-# DYNAMIC_RUBY=no does not (process exits).
-##############################
-ifdef RUBY
-
-ifndef DYNAMIC_RUBY
-DYNAMIC_RUBY=yes
-endif
-#  Set default value
-ifndef RUBY_VER
-RUBY_VER = 16
-endif
-ifndef RUBY_VER_LONG
-RUBY_VER_LONG = 1.6
-endif
-ifndef RUBY_API_VER
-RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
-endif
-
-ifndef RUBY_PLATFORM
-ifeq ($(RUBY_VER), 16)
-RUBY_PLATFORM = i586-mswin32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
-RUBY_PLATFORM = i386-mingw32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
-RUBY_PLATFORM = x64-mingw32
-else
-RUBY_PLATFORM = i386-mswin32
-endif
-endif
-endif
-endif
-
-ifndef RUBY_INSTALL_NAME
-ifeq ($(RUBY_VER), 16)
-RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
-else
-ifeq ($(ARCH),x86-64)
-RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
-else
-RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
-endif
-endif
-endif
-
-ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
-RUBY_19_OR_LATER = 1
-endif
-
-DEFINES += -DFEAT_RUBY
-ifneq ($(findstring w64-mingw32,$(CC)),)
-# A workaround for mingw-w64
-DEFINES += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
-endif
-INCLUDES += -I$(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-ifdef RUBY_19_OR_LATER
-INCLUDES += -I$(RUBY)/include/ruby-$(RUBY_VER_LONG) -I$(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-endif
-EXTRA_OBJS += $(OUTDIR)/if_ruby.o
-
-ifeq (yes, $(DYNAMIC_RUBY))
-DEFINES += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
-DEFINES += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
-else
-EXTRA_LIBS += $(RUBY)/lib/$(RUBY_INSTALL_NAME)
-endif
-endif
-
-##############################
-# DYNAMIC_MZSCHEME=yes works
-# DYNAMIC_MZSCHEME=no works too
-##############################
-ifdef MZSCHEME
-DEFINES += -DFEAT_MZSCHEME
-INCLUDES += -I$(MZSCHEME)/include
-EXTRA_OBJS += $(OUTDIR)/if_mzsch.o
-
-ifndef DYNAMIC_MZSCHEME
-DYNAMIC_MZSCHEME = yes
-endif
-
-ifndef MZSCHEME_VER
-MZSCHEME_VER = 209_000
-endif
-
-ifndef MZSCHEME_PRECISE_GC
-MZSCHEME_PRECISE_GC=no
-endif
-
-# for version 4.x we need to generate byte-code for Scheme base
-ifndef MZSCHEME_GENERATE_BASE
-MZSCHEME_GENERATE_BASE=no
-endif
-
-ifndef MZSCHEME_USE_RACKET
-MZSCHEME_MAIN_LIB=mzsch
-else
-MZSCHEME_MAIN_LIB=racket
-endif
-
-ifeq (yes, $(DYNAMIC_MZSCHEME))
-DEFINES += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
-else
-ifndef MZSCHEME_DLLS
-MZSCHEME_DLLS = $(MZSCHEME)
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
-else
-MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
-endif
-EXTRA_LIBS += -L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)/lib $(MZSCHEME_LIB)
-endif
-ifeq (yes,$(MZSCHEME_GENERATE_BASE))
-DEFINES += -DINCLUDE_MZSCHEME_BASE
-MZ_EXTRA_DEP += mzscheme_base.c
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-DEFINES += -DMZ_PRECISE_GC
-endif
-endif
-
-##############################
-# DYNAMIC_TCL=yes and no both work.
-##############################
-ifdef TCL
-DEFINES += -DFEAT_TCL
-INCLUDES += -I$(TCL)/include
-EXTRA_OBJS += $(OUTDIR)/if_tcl.o
-
-ifndef DYNAMIC_TCL
-DYNAMIC_TCL = yes
-endif
-
-ifndef TCL_VER
-TCL_VER = 83
-endif
-
-ifeq (yes, $(DYNAMIC_TCL))
-DEFINES += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
-EXTRA_LIBS += $(TCL)/lib/tclstub$(TCL_VER).lib
-else
-EXTRA_LIBS += $(TCL)/lib/tcl$(TCL_VER).lib
-endif
-endif
-
-##############################
-# DYNAMIC_LUA=yes works.
-# DYNAMIC_LUA=no does not (unresolved externals on link).
-##############################
-ifdef LUA
-DEFINES += -DFEAT_LUA
-INCLUDES += -I$(LUA)/include
-EXTRA_OBJS += $(OUTDIR)/if_lua.o
-
-ifndef DYNAMIC_LUA
-DYNAMIC_LUA = yes
-endif
-
-ifndef LUA_VER
-LUA_VER = 51
-endif
-
-ifeq (yes, $(DYNAMIC_LUA))
-DEFINES += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
-else
-EXTRA_LIBS += $(LUA)/lib/lua$(LUA_VER).lib
-endif
-endif
-
-##############################
-ifeq (yes, $(GETTEXT))
-DEFINES += -DDYNAMIC_GETTEXT
-endif
-
-##############################
-ifeq (yes, $(ICONV))
-DEFINES += -DDYNAMIC_ICONV
-endif
-
-##############################
-ifeq (yes, $(MBYTE))
-DEFINES += -DFEAT_MBYTE
-endif
-
-##############################
-ifeq (yes, $(IME))
-DEFINES += -DFEAT_MBYTE_IME
-
-ifndef DYNAMIC_IME
-DYNAMIC_IME = yes
-endif
-
-ifeq (yes, $(DYNAMIC_IME))
-DEFINES += -DDYNAMIC_IME
-else
-EXTRA_LIBS += -limm32
-endif
-endif
-
-##############################
-ifeq (yes, $(DEBUG))
-DEFINES += -DDEBUG
-INCLUDES += -g -fstack-check
-DEBUG_SUFFIX = d
-else
-
-ifeq ($(OPTIMIZE), SIZE)
-OPTFLAG = -Os
-else
-ifeq ($(OPTIMIZE), MAXSPEED)
-OPTFLAG = -O3 -fomit-frame-pointer -freg-struct-return
-else
-OPTFLAG = -O2
-endif
-endif
-
-# A bug in the GCC <= 3.2 optimizer can cause a crash.  The
-# following option removes the problem optimization.
-OPTFLAG += -fno-strength-reduce
-
-INCLUDES += -s
-
-endif
-
-##############################
-# USEDLL=yes will build a Cygwin32 executable that relies on cygwin1.dll.
-# USEDLL=no will build a Mingw32 executable with no extra dll dependencies.
-##############################
-ifeq (yes, $(USEDLL))
-DEFINES += -D_MAX_PATH=256 -D__CYGWIN__
-endif
-
-##############################
-ifeq (yes, $(POSTSCRIPT))
-DEFINES += -DMSWINPS
-endif
-
-##############################
-ifeq (yes, $(CSCOPE))
-DEFINES += -DFEAT_CSCOPE
-EXTRA_OBJS += $(OUTDIR)/if_cscope.o
-endif
-
-##############################
-ifeq ($(GUI),yes)
-
-##############################
-ifeq (yes, $(NETBEANS))
-# Only allow NETBEANS for a GUI build.
-DEFINES += -DFEAT_NETBEANS_INTG
-EXTRA_OBJS += $(OUTDIR)/netbeans.o
-EXTRA_LIBS += -lwsock32
-
-ifeq (yes, $(NBDEBUG))
-DEFINES += -DNBDEBUG
-NBDEBUG_DEP = nbdebug.h nbdebug.c
-endif
-
-endif
-
-##############################
-ifeq (yes, $(DIRECTX))
-# Only allow DIRECTX for a GUI build.
-DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
-EXTRA_OBJS += $(OUTDIR)/gui_dwrite.o
-EXTRA_LIBS += -ld2d1 -ldwrite
-USE_STDCPLUS = yes
-endif
-
-##############################
-ifndef XPM
-ifeq ($(ARCH),i386)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i486)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i586)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i686)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),x86-64)
-XPM = xpm/x64
-endif
-endif
-ifdef XPM
-ifneq ($(XPM),no)
-# Only allow XPM for a GUI build.
-DEFINES += -DFEAT_XPM_W32
-INCLUDES += -I$(XPM)/include -I$(XPM)/../include
-EXTRA_OBJS += $(OUTDIR)/xpm_w32.o
-EXTRA_LIBS += -L$(XPM)/lib -lXpm
-endif
-endif
-
-##############################
-EXE = gvim$(DEBUG_SUFFIX).exe
-OUTDIR = gobj$(DEBUG_SUFFIX)
-DEFINES += -DFEAT_GUI_W32 -DFEAT_CLIPBOARD
-EXTRA_OBJS += $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
-EXTRA_LIBS += -mwindows -lcomctl32 -lversion
-else
-EXE = vim$(DEBUG_SUFFIX).exe
-OUTDIR = obj$(DEBUG_SUFFIX)
-LIBS += -luser32 -lgdi32 -lcomdlg32
-endif
-
-##############################
-ifeq (yes, $(OLE))
-DEFINES += -DFEAT_OLE
-EXTRA_OBJS += $(OUTDIR)/if_ole.o
-EXTRA_LIBS += -loleaut32
-USE_STDCPLUS = yes
-endif
-
-##############################
-ifneq (sh.exe, $(SHELL))
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-DEL = del
-MKDIR = mkdir
-DIRSLASH = \\
-endif
-
-##############################
-ifeq (yes, $(USE_STDCPLUS))
-ifeq (yes, $(STATIC_STDCPLUS))
-EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-EXTRA_LIBS += -lstdc++
-endif
-endif
-
-#>>>>> end of choices
-###########################################################################
-
-INCL = vim.h globals.h option.h keymap.h macros.h ascii.h term.h os_win32.h \
-       structs.h version.h
-
-CFLAGS = $(OPTFLAG) $(DEFINES) $(INCLUDES)
-
-RCFLAGS = -O coff $(DEFINES)
-
-OBJ = \
-	$(OUTDIR)/blowfish.o \
-	$(OUTDIR)/buffer.o \
-	$(OUTDIR)/charset.o \
-	$(OUTDIR)/crypt.o \
-	$(OUTDIR)/crypt_zip.o \
-	$(OUTDIR)/diff.o \
-	$(OUTDIR)/digraph.o \
-	$(OUTDIR)/edit.o \
-	$(OUTDIR)/eval.o \
-	$(OUTDIR)/ex_cmds.o \
-	$(OUTDIR)/ex_cmds2.o \
-	$(OUTDIR)/ex_docmd.o \
-	$(OUTDIR)/ex_eval.o \
-	$(OUTDIR)/ex_getln.o \
-	$(OUTDIR)/fileio.o \
-	$(OUTDIR)/fold.o \
-	$(OUTDIR)/getchar.o \
-	$(OUTDIR)/hardcopy.o \
-	$(OUTDIR)/hashtab.o \
-	$(OUTDIR)/main.o \
-	$(OUTDIR)/mark.o \
-	$(OUTDIR)/memfile.o \
-	$(OUTDIR)/memline.o \
-	$(OUTDIR)/menu.o \
-	$(OUTDIR)/message.o \
-	$(OUTDIR)/misc1.o \
-	$(OUTDIR)/misc2.o \
-	$(OUTDIR)/move.o \
-	$(OUTDIR)/mbyte.o \
-	$(OUTDIR)/normal.o \
-	$(OUTDIR)/ops.o \
-	$(OUTDIR)/option.o \
-	$(OUTDIR)/os_win32.o \
-	$(OUTDIR)/os_mswin.o \
-	$(OUTDIR)/winclip.o \
-	$(OUTDIR)/pathdef.o \
-	$(OUTDIR)/popupmnu.o \
-	$(OUTDIR)/quickfix.o \
-	$(OUTDIR)/regexp.o \
-	$(OUTDIR)/screen.o \
-	$(OUTDIR)/search.o \
-	$(OUTDIR)/sha256.o \
-	$(OUTDIR)/spell.o \
-	$(OUTDIR)/syntax.o \
-	$(OUTDIR)/tag.o \
-	$(OUTDIR)/term.o \
-	$(OUTDIR)/ui.o \
-	$(OUTDIR)/undo.o \
-	$(OUTDIR)/version.o \
-	$(OUTDIR)/vimrc.o \
-	$(OUTDIR)/window.o \
-	$(EXTRA_OBJS)
-
-all: $(EXE) xxd/xxd.exe vimrun.exe install.exe uninstal.exe GvimExt/gvimext.dll
-
-# According to the Cygwin doc 1.2 FAQ, kernel32 should not be specified for
-# linking unless calling ld directly.
-# See /usr/doc/cygwin-doc-1.2/html/faq_toc.html#TOC93 for more information.
-$(EXE): $(OUTDIR) $(OBJ)
-	$(CC) $(CFLAGS) -o $(EXE) $(OBJ) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)
-
-xxd/xxd.exe: xxd/xxd.c
-	$(MAKE) -C xxd -f Make_cyg.mak CC=$(CC) USEDLL=$(USEDLL)
-
-GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
-	$(MAKE) -C GvimExt -f Make_cyg.mak CROSS_COMPILE=$(CROSS_COMPILE)
-
-vimrun.exe: vimrun.c
-	$(CC) $(CFLAGS) -o vimrun.exe vimrun.c  $(LIBS)
-
-install.exe: dosinst.c
-	$(CC) $(CFLAGS) -o install.exe dosinst.c  $(LIBS) -luuid -lole32
-
-uninstal.exe: uninstal.c
-	$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIBS)
-
-$(OUTDIR):
-	$(MKDIR) $(OUTDIR)
-
-tags:
-	command /c ctags *.c $(INCL)
-
-clean:
-	-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
-	-rmdir $(OUTDIR)
-	-$(DEL) $(EXE) vimrun.exe install.exe uninstal.exe
-ifdef PERL
-	-$(DEL) if_perl.c
-endif
-ifdef MZSCHEME
-	-$(DEL) mzscheme_base.c
-endif
-	-$(DEL) pathdef.c
-	$(MAKE) -C xxd -f Make_cyg.mak clean
-	$(MAKE) -C GvimExt -f Make_cyg.mak clean
-
-distclean: clean
-	-$(DEL) obj$(DIRSLASH)*.o
-	-rmdir obj
-	-$(DEL) gobj$(DIRSLASH)*.o
-	-rmdir gobj
-	-$(DEL) objd$(DIRSLASH)*.o
-	-rmdir objd
-	-$(DEL) gobjd$(DIRSLASH)*.o
-	-rmdir gobjd
-	-$(DEL) *.exe
-
-###########################################################################
-
-$(OUTDIR)/%.o : %.c $(INCL)
-	$(CC) -c $(CFLAGS) $< -o $@
-
-$(OUTDIR)/ex_docmd.o:	ex_docmd.c $(INCL) ex_cmds.h
-	$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
-
-$(OUTDIR)/ex_eval.o:	ex_eval.c $(INCL) ex_cmds.h
-	$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
-
-$(OUTDIR)/gui_w32.o:	gui_w32.c gui_w48.c $(INCL)
-	$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
-
-$(OUTDIR)/gui_dwrite.o:	gui_dwrite.cpp $(INCL) gui_dwrite.h
-	$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
-
-$(OUTDIR)/if_cscope.o:	if_cscope.c $(INCL) if_cscope.h
-	$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
-
-$(OUTDIR)/if_ole.o:	if_ole.cpp $(INCL)
-	$(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o
-
-$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
-	$(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@
-
-$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
-	$(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@
-
-if_perl.c: if_perl.xs typemap
-	$(PERL)/bin/perl `cygpath -d $(PERL)/lib/ExtUtils/xsubpp` \
-		-prototypes -typemap \
-		`cygpath -d $(PERL)/lib/ExtUtils/typemap` if_perl.xs > $@
-
-$(OUTDIR)/if_perl.o:	if_perl.c $(INCL)
-ifeq (yes, $(USEDLL))
-	$(CC) -c $(CFLAGS) -I/usr/include/mingw -D__MINGW32__ if_perl.c -o $(OUTDIR)/if_perl.o
-endif
-
-$(OUTDIR)/if_ruby.o:	if_ruby.c $(INCL)
-ifeq (16, $(RUBY_VER))
-	$(CC) -c $(CFLAGS) -U_WIN32 if_ruby.c -o $(OUTDIR)/if_ruby.o
-endif
-
-$(OUTDIR)/netbeans.o:	netbeans.c $(INCL) $(NBDEBUG_DEP)
-	$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
-
-$(OUTDIR)/regexp.o:		regexp.c regexp_nfa.c $(INCL)
-	$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
-
-$(OUTDIR)/if_mzsch.o:	if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
-	$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
-
-$(OUTDIR)/vimrc.o:	vim.rc version.h gui_w32_rc.h
-	$(RC) $(RCFLAGS) vim.rc -o $(OUTDIR)/vimrc.o
-
-mzscheme_base.c:
-	$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
+#CROSS_COMPILE = i686-w64-mingw32-
+#CROSS_COMPILE = x86_64-w64-mingw32-
 
-pathdef.c: $(INCL)
-ifneq (sh.exe, $(SHELL))
-	@echo creating pathdef.c
-	@echo '/* pathdef.c */' > pathdef.c
-	@echo '#include "vim.h"' >> pathdef.c
-	@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
-	@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
-	@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
-	@echo 'char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)";' >> pathdef.c
-	@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
-	@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
-else
-	@echo creating pathdef.c
-	@echo /* pathdef.c */ > pathdef.c
-	@echo #include "vim.h" >> pathdef.c
-	@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
-	@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
-	@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
-	@echo char_u *all_lflags = (char_u *)"$(CC) -s -o $(EXE) $(LIBS) -luuid -lole32 $(EXTRA_LIBS)"; >> pathdef.c
-	@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
-	@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
-endif
 
+# Do not change this.
+UNDER_CYGWIN = yes
+include Make_cyg_ming.mak
diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
new file mode 100644
index 0000000000..e4764c52bf
--- /dev/null
+++ b/src/Make_cyg_ming.mak
@@ -0,0 +1,847 @@
+# Makefile for VIM on Win32 (Cygwin and MinGW)
+#
+# This file contains common part for Cygwin and MinGW and it is included
+# from Make_cyg.mak and Make_ming.mak.
+#
+# Info at http://www.mingw.org
+# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
+# Also requires GNU make, which you can download from the same sites.
+# Get missing libraries from http://gnuwin32.sf.net.
+#
+# Tested on Win32 NT 4 and Win95.
+#
+# To make everything, just 'make -f Make_ming.mak'.
+# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
+# After a run, you can 'make -f Make_ming.mak clean' to clean up.
+#
+# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
+# it's just run out of memory or something.  Run again, and it will continue
+# with 'xxd'.
+#
+# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
+# using the excellent UPX compressor:
+#     http://upx.sourceforge.net/
+# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
+#     http://www.matcode.com/mpress.htm
+#
+# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
+# Updated 2014 Oct 13.
+
+#>>>>> choose options:
+# set to yes for a debug build
+DEBUG=no
+# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
+OPTIMIZE=MAXSPEED
+# set to yes to make gvim, no for vim
+GUI=yes
+# set to yes if you want to use DirectWrite (DirectX)
+# MinGW-w64 is needed, and ARCH should be set to i686 or x86-64.
+DIRECTX=no
+# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
+# Set to TINY to make minimal version (few features).
+FEATURES=BIG
+# Set to one of i386, i486, i586, i686 as the minimum target processor.
+# For amd64/x64 architecture set ARCH=x86-64 .
+ARCH=i386
+# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
+CROSS=no
+# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
+#ICONV="."
+ICONV=yes
+GETTEXT=yes
+# Set to yes to include multibyte support.
+MBYTE=yes
+# Set to yes to include IME support.
+IME=yes
+DYNAMIC_IME=yes
+# Set to yes to enable writing a postscript file with :hardcopy.
+POSTSCRIPT=no
+# Set to yes to enable OLE support.
+OLE=no
+# Set the default $(WINVER) to make it work with pre-Win2k.
+ifndef WINVER
+WINVER = 0x0500
+endif
+# Set to yes to enable Cscope support.
+CSCOPE=yes
+# Set to yes to enable Netbeans support.
+NETBEANS=$(GUI)
+
+
+# Link against the shared version of libstdc++ by default.  Set
+# STATIC_STDCPLUS to "yes" to link against static version instead.
+ifndef STATIC_STDCPLUS
+STATIC_STDCPLUS=no
+endif
+
+# If the user doesn't want gettext, undefine it.
+ifeq (no, $(GETTEXT))
+GETTEXT=
+endif
+# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
+# Uncomment the first line and one of the following three if you want Native Language
+# Support.  You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
+# Franco Bez <franco.bez@gmx.de>.  It may be found at
+# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
+# Tested with mingw32 with GCC-2.95.2 on Win98
+# Updated 2001 Jun 9
+#GETTEXT=c:/gettext.win32.msvcrt
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
+#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
+SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
+# Alternatively, if you uncomment the two following lines, you get a "safe" version
+# without linking the safe_gettext_dll.o object file.
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#GETTEXT_DYNAMIC=gnu_gettext.dll
+INTLPATH=$(GETTEXT)/lib/mingw32
+INTLLIB=gnu_gettext
+
+# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
+# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
+# uncomment the following, but I can't build a static version with them, ?-(|
+#GETTEXT=c:/gettext-0.10.37-20010430
+#STATIC_GETTEXT=USE_STATIC_GETTEXT
+#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
+#INTLPATH=$(GETTEXT)/lib
+#INTLLIB=intl
+
+#	Perl interface:
+#	  PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
+#	  PERL_VER=[Perl version, eg 56, 58, 510] (default is 56)
+ifdef PERL
+ifndef PERL_VER
+PERL_VER=56
+endif
+ifndef DYNAMIC_PERL
+DYNAMIC_PERL=yes
+endif
+# on Linux, for cross-compile, it's here:
+#PERLLIB=/home/ron/ActivePerl/lib
+# on NT, it's here:
+PERLEXE=$(PERL)/bin/perl
+PERLLIB=$(PERL)/lib
+PERLLIBS=$(PERLLIB)/Core
+ifeq ($(UNDER_CYGWIN),yes)
+PERLTYPEMAP:=$(shell cygpath -m $(PERLLIB)/ExtUtils/typemap)
+XSUBPPTRY:=$(shell cygpath -m $(PERLLIB)/ExtUtils/xsubpp)
+else
+PERLTYPEMAP=$(PERLLIB)/ExtUtils/typemap
+XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
+endif
+XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'")
+ifeq "$(XSUBPP_EXISTS)" ""
+XSUBPP=$(PERLEXE) "$(XSUBPPTRY)"
+else
+XSUBPP=xsubpp
+endif
+endif
+
+#	Lua interface:
+#	  LUA=[Path to Lua directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_LUA=yes (to load the Lua DLL dynamically)
+#	  LUA_VER=[Lua version, eg 51, 52] (default is 51)
+ifdef LUA
+ifndef DYNAMIC_LUA
+DYNAMIC_LUA=yes
+endif
+
+ifndef LUA_VER
+LUA_VER=51
+endif
+
+ifeq (no,$(DYNAMIC_LUA))
+LUA_LIB = -L$(LUA)/lib -llua
+endif
+
+endif
+
+#	MzScheme interface:
+#	  MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
+#	  MZSCHEME_VER=[MzScheme version] (default is 205_000)
+#	  MZSCHEME_DEBUG=no
+ifdef MZSCHEME
+ifndef DYNAMIC_MZSCHEME
+DYNAMIC_MZSCHEME=yes
+endif
+
+ifndef MZSCHEME_VER
+MZSCHEME_VER=205_000
+endif
+
+ifndef MZSCHEME_PRECISE_GC
+MZSCHEME_PRECISE_GC=no
+endif
+
+# for version 4.x we need to generate byte-code for Scheme base
+ifndef MZSCHEME_GENERATE_BASE
+MZSCHEME_GENERATE_BASE=no
+endif
+
+ifndef MZSCHEME_USE_RACKET
+MZSCHEME_MAIN_LIB=mzsch
+else
+MZSCHEME_MAIN_LIB=racket
+endif
+
+ifeq (no,$(DYNAMIC_MZSCHEME))
+ifeq (yes,$(MZSCHEME_PRECISE_GC))
+MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
+else
+MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
+endif
+# the modern MinGW can dynamically link to dlls directly.
+# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
+ifndef MZSCHEME_DLLS
+MZSCHEME_DLLS=$(MZSCHEME)
+endif
+MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
+endif
+
+endif
+
+#	Python interface:
+#	  PYTHON=[Path to Python directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
+#	  PYTHON_VER=[Python version, eg 22, 23, ..., 27] (default is 22)
+ifdef PYTHON
+ifndef DYNAMIC_PYTHON
+DYNAMIC_PYTHON=yes
+endif
+
+ifndef PYTHON_VER
+PYTHON_VER=22
+endif
+
+ifeq (no,$(DYNAMIC_PYTHON))
+PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
+endif
+# my include files are in 'win32inc' on Linux, and 'include' in the standard
+# NT distro (ActiveState)
+ifeq ($(CROSS),no)
+PYTHONINC=-I $(PYTHON)/include
+else
+PYTHONINC=-I $(PYTHON)/win32inc
+endif
+endif
+
+#	Python3 interface:
+#	  PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
+#	  PYTHON3_VER=[Python3 version, eg 31, 32] (default is 31)
+ifdef PYTHON3
+ifndef DYNAMIC_PYTHON3
+DYNAMIC_PYTHON3=yes
+endif
+
+ifndef PYTHON3_VER
+PYTHON3_VER=31
+endif
+
+ifeq (no,$(DYNAMIC_PYTHON3))
+PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
+endif
+
+ifeq ($(CROSS),no)
+PYTHON3INC=-I $(PYTHON3)/include
+else
+PYTHON3INC=-I $(PYTHON3)/win32inc
+endif
+endif
+
+#	TCL interface:
+#	  TCL=[Path to TCL directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
+#	  TCL_VER=[TCL version, eg 83, 84] (default is 83)
+ifdef TCL
+ifndef DYNAMIC_TCL
+DYNAMIC_TCL=yes
+endif
+ifndef TCL_VER
+TCL_VER = 83
+endif
+TCLINC += -I$(TCL)/include
+endif
+
+
+#	Ruby interface:
+#	  RUBY=[Path to Ruby directory] (Set inside Make_cyg.mak or Make_ming.mak)
+#	  DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
+#	  RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
+#	  RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
+#	    You must set RUBY_VER_LONG when changing RUBY_VER.
+#	    RUBY_API_VER is derived from RUBY_VER_LONG.
+#	    Note: If you use Ruby 1.9.3, set as follows:
+#	      RUBY_VER=19
+#	      RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
+ifdef RUBY
+ifndef DYNAMIC_RUBY
+DYNAMIC_RUBY=yes
+endif
+#  Set default value
+ifndef RUBY_VER
+RUBY_VER = 18
+endif
+ifndef RUBY_VER_LONG
+RUBY_VER_LONG = 1.8
+endif
+ifndef RUBY_API_VER
+RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
+endif
+
+ifndef RUBY_PLATFORM
+ifeq ($(RUBY_VER), 16)
+RUBY_PLATFORM = i586-mswin32
+else
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
+RUBY_PLATFORM = i386-mingw32
+else
+ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
+RUBY_PLATFORM = x64-mingw32
+else
+RUBY_PLATFORM = i386-mswin32
+endif
+endif
+endif
+endif
+
+ifndef RUBY_INSTALL_NAME
+ifeq ($(RUBY_VER), 16)
+RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
+else
+ifeq ($(ARCH),x86-64)
+RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
+else
+RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
+endif
+endif
+endif
+
+ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
+RUBY_19_OR_LATER = 1
+endif
+
+RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+ifdef RUBY_19_OR_LATER
+RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
+endif
+ifeq (no, $(DYNAMIC_RUBY))
+RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
+endif
+
+endif # RUBY
+
+# See feature.h for a list of options.
+# Any other defines can be included here.
+DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
+DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
+	-DHAVE_PATHDEF -DFEAT_$(FEATURES)
+ifeq ($(ARCH),x86-64)
+DEFINES+=-DMS_WIN64
+endif
+ifeq ($(CROSS),yes)
+# cross-compiler prefix:
+ifndef CROSS_COMPILE
+CROSS_COMPILE = i586-pc-mingw32msvc-
+endif
+DEL = rm
+MKDIR = mkdir -p
+DIRSLASH = /
+else
+# normal (Windows) compilation:
+ifndef CROSS_COMPILE
+CROSS_COMPILE =
+endif
+ifneq (sh.exe, $(SHELL))
+DEL = rm
+MKDIR = mkdir -p
+DIRSLASH = /
+else
+DEL = del
+MKDIR = mkdir
+DIRSLASH = \\
+endif
+endif
+CC := $(CROSS_COMPILE)gcc
+CXX := $(CROSS_COMPILE)g++
+WINDRES := $(CROSS_COMPILE)windres
+WINDRES_CC = $(CC)
+
+#>>>>> end of choices
+###########################################################################
+
+CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
+WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
+EXTRA_LIBS =
+
+ifdef GETTEXT
+DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
+GETTEXTINCLUDE = $(GETTEXT)/include
+GETTEXTLIB = $(INTLPATH)
+ifeq (yes, $(GETTEXT))
+DEFINES += -DDYNAMIC_GETTEXT
+else
+ifdef DYNAMIC_GETTEXT
+DEFINES += -D$(DYNAMIC_GETTEXT)
+ifdef GETTEXT_DYNAMIC
+DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
+endif
+endif
+endif
+endif
+
+ifdef PERL
+CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
+ifeq (yes, $(DYNAMIC_PERL))
+CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
+EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
+endif
+endif
+
+ifdef LUA
+CFLAGS += -I$(LUA)/include -I$(LUA) -DFEAT_LUA
+ifeq (yes, $(DYNAMIC_LUA))
+CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
+endif
+endif
+
+ifdef MZSCHEME
+CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
+ifeq (yes, $(DYNAMIC_MZSCHEME))
+CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
+endif
+ifeq (yes, "$(MZSCHEME_DEBUG)")
+CFLAGS += -DMZSCHEME_FORCE_GC
+endif
+endif
+
+ifdef RUBY
+CFLAGS += -DFEAT_RUBY $(RUBYINC)
+ifeq (yes, $(DYNAMIC_RUBY))
+CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
+CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
+endif
+ifneq ($(findstring w64-mingw32,$(CC)),)
+# A workaround for MinGW-w64
+CFLAGS += -DHAVE_STRUCT_TIMESPEC -DHAVE_STRUCT_TIMEZONE
+endif
+endif
+
+ifdef PYTHON
+CFLAGS += -DFEAT_PYTHON 
+ifeq (yes, $(DYNAMIC_PYTHON))
+CFLAGS += -DDYNAMIC_PYTHON
+endif
+endif
+
+ifdef PYTHON3 
+CFLAGS += -DFEAT_PYTHON3 
+ifeq (yes, $(DYNAMIC_PYTHON3))
+CFLAGS += -DDYNAMIC_PYTHON3 
+endif
+endif
+
+ifdef TCL
+CFLAGS += -DFEAT_TCL $(TCLINC)
+ifeq (yes, $(DYNAMIC_TCL))
+CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
+endif
+endif
+
+ifeq ($(POSTSCRIPT),yes)
+DEFINES += -DMSWINPS
+endif
+
+ifeq (yes, $(OLE))
+DEFINES += -DFEAT_OLE
+endif
+
+ifeq ($(CSCOPE),yes)
+DEFINES += -DFEAT_CSCOPE
+endif
+
+ifeq ($(NETBEANS),yes)
+# Only allow NETBEANS for a GUI build.
+ifeq (yes, $(GUI))
+DEFINES += -DFEAT_NETBEANS_INTG
+
+ifeq ($(NBDEBUG), yes)
+DEFINES += -DNBDEBUG
+NBDEBUG_INCL = nbdebug.h
+NBDEBUG_SRC = nbdebug.c
+endif
+endif
+endif
+
+# DirectWrite (DirectX)
+ifeq ($(DIRECTX),yes)
+# Only allow DirectWrite for a GUI build.
+ifeq (yes, $(GUI))
+DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
+endif
+endif
+
+# Only allow XPM for a GUI build.
+ifeq (yes, $(GUI))
+
+ifndef XPM
+ifeq ($(ARCH),i386)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i486)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i586)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),i686)
+XPM = xpm/x86
+endif
+ifeq ($(ARCH),x86-64)
+XPM = xpm/x64
+endif
+endif
+ifdef XPM
+ifneq ($(XPM),no)
+CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
+endif
+endif
+
+endif
+
+ifeq ($(DEBUG),yes)
+CFLAGS += -g -fstack-check
+DEBUG_SUFFIX=d
+else
+ifeq ($(OPTIMIZE), SIZE)
+CFLAGS += -Os
+else
+ifeq ($(OPTIMIZE), MAXSPEED)
+CFLAGS += -O3
+CFLAGS += -fomit-frame-pointer -freg-struct-return
+else  # SPEED
+CFLAGS += -O2
+endif
+endif
+CFLAGS += -s
+endif
+
+LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion
+GUIOBJ =  $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
+OBJ = \
+	$(OUTDIR)/blowfish.o \
+	$(OUTDIR)/buffer.o \
+	$(OUTDIR)/charset.o \
+	$(OUTDIR)/crypt.o \
+	$(OUTDIR)/crypt_zip.o \
+	$(OUTDIR)/diff.o \
+	$(OUTDIR)/digraph.o \
+	$(OUTDIR)/edit.o \
+	$(OUTDIR)/eval.o \
+	$(OUTDIR)/ex_cmds.o \
+	$(OUTDIR)/ex_cmds2.o \
+	$(OUTDIR)/ex_docmd.o \
+	$(OUTDIR)/ex_eval.o \
+	$(OUTDIR)/ex_getln.o \
+	$(OUTDIR)/fileio.o \
+	$(OUTDIR)/fold.o \
+	$(OUTDIR)/getchar.o \
+	$(OUTDIR)/hardcopy.o \
+	$(OUTDIR)/hashtab.o \
+	$(OUTDIR)/main.o \
+	$(OUTDIR)/mark.o \
+	$(OUTDIR)/memfile.o \
+	$(OUTDIR)/memline.o \
+	$(OUTDIR)/menu.o \
+	$(OUTDIR)/message.o \
+	$(OUTDIR)/misc1.o \
+	$(OUTDIR)/misc2.o \
+	$(OUTDIR)/move.o \
+	$(OUTDIR)/mbyte.o \
+	$(OUTDIR)/normal.o \
+	$(OUTDIR)/ops.o \
+	$(OUTDIR)/option.o \
+	$(OUTDIR)/os_win32.o \
+	$(OUTDIR)/os_mswin.o \
+	$(OUTDIR)/winclip.o \
+	$(OUTDIR)/pathdef.o \
+	$(OUTDIR)/popupmnu.o \
+	$(OUTDIR)/quickfix.o \
+	$(OUTDIR)/regexp.o \
+	$(OUTDIR)/screen.o \
+	$(OUTDIR)/search.o \
+	$(OUTDIR)/sha256.o \
+	$(OUTDIR)/spell.o \
+	$(OUTDIR)/syntax.o \
+	$(OUTDIR)/tag.o \
+	$(OUTDIR)/term.o \
+	$(OUTDIR)/ui.o \
+	$(OUTDIR)/undo.o \
+	$(OUTDIR)/version.o \
+	$(OUTDIR)/vimrc.o \
+	$(OUTDIR)/window.o
+
+ifdef PERL
+OBJ += $(OUTDIR)/if_perl.o
+endif
+ifdef LUA
+OBJ += $(OUTDIR)/if_lua.o
+endif
+ifdef MZSCHEME
+OBJ += $(OUTDIR)/if_mzsch.o
+MZSCHEME_INCL = if_mzsch.h
+ifeq (yes,$(MZSCHEME_GENERATE_BASE))
+CFLAGS += -DINCLUDE_MZSCHEME_BASE
+MZ_EXTRA_DEP += mzscheme_base.c
+endif
+ifeq (yes,$(MZSCHEME_PRECISE_GC))
+CFLAGS += -DMZ_PRECISE_GC
+endif
+endif
+ifdef PYTHON
+OBJ += $(OUTDIR)/if_python.o
+endif
+ifdef PYTHON3
+OBJ += $(OUTDIR)/if_python3.o
+endif
+ifdef RUBY
+OBJ += $(OUTDIR)/if_ruby.o
+endif
+ifdef TCL
+OBJ += $(OUTDIR)/if_tcl.o
+endif
+ifeq ($(CSCOPE),yes)
+OBJ += $(OUTDIR)/if_cscope.o
+endif
+ifeq ($(NETBEANS),yes)
+# Only allow NETBEANS for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/netbeans.o
+LIB += -lwsock32
+endif
+endif
+ifeq ($(DIRECTX),yes)
+# Only allow DIRECTX for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/gui_dwrite.o
+LIB += -ld2d1 -ldwrite
+USE_STDCPLUS = yes
+endif
+endif
+ifneq ($(XPM),no)
+# Only allow XPM for a GUI build.
+ifeq (yes, $(GUI))
+OBJ += $(OUTDIR)/xpm_w32.o
+# You'll need libXpm.a from http://gnuwin32.sf.net
+LIB += -L$(XPM)/lib -lXpm
+endif
+endif
+
+
+ifdef MZSCHEME
+MZSCHEME_SUFFIX = Z
+endif
+
+ifeq ($(GUI),yes)
+TARGET := gvim$(DEBUG_SUFFIX).exe
+DEFINES += $(DEF_GUI)
+OBJ += $(GUIOBJ)
+LFLAGS += -mwindows
+OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
+else
+TARGET := vim$(DEBUG_SUFFIX).exe
+OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
+endif
+
+ifdef GETTEXT
+ifneq (yes, $(GETTEXT))
+CFLAGS += -I$(GETTEXTINCLUDE)
+ifndef STATIC_GETTEXT
+LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
+ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
+OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
+endif
+else
+LIB += -L$(GETTEXTLIB) -lintl
+endif
+endif
+endif
+
+ifdef PERL
+ifeq (no, $(DYNAMIC_PERL))
+LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
+endif
+endif
+
+ifdef TCL
+LIB += -L$(TCL)/lib
+ifeq (yes, $(DYNAMIC_TCL))
+LIB += -ltclstub$(TCL_VER)
+else
+LIB += -ltcl$(TCL_VER)
+endif
+endif
+
+ifeq (yes, $(OLE))
+LIB += -loleaut32
+OBJ += $(OUTDIR)/if_ole.o
+USE_STDCPLUS = yes
+endif
+
+ifeq (yes, $(MBYTE))
+DEFINES += -DFEAT_MBYTE
+endif
+
+ifeq (yes, $(IME))
+DEFINES += -DFEAT_MBYTE_IME
+ifeq (yes, $(DYNAMIC_IME))
+DEFINES += -DDYNAMIC_IME
+else
+LIB += -limm32
+endif
+endif
+
+ifdef ICONV
+ifneq (yes, $(ICONV))
+LIB += -L$(ICONV)
+CFLAGS += -I$(ICONV)
+endif
+DEFINES+=-DDYNAMIC_ICONV
+endif
+
+ifeq (yes, $(USE_STDCPLUS))
+ifeq (yes, $(STATIC_STDCPLUS))
+LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+else
+LIB += -lstdc++
+endif
+endif
+
+all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
+
+vimrun.exe: vimrun.c
+	$(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
+
+install.exe: dosinst.c
+	$(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
+
+uninstal.exe: uninstal.c
+	$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
+
+$(TARGET): $(OUTDIR) $(OBJ)
+	$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
+
+upx: exes
+	upx gvim.exe
+	upx vim.exe
+
+mpress: exes
+	mpress gvim.exe
+	mpress vim.exe
+
+xxd/xxd.exe: xxd/xxd.c
+	$(MAKE) -C xxd -f Make_ming.mak CC='$(CC)'
+
+GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
+	$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS)
+
+clean:
+	-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
+	-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
+	-rmdir $(OUTDIR)
+	-$(DEL) *.exe
+	-$(DEL) pathdef.c
+ifdef PERL
+	-$(DEL) if_perl.c
+endif
+ifdef MZSCHEME
+	-$(DEL) mzscheme_base.c
+endif
+	$(MAKE) -C GvimExt -f Make_ming.mak clean
+	$(MAKE) -C xxd -f Make_ming.mak clean
+
+###########################################################################
+INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
+	structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
+	gui.h
+
+$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
+	$(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
+
+$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
+	$(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@
+
+$(OUTDIR)/%.o : %.c $(INCL)
+	$(CC) -c $(CFLAGS) $< -o $@
+
+$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
+	$(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
+	    --input-format=rc --output-format=coff -i vim.rc -o $@
+
+$(OUTDIR):
+	$(MKDIR) $(OUTDIR)
+
+$(OUTDIR)/ex_docmd.o:	ex_docmd.c $(INCL) ex_cmds.h
+	$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
+
+$(OUTDIR)/ex_eval.o:	ex_eval.c $(INCL) ex_cmds.h
+	$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
+
+$(OUTDIR)/gui_w32.o:	gui_w32.c gui_w48.c $(INCL)
+	$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
+
+$(OUTDIR)/gui_dwrite.o:	gui_dwrite.cpp $(INCL) gui_dwrite.h
+	$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
+
+$(OUTDIR)/if_cscope.o:	if_cscope.c $(INCL) if_cscope.h
+	$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
+
+# Remove -D__IID_DEFINED__ for newer versions of the w32api
+$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
+	$(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
+
+$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
+ifeq (16, $(RUBY))
+	$(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
+endif
+
+if_perl.c: if_perl.xs typemap
+	$(XSUBPP) -prototypes -typemap \
+	     "$(PERLTYPEMAP)" if_perl.xs > $@
+
+$(OUTDIR)/netbeans.o:	netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
+	$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
+
+$(OUTDIR)/regexp.o:		regexp.c regexp_nfa.c $(INCL)
+	$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
+
+$(OUTDIR)/if_mzsch.o:	if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
+	$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
+
+mzscheme_base.c:
+	$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
+
+pathdef.c: $(INCL)
+ifneq (sh.exe, $(SHELL))
+	@echo creating pathdef.c
+	@echo '/* pathdef.c */' > pathdef.c
+	@echo '#include "vim.h"' >> pathdef.c
+	@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
+	@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
+	@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
+	@echo 'char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
+	@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
+	@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
+else
+	@echo creating pathdef.c
+	@echo /* pathdef.c */ > pathdef.c
+	@echo #include "vim.h" >> pathdef.c
+	@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
+	@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
+	@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
+	@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
+	@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
+	@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
+endif
diff --git a/src/Make_ming.mak b/src/Make_ming.mak
index 19b4c2fe3d..9ed1a7000a 100644
--- a/src/Make_ming.mak
+++ b/src/Make_ming.mak
@@ -1,193 +1,27 @@
-# Makefile for VIM on Win32
 #
-# Info at http://www.mingw.org
-# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
-# Also requires GNU make, which you can download from the same sites.
-# Get missing libraries from http://gnuwin32.sf.net.
+# Makefile for VIM on Win32, using MinGW
 #
-# Tested on Win32 NT 4 and Win95.
+# Also read INSTALLpc.txt!
 #
-# To make everything, just 'make -f Make_ming.mak'.
-# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
-# After a run, you can 'make -f Make_ming.mak clean' to clean up.
+# The old Make_ming.mak (maintained by Ron Aaron et al.) was merged into
+# Make_cyg_ming.mak.
+# This file contains MinGW specific settings. Common settings are contained
+# in Make_cyg_ming.mak.
 #
-# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
-# it's just run out of memory or something.  Run again, and it will continue
-# with 'xxd'.
-#
-# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
-# using the excellent UPX compressor:
-#     http://upx.sourceforge.net/
-# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
-#     http://www.matcode.com/mpress.htm
-#
-# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
-# Updated 2014 Oct 13.
-
-#>>>>> choose options:
-# set to yes for a debug build
-DEBUG=no
-# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
-OPTIMIZE=MAXSPEED
-# set to yes to make gvim, no for vim
-GUI=yes
-# set to yes if you want to use DirectWrite (DirectX)
-DIRECTX=no
-# FEATURES=[TINY | SMALL  | NORMAL | BIG | HUGE]
-# Set to TINY to make minimal version (few features).
-FEATURES=BIG
-# Set to one of i386, i486, i586, i686 as the minimum target processor.
-# For amd64/x64 architecture set ARCH=x86-64 .
-ARCH=i386
-# Set to yes to cross-compile from unix; no=native Windows.
-CROSS=no
-# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
-#ICONV="."
-ICONV=yes
-GETTEXT=yes
-# Set to yes to include multibyte support.
-MBYTE=yes
-# Set to yes to include IME support.
-IME=yes
-DYNAMIC_IME=yes
-# Set to yes to enable writing a postscript file with :hardcopy.
-POSTSCRIPT=no
-# Set to yes to enable OLE support.
-OLE=no
-# Set the default $(WINVER) to make it work with pre-Win2k.
-ifndef WINVER
-WINVER = 0x0500
-endif
-# Set to yes to enable Cscope support.
-CSCOPE=yes
-# Set to yes to enable Netbeans support.
-NETBEANS=$(GUI)
-
-
-# Link against the shared version of libstdc++ by default.  Set
-# STATIC_STDCPLUS to "yes" to link against static version instead.
-ifndef STATIC_STDCPLUS
-STATIC_STDCPLUS=no
-endif
-
-# If the user doesn't want gettext, undefine it.
-ifeq (no, $(GETTEXT))
-GETTEXT=
-endif
-# Added by E.F. Amatria <eferna1@platea.ptic.mec.es> 2001 Feb 23
-# Uncomment the first line and one of the following three if you want Native Language
-# Support.  You'll need gnu_gettext.win32, a MINGW32 Windows PORT of gettext by
-# Franco Bez <franco.bez@gmx.de>.  It may be found at
-# http://home.a-city.de/franco.bez/gettext/gettext_win32_en.html
-# Tested with mingw32 with GCC-2.95.2 on Win98
-# Updated 2001 Jun 9
-#GETTEXT=c:/gettext.win32.msvcrt
-#STATIC_GETTEXT=USE_STATIC_GETTEXT
-#DYNAMIC_GETTEXT=USE_GETTEXT_DLL
-#DYNAMIC_GETTEXT=USE_SAFE_GETTEXT_DLL
-SAFE_GETTEXT_DLL_OBJ = $(GETTEXT)/src/safe_gettext_dll/safe_gettext_dll.o
-# Alternatively, if you uncomment the two following lines, you get a "safe" version
-# without linking the safe_gettext_dll.o object file.
-#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
-#GETTEXT_DYNAMIC=gnu_gettext.dll
-INTLPATH=$(GETTEXT)/lib/mingw32
-INTLLIB=gnu_gettext
+# Last updated by Ken Takata.
+# Last Change: 2014 Oct 21
 
-# If you are using gettext-0.10.35 from http://sourceforge.net/projects/gettext
-# or gettext-0.10.37 from http://sourceforge.net/projects/mingwrep/
-# uncomment the following, but I can't build a static version with them, ?-(|
-#GETTEXT=c:/gettext-0.10.37-20010430
-#STATIC_GETTEXT=USE_STATIC_GETTEXT
-#DYNAMIC_GETTEXT=DYNAMIC_GETTEXT
-#INTLPATH=$(GETTEXT)/lib
-#INTLLIB=intl
 
 # uncomment 'PERL' if you want a perl-enabled version
-#PERL=C:/perl
-ifdef PERL
-ifndef PERL_VER
-PERL_VER=56
-endif
-ifndef DYNAMIC_PERL
-DYNAMIC_PERL=yes
-endif
-# on Linux, for cross-compile, it's here:
-#PERLLIB=/home/ron/ActivePerl/lib
-# on NT, it's here:
-PERLLIB=$(PERL)/lib
-PERLLIBS=$(PERLLIB)/Core
-XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
-XSUBPP_EXISTS=$(shell perl -e "print 1 unless -e '$(XSUBPPTRY)'")
-ifeq "$(XSUBPP_EXISTS)" ""
-XSUBPP=perl $(XSUBPPTRY)
-else
-XSUBPP=xsubpp
-endif
-endif
+#PERL=c:/perl
 
 # uncomment 'LUA' if you want a Lua-enabled version
-#LUA=/usr/local
-ifdef LUA
-ifndef DYNAMIC_LUA
-DYNAMIC_LUA=yes
-endif
-
-ifndef LUA_VER
-LUA_VER=51
-endif
-
-ifeq (no,$(DYNAMIC_LUA))
-LUA_LIB = -L$(LUA)/lib -llua
-endif
-
-endif
+#LUA=c:/lua
 
 # uncomment 'MZSCHEME' if you want a MzScheme-enabled version
 #MZSCHEME=d:/plt
-ifdef MZSCHEME
-ifndef DYNAMIC_MZSCHEME
-DYNAMIC_MZSCHEME=yes
-endif
-
-ifndef MZSCHEME_VER
-MZSCHEME_VER=205_000
-endif
-
-ifndef MZSCHEME_PRECISE_GC
-MZSCHEME_PRECISE_GC=no
-endif
-
-# for version 4.x we need to generate byte-code for Scheme base
-ifndef MZSCHEME_GENERATE_BASE
-MZSCHEME_GENERATE_BASE=no
-endif
 
-ifndef MZSCHEME_USE_RACKET
-MZSCHEME_MAIN_LIB=mzsch
-else
-MZSCHEME_MAIN_LIB=racket
-endif
-
-ifeq (no,$(DYNAMIC_MZSCHEME))
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-MZSCHEME_LIB=-l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER)
-else
-MZSCHEME_LIB = -l$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER) -lmzgc$(MZSCHEME_VER)
-endif
-# the modern MinGW can dynamically link to dlls directly.
-# point MZSCHEME_DLLS to where you put libmzschXXXXXXX.dll and libgcXXXXXXX.dll
-ifndef MZSCHEME_DLLS
-MZSCHEME_DLLS=$(MZSCHEME)
-endif
-MZSCHEME_LIBDIR=-L$(MZSCHEME_DLLS) -L$(MZSCHEME_DLLS)\lib
-endif
-
-endif
-
-# Python support -- works with the ActiveState python 2.0 release (and others
-# too, probably)
-#
-# uncomment 'PYTHON' to make python-enabled version
+# uncomment 'PYTHON' if you want a python-enabled version
 # Put the path to the python distro here.  If cross compiling from Linux, you
 # will also need to convert the header files to unix instead of dos format:
 #   for fil in *.h ; do vim -e -c 'set ff=unix|w|q' $fil
@@ -200,631 +34,16 @@ endif
 # on my NT box, it's here:
 #PYTHON=c:/python20
 
-ifdef PYTHON
-ifndef DYNAMIC_PYTHON
-DYNAMIC_PYTHON=yes
-endif
-
-ifndef PYTHON_VER
-PYTHON_VER=22
-endif
-
-ifeq (no,$(DYNAMIC_PYTHON))
-PYTHONLIB=-L$(PYTHON)/libs -lpython$(PYTHON_VER)
-endif
-# my include files are in 'win32inc' on Linux, and 'include' in the standard
-# NT distro (ActiveState)
-ifeq ($(CROSS),no)
-PYTHONINC=-I $(PYTHON)/include
-else
-PYTHONINC=-I $(PYTHON)/win32inc
-endif
-endif
-
-#PYTHON3: See comment for Python 2 above
-
-ifdef PYTHON3
-ifndef DYNAMIC_PYTHON3
-DYNAMIC_PYTHON3=yes
-endif
-
-ifndef PYTHON3_VER
-PYTHON3_VER=31
-endif
-
-ifeq (no,$(DYNAMIC_PYTHON3))
-PYTHON3LIB=-L$(PYTHON3)/libs -lPYTHON$(PYTHON3_VER)
-endif
-
-ifeq ($(CROSS),no)
-PYTHON3INC=-I $(PYTHON3)/include
-else
-PYTHON3INC=-I $(PYTHON3)/win32inc
-endif
-endif
+# uncomment 'PYTHON3' if you want a python3-enabled version
+#PYTHON3=c:/python31
 
-#	TCL interface:
-#	  TCL=[Path to TCL directory]
-#	  DYNAMIC_TCL=yes (to load the TCL DLL dynamically)
-#	  TCL_VER=[TCL version, eg 83, 84] (default is 83)
+# uncomment 'TCL' if you want a Tcl-enabled version
 #TCL=c:/tcl
-ifdef TCL
-ifndef DYNAMIC_TCL
-DYNAMIC_TCL=yes
-endif
-ifndef TCL_VER
-TCL_VER = 83
-endif
-TCLINC += -I$(TCL)/include
-endif
 
-
-#	Ruby interface:
-#	  RUBY=[Path to Ruby directory]
-#	  DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
-#	  RUBY_VER=[Ruby version, eg 16, 17] (default is 16)
-#	  RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.6)
-#	    You must set RUBY_VER_LONG when changing RUBY_VER.
-#	    You must set RUBY_API_VER version to RUBY_VER_LONG.
-#	    Don't set ruby API version to RUBY_VER like 191.
+# uncomment 'RUBY' if you want a Ruby-enabled version
 #RUBY=c:/ruby
-ifdef RUBY
-ifndef DYNAMIC_RUBY
-DYNAMIC_RUBY=yes
-endif
-#  Set default value
-ifndef RUBY_VER
-RUBY_VER = 16
-endif
-ifndef RUBY_VER_LONG
-RUBY_VER_LONG = 1.6
-endif
-ifndef RUBY_API_VER
-RUBY_API_VER = $(subst .,,$(RUBY_VER_LONG))
-endif
-
-ifndef RUBY_PLATFORM
-ifeq ($(RUBY_VER), 16)
-RUBY_PLATFORM = i586-mswin32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
-RUBY_PLATFORM = i386-mingw32
-else
-ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/x64-mingw32),)
-RUBY_PLATFORM = x64-mingw32
-else
-RUBY_PLATFORM = i386-mswin32
-endif
-endif
-endif
-endif
-
-ifndef RUBY_INSTALL_NAME
-ifeq ($(RUBY_VER), 16)
-RUBY_INSTALL_NAME = mswin32-ruby$(RUBY_API_VER)
-else
-ifeq ($(ARCH),x86-64)
-RUBY_INSTALL_NAME = x64-msvcrt-ruby$(RUBY_API_VER)
-else
-RUBY_INSTALL_NAME = msvcrt-ruby$(RUBY_API_VER)
-endif
-endif
-endif
-
-ifeq (19, $(word 1,$(sort 19 $(RUBY_VER))))
-RUBY_19_OR_LATER = 1
-endif
-
-RUBYINC = -I $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-ifdef RUBY_19_OR_LATER
-RUBYINC += -I $(RUBY)/include/ruby-$(RUBY_VER_LONG) -I $(RUBY)/include/ruby-$(RUBY_VER_LONG)/$(RUBY_PLATFORM)
-endif
-ifeq (no, $(DYNAMIC_RUBY))
-RUBYLIB = -L$(RUBY)/lib -l$(RUBY_INSTALL_NAME)
-endif
-
-endif # RUBY
-
-# See feature.h for a list of options.
-# Any other defines can be included here.
-DEF_GUI=-DFEAT_GUI_W32 -DFEAT_CLIPBOARD
-DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
-	-DHAVE_PATHDEF -DFEAT_$(FEATURES)
-ifeq ($(ARCH),x86-64)
-DEFINES+=-DMS_WIN64
-endif
-ifeq ($(CROSS),yes)
-# cross-compiler prefix:
-CROSS_COMPILE = i586-pc-mingw32msvc-
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-# normal (Windows) compilation:
-CROSS_COMPILE =
-ifneq (sh.exe, $(SHELL))
-DEL = rm
-MKDIR = mkdir -p
-DIRSLASH = /
-else
-DEL = del
-MKDIR = mkdir
-DIRSLASH = \\
-endif
-endif
-CC := $(CROSS_COMPILE)gcc
-WINDRES := $(CROSS_COMPILE)windres
-WINDRES_CC = $(CC)
-
-#>>>>> end of choices
-###########################################################################
-
-CFLAGS = -Iproto $(DEFINES) -pipe -w -march=$(ARCH) -Wall
-WINDRES_FLAGS = --preprocessor="$(WINDRES_CC) -E -xc" -DRC_INVOKED
-EXTRA_LIBS =
-
-ifdef GETTEXT
-DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
-GETTEXTINCLUDE = $(GETTEXT)/include
-GETTEXTLIB = $(INTLPATH)
-ifeq (yes, $(GETTEXT))
-DEFINES += -DDYNAMIC_GETTEXT
-else
-ifdef DYNAMIC_GETTEXT
-DEFINES += -D$(DYNAMIC_GETTEXT)
-ifdef GETTEXT_DYNAMIC
-DEFINES += -DGETTEXT_DYNAMIC -DGETTEXT_DLL=\"$(GETTEXT_DYNAMIC)\"
-endif
-endif
-endif
-endif
-
-ifdef PERL
-CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
-ifeq (yes, $(DYNAMIC_PERL))
-CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
-EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
-endif
-endif
-
-ifdef LUA
-CFLAGS += -I$(LUA)/include -DFEAT_LUA
-ifeq (yes, $(DYNAMIC_LUA))
-CFLAGS += -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua$(LUA_VER).dll\"
-endif
-endif
-
-ifdef MZSCHEME
-CFLAGS += -I$(MZSCHEME)/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=\"$(MZSCHEME)/collects\"
-ifeq (yes, $(DYNAMIC_MZSCHEME))
-CFLAGS += -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
-endif
-ifeq (yes, "$(MZSCHEME_DEBUG)")
-CFLAGS += -DMZSCHEME_FORCE_GC
-endif
-endif
-
-ifdef RUBY
-CFLAGS += -DFEAT_RUBY $(RUBYINC)
-ifeq (yes, $(DYNAMIC_RUBY))
-CFLAGS += -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"$(RUBY_INSTALL_NAME).dll\"
-CFLAGS += -DDYNAMIC_RUBY_VER=$(RUBY_VER)
-endif
-endif
-
-ifdef PYTHON
-CFLAGS += -DFEAT_PYTHON 
-ifeq (yes, $(DYNAMIC_PYTHON))
-CFLAGS += -DDYNAMIC_PYTHON
-endif
-endif
-
-ifdef PYTHON3 
-CFLAGS += -DFEAT_PYTHON3 
-ifeq (yes, $(DYNAMIC_PYTHON3))
-CFLAGS += -DDYNAMIC_PYTHON3 
-endif
-endif
-
-ifdef TCL
-CFLAGS += -DFEAT_TCL $(TCLINC)
-ifeq (yes, $(DYNAMIC_TCL))
-CFLAGS += -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl$(TCL_VER).dll\"
-endif
-endif
-
-ifeq ($(POSTSCRIPT),yes)
-DEFINES += -DMSWINPS
-endif
-
-ifeq (yes, $(OLE))
-DEFINES += -DFEAT_OLE
-endif
-
-ifeq ($(CSCOPE),yes)
-DEFINES += -DFEAT_CSCOPE
-endif
-
-ifeq ($(NETBEANS),yes)
-# Only allow NETBEANS for a GUI build.
-ifeq (yes, $(GUI))
-DEFINES += -DFEAT_NETBEANS_INTG
-
-ifeq ($(NBDEBUG), yes)
-DEFINES += -DNBDEBUG
-NBDEBUG_INCL = nbdebug.h
-NBDEBUG_SRC = nbdebug.c
-endif
-endif
-endif
-
-# DirectWrite (DirectX)
-ifeq ($(DIRECTX),yes)
-# Only allow DirectWrite for a GUI build.
-ifeq (yes, $(GUI))
-DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
-endif
-endif
-
-# Only allow XPM for a GUI build.
-ifeq (yes, $(GUI))
-
-ifndef XPM
-ifeq ($(ARCH),i386)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i486)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i586)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),i686)
-XPM = xpm/x86
-endif
-ifeq ($(ARCH),x86-64)
-XPM = xpm/x64
-endif
-endif
-ifdef XPM
-ifneq ($(XPM),no)
-CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
-endif
-endif
-
-endif
-
-ifeq ($(DEBUG),yes)
-CFLAGS += -g -fstack-check
-DEBUG_SUFFIX=d
-else
-ifeq ($(OPTIMIZE), SIZE)
-CFLAGS += -Os
-else
-ifeq ($(OPTIMIZE), MAXSPEED)
-CFLAGS += -O3
-CFLAGS += -fomit-frame-pointer -freg-struct-return
-else  # SPEED
-CFLAGS += -O2
-endif
-endif
-CFLAGS += -s
-endif
-
-LIB = -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lversion
-GUIOBJ =  $(OUTDIR)/gui.o $(OUTDIR)/gui_w32.o $(OUTDIR)/gui_beval.o $(OUTDIR)/os_w32exe.o
-OBJ = \
-	$(OUTDIR)/blowfish.o \
-	$(OUTDIR)/buffer.o \
-	$(OUTDIR)/charset.o \
-	$(OUTDIR)/crypt.o \
-	$(OUTDIR)/crypt_zip.o \
-	$(OUTDIR)/diff.o \
-	$(OUTDIR)/digraph.o \
-	$(OUTDIR)/edit.o \
-	$(OUTDIR)/eval.o \
-	$(OUTDIR)/ex_cmds.o \
-	$(OUTDIR)/ex_cmds2.o \
-	$(OUTDIR)/ex_docmd.o \
-	$(OUTDIR)/ex_eval.o \
-	$(OUTDIR)/ex_getln.o \
-	$(OUTDIR)/fileio.o \
-	$(OUTDIR)/fold.o \
-	$(OUTDIR)/getchar.o \
-	$(OUTDIR)/hardcopy.o \
-	$(OUTDIR)/hashtab.o \
-	$(OUTDIR)/main.o \
-	$(OUTDIR)/mark.o \
-	$(OUTDIR)/memfile.o \
-	$(OUTDIR)/memline.o \
-	$(OUTDIR)/menu.o \
-	$(OUTDIR)/message.o \
-	$(OUTDIR)/misc1.o \
-	$(OUTDIR)/misc2.o \
-	$(OUTDIR)/move.o \
-	$(OUTDIR)/mbyte.o \
-	$(OUTDIR)/normal.o \
-	$(OUTDIR)/ops.o \
-	$(OUTDIR)/option.o \
-	$(OUTDIR)/os_win32.o \
-	$(OUTDIR)/os_mswin.o \
-	$(OUTDIR)/winclip.o \
-	$(OUTDIR)/pathdef.o \
-	$(OUTDIR)/popupmnu.o \
-	$(OUTDIR)/quickfix.o \
-	$(OUTDIR)/regexp.o \
-	$(OUTDIR)/screen.o \
-	$(OUTDIR)/search.o \
-	$(OUTDIR)/sha256.o \
-	$(OUTDIR)/spell.o \
-	$(OUTDIR)/syntax.o \
-	$(OUTDIR)/tag.o \
-	$(OUTDIR)/term.o \
-	$(OUTDIR)/ui.o \
-	$(OUTDIR)/undo.o \
-	$(OUTDIR)/version.o \
-	$(OUTDIR)/vimrc.o \
-	$(OUTDIR)/window.o
-
-ifdef PERL
-OBJ += $(OUTDIR)/if_perl.o
-endif
-ifdef LUA
-OBJ += $(OUTDIR)/if_lua.o
-endif
-ifdef MZSCHEME
-OBJ += $(OUTDIR)/if_mzsch.o
-MZSCHEME_INCL = if_mzsch.h
-ifeq (yes,$(MZSCHEME_GENERATE_BASE))
-CFLAGS += -DINCLUDE_MZSCHEME_BASE
-MZ_EXTRA_DEP += mzscheme_base.c
-endif
-ifeq (yes,$(MZSCHEME_PRECISE_GC))
-CFLAGS += -DMZ_PRECISE_GC
-endif
-endif
-ifdef PYTHON
-OBJ += $(OUTDIR)/if_python.o
-endif
-ifdef PYTHON3
-OBJ += $(OUTDIR)/if_python3.o
-endif
-ifdef RUBY
-OBJ += $(OUTDIR)/if_ruby.o
-endif
-ifdef TCL
-OBJ += $(OUTDIR)/if_tcl.o
-endif
-ifeq ($(CSCOPE),yes)
-OBJ += $(OUTDIR)/if_cscope.o
-endif
-ifeq ($(NETBEANS),yes)
-# Only allow NETBEANS for a GUI build.
-ifeq (yes, $(GUI))
-OBJ += $(OUTDIR)/netbeans.o
-LIB += -lwsock32
-endif
-endif
-ifeq ($(DIRECTX),yes)
-# Only allow DIRECTX for a GUI build.
-ifeq (yes, $(GUI))
-OBJ += $(OUTDIR)/gui_dwrite.o
-LIB += -ld2d1 -ldwrite
-USE_STDCPLUS = yes
-endif
-endif
-ifneq ($(XPM),no)
-# Only allow XPM for a GUI build.
-ifeq (yes, $(GUI))
-OBJ += $(OUTDIR)/xpm_w32.o
-# You'll need libXpm.a from http://gnuwin32.sf.net
-LIB += -L$(XPM)/lib -lXpm
-endif
-endif
-
-
-ifdef MZSCHEME
-MZSCHEME_SUFFIX = Z
-endif
-
-ifeq ($(GUI),yes)
-TARGET := gvim$(DEBUG_SUFFIX).exe
-DEFINES += $(DEF_GUI)
-OBJ += $(GUIOBJ)
-LFLAGS += -mwindows
-OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
-else
-TARGET := vim$(DEBUG_SUFFIX).exe
-OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
-endif
-
-ifdef GETTEXT
-ifneq (yes, $(GETTEXT))
-CFLAGS += -I$(GETTEXTINCLUDE)
-ifndef STATIC_GETTEXT
-LIB += -L$(GETTEXTLIB) -l$(INTLLIB)
-ifeq (USE_SAFE_GETTEXT_DLL, $(DYNAMIC_GETTEXT))
-OBJ+=$(SAFE_GETTEXT_DLL_OBJ)
-endif
-else
-LIB += -L$(GETTEXTLIB) -lintl
-endif
-endif
-endif
-
-ifdef PERL
-ifeq (no, $(DYNAMIC_PERL))
-LIB += -L$(PERLLIBS) -lperl$(PERL_VER)
-endif
-endif
-
-ifdef TCL
-LIB += -L$(TCL)/lib
-ifeq (yes, $(DYNAMIC_TCL))
-LIB += -ltclstub$(TCL_VER)
-else
-LIB += -ltcl$(TCL_VER)
-endif
-endif
-
-ifeq (yes, $(OLE))
-LIB += -loleaut32
-OBJ += $(OUTDIR)/if_ole.o
-USE_STDCPLUS = yes
-endif
-
-ifeq (yes, $(MBYTE))
-DEFINES += -DFEAT_MBYTE
-endif
-
-ifeq (yes, $(IME))
-DEFINES += -DFEAT_MBYTE_IME
-ifeq (yes, $(DYNAMIC_IME))
-DEFINES += -DDYNAMIC_IME
-else
-LIB += -limm32
-endif
-endif
-
-ifdef ICONV
-ifneq (yes, $(ICONV))
-LIB += -L$(ICONV)
-CFLAGS += -I$(ICONV)
-endif
-DEFINES+=-DDYNAMIC_ICONV
-endif
-
-ifeq (yes, $(USE_STDCPLUS))
-ifeq (yes, $(STATIC_STDCPLUS))
-LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
-else
-LIB += -lstdc++
-endif
-endif
-
-all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
-
-vimrun.exe: vimrun.c
-	$(CC) $(CFLAGS) -o vimrun.exe vimrun.c $(LIB)
-
-install.exe: dosinst.c
-	$(CC) $(CFLAGS) -o install.exe dosinst.c $(LIB) -lole32 -luuid
-
-uninstal.exe: uninstal.c
-	$(CC) $(CFLAGS) -o uninstal.exe uninstal.c $(LIB)
-
-$(TARGET): $(OUTDIR) $(OBJ)
-	$(CC) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
-
-upx: exes
-	upx gvim.exe
-	upx vim.exe
-
-mpress: exes
-	mpress gvim.exe
-	mpress vim.exe
-
-xxd/xxd.exe: xxd/xxd.c
-	$(MAKE) -C xxd -f Make_ming.mak CC=$(CC)
-
-GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h
-	$(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE)
-
-clean:
-	-$(DEL) $(OUTDIR)$(DIRSLASH)*.o
-	-$(DEL) $(OUTDIR)$(DIRSLASH)*.res
-	-rmdir $(OUTDIR)
-	-$(DEL) *.exe
-	-$(DEL) pathdef.c
-ifdef PERL
-	-$(DEL) if_perl.c
-endif
-ifdef MZSCHEME
-	-$(DEL) mzscheme_base.c
-endif
-	$(MAKE) -C GvimExt -f Make_ming.mak clean
-	$(MAKE) -C xxd -f Make_ming.mak clean
-
-###########################################################################
-INCL = vim.h feature.h os_win32.h os_dos.h ascii.h keymap.h term.h macros.h \
-	structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \
-	gui.h
-
-$(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL)
-	$(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@
-
-$(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL)
-	$(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@
-
-$(OUTDIR)/%.o : %.c $(INCL)
-	$(CC) -c $(CFLAGS) $< -o $@
-
-$(OUTDIR)/vimrc.o: vim.rc version.h gui_w32_rc.h
-	$(WINDRES) $(WINDRES_FLAGS) $(DEFINES) \
-	    --input-format=rc --output-format=coff -i vim.rc -o $@
-
-$(OUTDIR):
-	$(MKDIR) $(OUTDIR)
-
-$(OUTDIR)/ex_docmd.o:	ex_docmd.c $(INCL) ex_cmds.h
-	$(CC) -c $(CFLAGS) ex_docmd.c -o $(OUTDIR)/ex_docmd.o
-
-$(OUTDIR)/ex_eval.o:	ex_eval.c $(INCL) ex_cmds.h
-	$(CC) -c $(CFLAGS) ex_eval.c -o $(OUTDIR)/ex_eval.o
-
-$(OUTDIR)/gui_w32.o:	gui_w32.c gui_w48.c $(INCL)
-	$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
-
-$(OUTDIR)/gui_dwrite.o:	gui_dwrite.cpp $(INCL) gui_dwrite.h
-	$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
-
-$(OUTDIR)/if_cscope.o:	if_cscope.c $(INCL) if_cscope.h
-	$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o
-
-# Remove -D__IID_DEFINED__ for newer versions of the w32api
-$(OUTDIR)/if_ole.o: if_ole.cpp $(INCL)
-	$(CC) $(CFLAGS) -c -o $(OUTDIR)/if_ole.o if_ole.cpp
-
-$(OUTDIR)/if_ruby.o: if_ruby.c $(INCL)
-ifeq (16, $(RUBY))
-	$(CC) $(CFLAGS) -U_WIN32 -c -o $(OUTDIR)/if_ruby.o if_ruby.c
-endif
-
-if_perl.c: if_perl.xs typemap
-	$(XSUBPP) -prototypes -typemap \
-	     $(PERLLIB)/ExtUtils/typemap if_perl.xs > $@
-
-$(OUTDIR)/netbeans.o:	netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
-	$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
-
-$(OUTDIR)/regexp.o:		regexp.c regexp_nfa.c $(INCL)
-	$(CC) -c $(CFLAGS) regexp.c -o $(OUTDIR)/regexp.o
-
-$(OUTDIR)/if_mzsch.o:	if_mzsch.c $(INCL) if_mzsch.h $(MZ_EXTRA_DEP)
-	$(CC) -c $(CFLAGS) if_mzsch.c -o $(OUTDIR)/if_mzsch.o
 
-mzscheme_base.c:
-	$(MZSCHEME)/mzc --c-mods mzscheme_base.c ++lib scheme/base
 
-pathdef.c: $(INCL)
-ifneq (sh.exe, $(SHELL))
-	@echo creating pathdef.c
-	@echo '/* pathdef.c */' > pathdef.c
-	@echo '#include "vim.h"' >> pathdef.c
-	@echo 'char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)";' >> pathdef.c
-	@echo 'char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)";' >> pathdef.c
-	@echo 'char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)";' >> pathdef.c
-	@echo 'char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)";' >> pathdef.c
-	@echo 'char_u *compiled_user = (char_u *)"$(USERNAME)";' >> pathdef.c
-	@echo 'char_u *compiled_sys = (char_u *)"$(USERDOMAIN)";' >> pathdef.c
-else
-	@echo creating pathdef.c
-	@echo /* pathdef.c */ > pathdef.c
-	@echo #include "vim.h" >> pathdef.c
-	@echo char_u *default_vim_dir = (char_u *)"$(VIMRCLOC)"; >> pathdef.c
-	@echo char_u *default_vimruntime_dir = (char_u *)"$(VIMRUNTIMEDIR)"; >> pathdef.c
-	@echo char_u *all_cflags = (char_u *)"$(CC) $(CFLAGS)"; >> pathdef.c
-	@echo char_u *all_lflags = (char_u *)"$(CC) $(CFLAGS) $(LFLAGS) -o $(TARGET) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)"; >> pathdef.c
-	@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> pathdef.c
-	@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> pathdef.c
-endif
+# Do not change this.
+UNDER_CYGWIN = no
+include Make_cyg_ming.mak
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index 31bcd68440..f7517574cb 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -50,13 +50,14 @@
 #	Perl interface:
 #	  PERL=[Path to Perl directory]
 #	  DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
-#	  PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x), etc]
+#	  PERL_VER=[Perl version, in the form 55 (5.005), 56 (5.6.x),
+#		    510 (5.10.x), etc]
 #	  (default is 56)
 #
 #	Python interface:
 #	  PYTHON=[Path to Python directory]
 #	  DYNAMIC_PYTHON=yes (to load the Python DLL dynamically)
-#	  PYTHON_VER=[Python version, eg 15, 20]  (default is 22)
+#	  PYTHON_VER=[Python version, eg 22, 23, ..., 27]  (default is 22)
 #
 #	Python3 interface:
 #	  PYTHON3=[Path to Python3 directory]
@@ -66,11 +67,13 @@
 #	Ruby interface:
 #	  RUBY=[Path to Ruby directory]
 #	  DYNAMIC_RUBY=yes (to load the Ruby DLL dynamically)
-#	  RUBY_VER=[Ruby version, eg 16, 17] (default is 18)
-#	  RUBY_VER_LONG=[Ruby version, eg 1.6, 1.7] (default is 1.8)
+#	  RUBY_VER=[Ruby version, eg 18, 19, 20] (default is 18)
+#	  RUBY_VER_LONG=[Ruby version, eg 1.8, 1.9.1, 2.0.0] (default is 1.8)
 #	    You must set RUBY_VER_LONG when change RUBY_VER.
-#	    You must set RUBY_API_VER to RUBY_VER_LONG.
-#	    Don't set ruby API version to RUBY_VER like 191.
+#	    RUBY_API_VER is derived from RUBY_VER_LONG.
+#	    Note: If you use Ruby 1.9.3, set as follows:
+#	      RUBY_VER=19
+#	      RUBY_VER_LONG=1.9.1 (not 1.9.3, because the API version is 1.9.1.)
 #
 #	Tcl interface:
 #	  TCL=[Path to Tcl directory]
diff --git a/src/version.c b/src/version.c
index 4b75a58a51..c399dd60a7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    496,
 /**/
     495,
 /**/

From 2fa69e6ce7d50cb9ffae04c04e5e1ad562775265 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 13:53:32 +0100
Subject: [PATCH 236/473] Added tag v7-4-496 for changeset 112c80234ce3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 78735f509f..937374b23c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3218,3 +3218,4 @@ df92c2b2a1795c8b0a43f2faf3a50b4b4a359773 v7-4-490
 a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 85d8cde3b432ae627382e1f2222aa8368f5837b8 v7-4-494
 0079791cbbeaaad9ff4391097c2f7896114d6022 v7-4-495
+112c80234ce3815b2c7d1c27ad21aa885d2776f3 v7-4-496

From 0bbff4056776ac20072e0d3e314148c80546efbb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 14:27:36 +0100
Subject: [PATCH 237/473] updated for version 7.4.497 Problem:    With some
 regexp patterns the NFA engine uses many states and 	    becomes very slow.
  To the user it looks like Vim freezes. Solution:   When the number of states
 reaches a limit fall back to the old 	    engine. (Christian Brabandt)

---
 Filelist                          |   3 +
 runtime/doc/options.txt           |   4 +
 src/Makefile                      |   3 +
 src/regexp.c                      | 138 ++++++++++++++++++++++++------
 src/regexp.h                      |  26 ++++--
 src/regexp_nfa.c                  |  35 +++++---
 src/testdir/Make_dos.mak          |   9 ++
 src/testdir/Make_ming.mak         |  11 +++
 src/testdir/Make_os2.mak          |  11 +++
 src/testdir/Makefile              |  15 +++-
 src/testdir/bench_re_freeze.in    |  13 +++
 src/testdir/bench_re_freeze.vim   |  13 +++
 src/testdir/samples/re.freeze.txt |   6 ++
 src/version.c                     |   2 +
 14 files changed, 244 insertions(+), 45 deletions(-)
 create mode 100644 src/testdir/bench_re_freeze.in
 create mode 100644 src/testdir/bench_re_freeze.vim
 create mode 100644 src/testdir/samples/re.freeze.txt

diff --git a/Filelist b/Filelist
index fd145bd16a..d8d9ecb59c 100644
--- a/Filelist
+++ b/Filelist
@@ -102,6 +102,9 @@ SRC_ALL =	\
 		src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \
 		src/testdir/python_after/*.py \
 		src/testdir/python_before/*.py \
+		src/testdir/bench*.in \
+		src/testdir/bench*.vim \
+		src/testdir/samples.*.txt \
 		src/proto.h \
 		src/proto/blowfish.pro \
 		src/proto/buffer.pro \
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index b50711c698..534ef449f8 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5626,6 +5626,10 @@ A jump table for the options with a short description can be found at |Q_op|.
 	Note that when using the NFA engine and the pattern contains something
 	that is not supported the pattern will not match.  This is only useful
 	for debugging the regexp engine.
+	Using automatic selection enables Vim to switch the engine, if the
+	default engine becomes too costly.  E.g., when the NFA engine uses too
+	many states.  This should prevent Vim from hanging on a combination of
+	a complex pattern with long text.
 
 		*'relativenumber'* *'rnu'* *'norelativenumber'* *'nornu'*
 'relativenumber' 'rnu'	boolean	(default off)
diff --git a/src/Makefile b/src/Makefile
index 64691a39bc..cfdca44fcd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1879,6 +1879,9 @@ test check:
 	cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
 	$(MAKE) -f Makefile unittest
 
+benchmark:
+	cd testdir; $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+
 unittesttargets:
 	$(MAKE) -f Makefile $(UNITTEST_TARGETS)
 
diff --git a/src/regexp.c b/src/regexp.c
index f19e139710..6e5655a995 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -8011,13 +8011,10 @@ static regengine_T bt_regengine =
     bt_regcomp,
     bt_regfree,
     bt_regexec_nl,
-    bt_regexec_multi
-#ifdef DEBUG
-    ,(char_u *)""
-#endif
+    bt_regexec_multi,
+    (char_u *)""
 };
 
-
 #include "regexp_nfa.c"
 
 static regengine_T nfa_regengine =
@@ -8025,18 +8022,14 @@ static regengine_T nfa_regengine =
     nfa_regcomp,
     nfa_regfree,
     nfa_regexec_nl,
-    nfa_regexec_multi
-#ifdef DEBUG
-    ,(char_u *)""
-#endif
+    nfa_regexec_multi,
+    (char_u *)""
 };
 
 /* Which regexp engine to use? Needed for vim_regcomp().
  * Must match with 'regexpengine'. */
 static int regexp_engine = 0;
-#define	    AUTOMATIC_ENGINE	0
-#define	    BACKTRACKING_ENGINE	1
-#define	    NFA_ENGINE		2
+
 #ifdef DEBUG
 static char_u regname[][30] = {
 		    "AUTOMATIC Regexp Engine",
@@ -8083,10 +8076,8 @@ vim_regcomp(expr_arg, re_flags)
 	    regexp_engine = AUTOMATIC_ENGINE;
 	}
     }
-#ifdef DEBUG
     bt_regengine.expr = expr;
     nfa_regengine.expr = expr;
-#endif
 
     /*
      * First try the NFA engine, unless backtracking was requested.
@@ -8096,7 +8087,8 @@ vim_regcomp(expr_arg, re_flags)
     else
 	prog = bt_regengine.regcomp(expr, re_flags);
 
-    if (prog == NULL)	    /* error compiling regexp with initial engine */
+    /* Check for error compiling regexp with initial engine. */
+    if (prog == NULL)
     {
 #ifdef BT_REGEXP_DEBUG_LOG
 	if (regexp_engine != BACKTRACKING_ENGINE)   /* debugging log for NFA */
@@ -8114,13 +8106,27 @@ vim_regcomp(expr_arg, re_flags)
 	}
 #endif
 	/*
-	 * If the NFA engine failed, the backtracking engine won't work either.
+	 * If the NFA engine failed, try the backtracking engine.
+	 * Disabled for now, both engines fail on the same patterns.
+	 * Re-enable when regcomp() fails when the pattern would work better
+	 * with the other engine.
 	 *
 	if (regexp_engine == AUTOMATIC_ENGINE)
+	{
 	    prog = bt_regengine.regcomp(expr, re_flags);
+	    regexp_engine == BACKTRACKING_ENGINE;
+	}
 	 */
     }
 
+    if (prog != NULL)
+    {
+	/* Store the info needed to call regcomp() again when the engine turns
+	 * out to be very slow when executing it. */
+	prog->re_engine = regexp_engine;
+	prog->re_flags  = re_flags;
+    }
+
     return prog;
 }
 
@@ -8135,20 +8141,75 @@ vim_regfree(prog)
 	prog->engine->regfree(prog);
 }
 
+#ifdef FEAT_EVAL
+static void report_re_switch __ARGS((char_u *pat));
+
+    static void
+report_re_switch(pat)
+    char_u *pat;
+{
+    if (p_verbose > 0)
+    {
+	verbose_enter();
+	MSG_PUTS(_("Switching to backtracking RE engine for pattern: "));
+	MSG_PUTS(pat);
+	verbose_leave();
+    }
+}
+#endif
+
+static int vim_regexec_both __ARGS((regmatch_T *rmp, char_u *line, colnr_T col, int nl));
+
 /*
  * Match a regexp against a string.
  * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
  * Uses curbuf for line count and 'iskeyword'.
+ * When "nl" is TRUE consider a "\n" in "line" to be a line break.
  *
  * Return TRUE if there is a match, FALSE if not.
  */
+    static int
+vim_regexec_both(rmp, line, col, nl)
+    regmatch_T	*rmp;
+    char_u	*line;  /* string to match against */
+    colnr_T	col;    /* column to start looking for match */
+    int		nl;
+{
+    int result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
+
+    /* NFA engine aborted because it's very slow. */
+    if (rmp->regprog->re_engine == AUTOMATIC_ENGINE
+					       && result == NFA_TOO_EXPENSIVE)
+    {
+	int    save_p_re = p_re;
+	int    re_flags = rmp->regprog->re_flags;
+	char_u *pat = vim_strsave(((nfa_regprog_T *)rmp->regprog)->pattern);
+
+	p_re = BACKTRACKING_ENGINE;
+	vim_regfree(rmp->regprog);
+	if (pat != NULL)
+	{
+#ifdef FEAT_EVAL
+	    report_re_switch(pat);
+#endif
+	    rmp->regprog = vim_regcomp(pat, re_flags);
+	    if (rmp->regprog != NULL)
+		result = rmp->regprog->engine->regexec_nl(rmp, line, col, nl);
+	    vim_free(pat);
+	}
+
+	p_re = save_p_re;
+    }
+    return result;
+}
+
     int
 vim_regexec(rmp, line, col)
-    regmatch_T *rmp;
-    char_u      *line;  /* string to match against */
-    colnr_T     col;    /* column to start looking for match */
+    regmatch_T	*rmp;
+    char_u	*line;
+    colnr_T	col;
 {
-    return rmp->regprog->engine->regexec_nl(rmp, line, col, FALSE);
+    return vim_regexec_both(rmp, line, col, FALSE);
 }
 
 #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \
@@ -8158,11 +8219,11 @@ vim_regexec(rmp, line, col)
  */
     int
 vim_regexec_nl(rmp, line, col)
-    regmatch_T *rmp;
-    char_u *line;
-    colnr_T col;
+    regmatch_T	*rmp;
+    char_u	*line;
+    colnr_T	col;
 {
-    return rmp->regprog->engine->regexec_nl(rmp, line, col, TRUE);
+    return vim_regexec_both(rmp, line, col, TRUE);
 }
 #endif
 
@@ -8183,5 +8244,32 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
     colnr_T     col;            /* column to start looking for match */
     proftime_T	*tm;		/* timeout limit or NULL */
 {
-    return rmp->regprog->engine->regexec_multi(rmp, win, buf, lnum, col, tm);
+    int result = rmp->regprog->engine->regexec_multi(
+						rmp, win, buf, lnum, col, tm);
+
+    /* NFA engine aborted because it's very slow. */
+    if (rmp->regprog->re_engine == AUTOMATIC_ENGINE
+					       && result == NFA_TOO_EXPENSIVE)
+    {
+	int    save_p_re = p_re;
+	int    re_flags = rmp->regprog->re_flags;
+	char_u *pat = vim_strsave(((nfa_regprog_T *)rmp->regprog)->pattern);
+
+	p_re = BACKTRACKING_ENGINE;
+	vim_regfree(rmp->regprog);
+	if (pat != NULL)
+	{
+#ifdef FEAT_EVAL
+	    report_re_switch(pat);
+#endif
+	    rmp->regprog = vim_regcomp(pat, re_flags);
+	    if (rmp->regprog != NULL)
+		result = rmp->regprog->engine->regexec_multi(
+						rmp, win, buf, lnum, col, tm);
+	    vim_free(pat);
+	}
+	p_re = save_p_re;
+    }
+
+    return result;
 }
diff --git a/src/regexp.h b/src/regexp.h
index cd619daf41..6617cd2372 100644
--- a/src/regexp.h
+++ b/src/regexp.h
@@ -27,6 +27,18 @@
  */
 #define NFA_MAX_BRACES 20
 
+/*
+ * In the NFA engine: how many states are allowed
+ */
+#define NFA_MAX_STATES 100000
+#define NFA_TOO_EXPENSIVE -1
+
+/* Which regexp engine to use? Needed for vim_regcomp().
+ * Must match with 'regexpengine'. */
+#define	    AUTOMATIC_ENGINE	0
+#define	    BACKTRACKING_ENGINE	1
+#define	    NFA_ENGINE		2
+
 typedef struct regengine regengine_T;
 
 /*
@@ -38,6 +50,8 @@ typedef struct regprog
 {
     regengine_T		*engine;
     unsigned		regflags;
+    unsigned		re_engine;   /* automatic, backtracking or nfa engine */
+    unsigned		re_flags;    /* second argument for vim_regcomp() */
 } regprog_T;
 
 /*
@@ -47,9 +61,11 @@ typedef struct regprog
  */
 typedef struct
 {
-    /* These two members implement regprog_T */
+    /* These four members implement regprog_T */
     regengine_T		*engine;
     unsigned		regflags;
+    unsigned		re_engine;
+    unsigned		re_flags;    /* second argument for vim_regcomp() */
 
     int			regstart;
     char_u		reganch;
@@ -81,9 +97,11 @@ struct nfa_state
  */
 typedef struct
 {
-    /* These two members implement regprog_T */
+    /* These three members implement regprog_T */
     regengine_T		*engine;
     unsigned		regflags;
+    unsigned		re_engine;
+    unsigned		re_flags;    /* second argument for vim_regcomp() */
 
     nfa_state_T		*start;		/* points into state[] */
 
@@ -96,9 +114,7 @@ typedef struct
 #ifdef FEAT_SYN_HL
     int			reghasz;
 #endif
-#ifdef DEBUG
     char_u		*pattern;
-#endif
     int			nsubexp;	/* number of () */
     int			nstate;
     nfa_state_T		state[1];	/* actually longer.. */
@@ -151,9 +167,7 @@ struct regengine
     void	(*regfree)(regprog_T *);
     int		(*regexec_nl)(regmatch_T*, char_u*, colnr_T, int);
     long	(*regexec_multi)(regmmatch_T*, win_T*, buf_T*, linenr_T, colnr_T, proftime_T*);
-#ifdef DEBUG
     char_u	*expr;
-#endif
 };
 
 #endif	/* _REGEXP_H */
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 37635662bc..91316094b5 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5522,6 +5522,13 @@ nfa_regmatch(prog, start, submatch, m)
 	nextlist->n = 0;	    /* clear nextlist */
 	nextlist->has_pim = FALSE;
 	++nfa_listid;
+	if (prog->re_engine == AUTOMATIC_ENGINE && nfa_listid >= NFA_MAX_STATES)
+	{
+	    /* too many states, retry with old engine */
+	    nfa_match = NFA_TOO_EXPENSIVE;
+	    goto theend;
+	}
+
 	thislist->id = nfa_listid;
 	nextlist->id = nfa_listid + 1;
 
@@ -5704,6 +5711,11 @@ nfa_regmatch(prog, start, submatch, m)
 			 */
 			result = recursive_regmatch(t->state, NULL, prog,
 						       submatch, m, &listids);
+			if (result == NFA_TOO_EXPENSIVE)
+			{
+			    nfa_match = result;
+			    goto theend;
+			}
 
 			/* for \@! and \@<! it is a match when the result is
 			 * FALSE */
@@ -5817,6 +5829,11 @@ nfa_regmatch(prog, start, submatch, m)
 		/* First try matching the pattern. */
 		result = recursive_regmatch(t->state, NULL, prog,
 						       submatch, m, &listids);
+		if (result == NFA_TOO_EXPENSIVE)
+		{
+		    nfa_match = result;
+		    goto theend;
+		}
 		if (result)
 		{
 		    int bytelen;
@@ -6760,6 +6777,7 @@ nfa_regtry(prog, col)
     int		i;
     regsubs_T	subs, m;
     nfa_state_T	*start = prog->start;
+    int		result;
 #ifdef ENABLE_LOG
     FILE	*f;
 #endif
@@ -6791,8 +6809,11 @@ nfa_regtry(prog, col)
     clear_sub(&m.synt);
 #endif
 
-    if (nfa_regmatch(prog, start, &subs, &m) == FALSE)
+    result = nfa_regmatch(prog, start, &subs, &m);
+    if (result == FALSE)
 	return 0;
+    else if (result == NFA_TOO_EXPENSIVE)
+	return result;
 
     cleanup_subexpr();
     if (REG_MULTI)
@@ -6929,9 +6950,7 @@ nfa_regexec_both(line, startcol)
     nfa_nsubexpr = prog->nsubexp;
     nfa_listid = 1;
     nfa_alt_listid = 2;
-#ifdef DEBUG
     nfa_regengine.expr = prog->pattern;
-#endif
 
     if (prog->reganch && col > 0)
 	return 0L;
@@ -6979,9 +6998,7 @@ nfa_regexec_both(line, startcol)
 
     retval = nfa_regtry(prog, col);
 
-#ifdef DEBUG
     nfa_regengine.expr = NULL;
-#endif
 
 theend:
     return retval;
@@ -7003,9 +7020,7 @@ nfa_regcomp(expr, re_flags)
     if (expr == NULL)
 	return NULL;
 
-#ifdef DEBUG
     nfa_regengine.expr = expr;
-#endif
 
     init_class_tab();
 
@@ -7082,10 +7097,8 @@ nfa_regcomp(expr, re_flags)
     /* Remember whether this pattern has any \z specials in it. */
     prog->reghasz = re_has_z;
 #endif
-#ifdef DEBUG
     prog->pattern = vim_strsave(expr);
     nfa_regengine.expr = NULL;
-#endif
 
 out:
     vim_free(post_start);
@@ -7099,9 +7112,7 @@ nfa_regcomp(expr, re_flags)
 #ifdef ENABLE_LOG
     nfa_postfix_dump(expr, FAIL);
 #endif
-#ifdef DEBUG
     nfa_regengine.expr = NULL;
-#endif
     goto out;
 }
 
@@ -7115,9 +7126,7 @@ nfa_regfree(prog)
     if (prog != NULL)
     {
 	vim_free(((nfa_regprog_T *)prog)->match_text);
-#ifdef DEBUG
 	vim_free(((nfa_regprog_T *)prog)->pattern);
-#endif
 	vim_free(prog);
     }
 }
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index abcabce03e..07c6831f0e 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -87,6 +87,7 @@ clean:
 	-if exist Xfind rd /s /q Xfind
 	-if exist viminfo del viminfo
 	-del test.log
+	-if exists benchmark.out del benchmark.out
 
 .in.out:
 	-if exist $*.failed del $*.failed
@@ -103,3 +104,11 @@ clean:
 
 nolog:
 	-del test.log
+
+benchmark:
+	bench_re_freeze.out
+
+bench_re_freeze.out: bench_re_freeze.vim
+	-if exist benchmark.out del benchmark.out
+	$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
+	@IF EXIST benchmark.out ( type benchmark.out )
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 2a124b1b83..d2995a50b6 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -12,11 +12,13 @@ ifneq (sh.exe, $(SHELL))
 DEL = rm -f
 MV = mv
 CP = cp
+CAT = cat
 DIRSLASH = /
 else
 DEL = del
 MV = rename
 CP = copy
+CAT = type
 DIRSLASH = \\
 endif
 
@@ -72,6 +74,8 @@ SCRIPTS32 =	test50.out test70.out
 
 SCRIPTS_GUI = test16.out
 
+SCRIPTS_BENCH = bench_re_freeze.out
+
 .SUFFIXES: .in .out
 
 vimall:	fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
@@ -80,6 +84,8 @@ vimall:	fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
 nongui:	fixff $(SCRIPTS16) $(SCRIPTS)
 	echo ALL DONE
 
+benchmark: $(SCRIPTS_BENCH)
+
 small:
 	echo ALL DONE
 
@@ -114,3 +120,8 @@ clean:
 	-$(DEL) X*
 	-$(DEL) test.ok
 	-$(DEL) viminfo
+
+bench_re_freeze.out: bench_re_freeze.vim
+	-$(DEL) benchmark.out
+	$(VIMPROG) -u dos.vim -U NONE --noplugin $*.in
+	$(CAT) benchmark.out
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 5f3dc13930..3b6b4071d5 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -50,6 +50,8 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_signs.out \
 		test_utf8.out
 
+SCRIPTS_BENCH = bench_re_freeze.out
+
 .SUFFIXES: .in .out
 
 all:	/tmp $(SCRIPTS)
@@ -57,6 +59,8 @@ all:	/tmp $(SCRIPTS)
 
 $(SCRIPTS): $(VIMPROG)
 
+benchmark: $(SCRIPTS_BENCH)
+
 clean:
 	-rm -rf *.out Xdotest test.ok tiny.vim small.vim mbyte.vim viminfo
 
@@ -75,3 +79,10 @@ clean:
 # Create a directory for temp files
 /tmp:
 	-mkdir /tmp
+
+bench_re_freeze.out: bench_re_freeze.vim
+	-del $*.failed test.ok benchmark.out
+	copy $*.ok test.ok
+	$(VIMPROG) -u os2.vim --noplugin -s dotest.in $*.in
+	type benchmark.out
+
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 6b3bf9b7e1..1f5095e55b 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -48,12 +48,16 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 
 SCRIPTS_GUI = test16.out
 
+SCRIPTS_BENCH = bench_re_freeze.out
+
 .SUFFIXES: .in .out
 
 nongui:	nolog $(SCRIPTS) report
 
 gui:	nolog $(SCRIPTS) $(SCRIPTS_GUI) report
 
+benchmark: $(SCRIPTS_BENCH)
+
 report:
 	@echo
 	@echo 'Test results:'
@@ -65,7 +69,7 @@ report:
 $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
 
 RM_ON_RUN = test.out X* viminfo
-RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok
+RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out
 RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in
 
 clean:
@@ -120,5 +124,14 @@ test49.out: test49.vim
 
 test60.out: test60.vim
 
+bench_re_freeze.out: bench_re_freeze.vim
+	-rm -rf benchmark.out $(RM_ON_RUN)
+	# Sleep a moment to avoid that the xterm title is messed up.
+	# 200 msec is sufficient, but only modern sleep supports a fraction of
+	# a second, fall back to a second if it fails.
+	@-/bin/sh -c "sleep .2 > /dev/null 2>&1 || sleep 1"
+	-$(RUN_VIM) $*.in
+	@/bin/sh -c "if test -f benchmark.out; then cat benchmark.out; fi"
+
 nolog:
 	-rm -f test.log
diff --git a/src/testdir/bench_re_freeze.in b/src/testdir/bench_re_freeze.in
new file mode 100644
index 0000000000..7b1bfa3459
--- /dev/null
+++ b/src/testdir/bench_re_freeze.in
@@ -0,0 +1,13 @@
+Test for Benchmarking RE engine
+
+STARTTEST
+:so small.vim
+:if !has("reltime") | qa! | endif
+:set nocp cpo&vim
+:so bench_re_freeze.vim
+:call Measure('samples/re.freeze.txt', '\s\+\%#\@<!$', '+5')
+:/^" Benchmark/,$w! benchmark.out
+:qa!
+ENDTEST
+
+" Benchmark_results:
diff --git a/src/testdir/bench_re_freeze.vim b/src/testdir/bench_re_freeze.vim
new file mode 100644
index 0000000000..ee8443825f
--- /dev/null
+++ b/src/testdir/bench_re_freeze.vim
@@ -0,0 +1,13 @@
+"Test for benchmarking the RE engine
+
+so small.vim
+if !has("reltime") | finish | endif
+func! Measure(file, pattern, arg)
+	for re in range(3)
+	    let sstart=reltime()
+	    let cmd=printf("../vim -u NONE -N --cmd ':set re=%d'".
+		\ " -c 'call search(\"%s\", \"\", \"\", 10000)' -c ':q!' %s", re, escape(a:pattern, '\\'), empty(a:arg) ? '' : a:arg)
+	    call system(cmd. ' '. a:file)
+	    $put =printf('file: %s, re: %d, time: %s', a:file, re, reltimestr(reltime(sstart)))
+	endfor
+endfunc
diff --git a/src/testdir/samples/re.freeze.txt b/src/testdir/samples/re.freeze.txt
new file mode 100644
index 0000000000..d768c23c5e
--- /dev/null
+++ b/src/testdir/samples/re.freeze.txt
@@ -0,0 +1,6 @@
+:set re=0 or 2
+Search for the pattern: /\s\+\%#\@<!$/
+vim should not freeze.
+
+<td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td><td style="border-bottom windowtext 0.5pt solid; border-left windowtext;" class=abc align=right><font face=arial><font color=#ff0000><b>5</b></font></font></td> 
+
diff --git a/src/version.c b/src/version.c
index c399dd60a7..f0fd5a38cb 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    497,
 /**/
     496,
 /**/

From e1992983fb274ad142d33ef0da7ceaf5680ea5b9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 14:27:36 +0100
Subject: [PATCH 238/473] Added tag v7-4-497 for changeset adfbffe1e642

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 937374b23c..6efd5e8310 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3219,3 +3219,4 @@ a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 85d8cde3b432ae627382e1f2222aa8368f5837b8 v7-4-494
 0079791cbbeaaad9ff4391097c2f7896114d6022 v7-4-495
 112c80234ce3815b2c7d1c27ad21aa885d2776f3 v7-4-496
+adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497

From cb8334daf716d2360f18ddbdb22ee25b3912b7ac Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 15:46:09 +0100
Subject: [PATCH 239/473] updated for version 7.4.498 Problem:    Typo in DOS
 makefile. Solution:   Change exists to exist. (Ken Takata)

---
 src/testdir/Make_dos.mak | 2 +-
 src/version.c            | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 07c6831f0e..7fd2763605 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -87,7 +87,7 @@ clean:
 	-if exist Xfind rd /s /q Xfind
 	-if exist viminfo del viminfo
 	-del test.log
-	-if exists benchmark.out del benchmark.out
+	-if exist benchmark.out del benchmark.out
 
 .in.out:
 	-if exist $*.failed del $*.failed
diff --git a/src/version.c b/src/version.c
index f0fd5a38cb..ae1a56b5b5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    498,
 /**/
     497,
 /**/

From 367d47e4899f5a90228576f6b2268d71d4efa519 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 15:46:09 +0100
Subject: [PATCH 240/473] Added tag v7-4-498 for changeset 24ee7a7a26b1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6efd5e8310..54e31f75f6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3220,3 +3220,4 @@ a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 0079791cbbeaaad9ff4391097c2f7896114d6022 v7-4-495
 112c80234ce3815b2c7d1c27ad21aa885d2776f3 v7-4-496
 adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
+24ee7a7a26b1ec8169bbb4656a99b3499e971b50 v7-4-498

From 5c5d74233f5d938c0cbec51d63d6563ef8fb3858 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 16:03:44 +0100
Subject: [PATCH 241/473] updated for version 7.4.499 Problem:    substitute()
 can be slow with long strings. Solution:   Store a pointer to the end,
 instead of calling strlen() every 	    time. (Ozaki Kiichi)

---
 src/eval.c    | 4 +++-
 src/version.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index f5aa7e919e..ecc5e3a572 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -25076,6 +25076,7 @@ do_string_sub(str, pat, sub, flags)
     int		i;
     int		do_all;
     char_u	*tail;
+    char_u	*end;
     garray_T	ga;
     char_u	*ret;
     char_u	*save_cpo;
@@ -25094,6 +25095,7 @@ do_string_sub(str, pat, sub, flags)
     if (regmatch.regprog != NULL)
     {
 	tail = str;
+	end = str + STRLEN(str);
 	while (vim_regexec_nl(&regmatch, str, (colnr_T)(tail - str)))
 	{
 	    /* Skip empty match except for first match. */
@@ -25120,7 +25122,7 @@ do_string_sub(str, pat, sub, flags)
 	     * - The text after the match.
 	     */
 	    sublen = vim_regsub(&regmatch, sub, tail, FALSE, TRUE, FALSE);
-	    if (ga_grow(&ga, (int)(STRLEN(tail) + sublen -
+	    if (ga_grow(&ga, (int)((end - tail) + sublen -
 			    (regmatch.endp[0] - regmatch.startp[0]))) == FAIL)
 	    {
 		ga_clear(&ga);
diff --git a/src/version.c b/src/version.c
index ae1a56b5b5..9008518e23 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    499,
 /**/
     498,
 /**/

From 9ab282f3c5bcd373334ffa3b15b6e76f3fc1ef33 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 16:03:44 +0100
Subject: [PATCH 242/473] Added tag v7-4-499 for changeset 65e72747feca

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 54e31f75f6..10b42daaa5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3221,3 +3221,4 @@ a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 112c80234ce3815b2c7d1c27ad21aa885d2776f3 v7-4-496
 adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
 24ee7a7a26b1ec8169bbb4656a99b3499e971b50 v7-4-498
+65e72747fecab7c43c72a1562e4fef6b530e2db7 v7-4-499

From 2d600988ab36489b49329f9a55e4544abc80eb18 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 16:39:28 +0100
Subject: [PATCH 243/473] updated for version 7.4.500 Problem:    Test 72 still
 fails once in a while. Solution:   Don't set 'fileformat' to unix, reset it.
 (Ken Takata)

---
 src/testdir/test72.in | 5 ++---
 src/version.c         | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/testdir/test72.in b/src/testdir/test72.in
index 87c25d4863..a407eea4e4 100644
--- a/src/testdir/test72.in
+++ b/src/testdir/test72.in
@@ -8,7 +8,6 @@ STARTTEST
 :" Test 'undofile': first a simple one-line change.
 :set nocompatible viminfo+=nviminfo visualbell
 :set ul=100 undofile nomore
-:set ff=unix
 :e! Xtestfile
 ggdGithis is one line:set ul=100
 :s/one/ONE/
@@ -83,7 +82,7 @@ uu:w >>test.out
 :" With encryption, cryptmethod=blowfish
 :e! Xtestfile
 rubbish
-:set undofile cm=blowfish
+:set undofile cm=blowfish ff&
 ggdGijan
 feb
 mar
@@ -109,7 +108,7 @@ u:.w >>test.out
 :" With encryption, cryptmethod=blowfish2
 :e! Xtestfile
 rubbish
-:set undofile cm=blowfish2
+:set undofile cm=blowfish2 ff&
 ggdGijan
 feb
 mar
diff --git a/src/version.c b/src/version.c
index 9008518e23..7f27975a43 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    500,
 /**/
     499,
 /**/

From 76c6655b6e90c712373376f31e2ee430e1fa6115 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 16:39:28 +0100
Subject: [PATCH 244/473] Added tag v7-4-500 for changeset fd4dc6581b0e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 10b42daaa5..46314496f4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3222,3 +3222,4 @@ a0daa5feaccbbed4b8d6db9c18f76ebe116c8e37 v7-4-493
 adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
 24ee7a7a26b1ec8169bbb4656a99b3499e971b50 v7-4-498
 65e72747fecab7c43c72a1562e4fef6b530e2db7 v7-4-499
+fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500

From 65ef1269bd3aecb81919843ee36668db9bff06bd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 17:02:17 +0100
Subject: [PATCH 245/473] Update runtime files.

---
 runtime/autoload/gzip.vim   |  8 +++--
 runtime/doc/diff.txt        | 16 +++++----
 runtime/doc/options.txt     |  7 ++--
 runtime/doc/quickref.txt    |  9 +++--
 runtime/doc/repeat.txt      |  5 ++-
 runtime/doc/tags            |  1 +
 runtime/doc/todo.txt        | 66 ++++++++++++++++++++++++-------------
 runtime/doc/usr_25.txt      |  4 +--
 runtime/filetype.vim        |  5 ++-
 runtime/syntax/registry.vim | 11 ++++---
 10 files changed, 89 insertions(+), 43 deletions(-)

diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim
index 1245fdddc9..a6b4605b06 100644
--- a/runtime/autoload/gzip.vim
+++ b/runtime/autoload/gzip.vim
@@ -1,6 +1,6 @@
 " Vim autoload file for editing compressed files.
 " Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2008 Jul 04
+" Last Change: 2014 Nov 05
 
 " These functions are used by the gzip plugin.
 
@@ -120,6 +120,8 @@ fun gzip#read(cmd)
     silent! exe "bwipe " . tmp_esc
     silent! exe "bwipe " . tmpe_esc
   endif
+  " Store the OK flag, so that we can use it when writing.
+  let b:uncompressOk = ok
 
   " Restore saved option values.
   let &pm = pm_save
@@ -146,8 +148,10 @@ endfun
 
 " After writing compressed file: Compress written file with "cmd"
 fun gzip#write(cmd)
+  if exists('b:uncompressOk') && !b:uncompressOk
+    echomsg "Not compressing file because uncompress failed; reset b:uncompressOk to compress anyway"
   " don't do anything if the cmd is not supported
-  if s:check(a:cmd)
+  elseif s:check(a:cmd)
     " Rename the file before compressing it.
     let nm = resolve(expand("<afile>"))
     let nmt = s:tempname(nm)
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 0ee5878341..be17b0c731 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,4 +1,4 @@
-*diff.txt*      For Vim version 7.4.  Last change: 2014 May 20
+*diff.txt*      For Vim version 7.4.  Last change: 2014 Oct 31
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -266,13 +266,17 @@ that the buffers will be equal within the specified range.
 		See below for [range].
 
 							*do*
-do		Same as ":diffget" without argument or range.  The "o" stands
-		for "obtain" ("dg" can't be used, it could be the start of
-		"dgg"!). Note: this doesn't work in Visual mode.
+[count]do	Same as ":diffget" without range.  The "o" stands for "obtain"
+		("dg" can't be used, it could be the start of "dgg"!). Note:
+		this doesn't work in Visual mode.
+		If you give a [count], it is used as the [bufspec] argument
+		for ":diffget".
 
 							*dp*
-dp		Same as ":diffput" without argument or range.
-		Note: this doesn't work in Visual mode.
+[count]dp	Same as ":diffput" without range.  Note: this doesn't work in
+		Visual mode.
+		If you give a [count], it is used as the [bufspec] argument
+		for ":diffput".
 
 
 When no [range] is given, the diff at the cursor position or just above it is
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 534ef449f8..ccf92991f7 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.4.  Last change: 2014 Sep 23
+*options.txt*	For Vim version 7.4.  Last change: 2014 Nov 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -2221,7 +2221,7 @@ A jump table for the options with a short description can be found at |Q_op|.
 
 
 						*'cryptmethod'* *'cm'*
-'cryptmethod'		string	(default "zip")
+'cryptmethod' 'cm'	string	(default "zip")
 			global or local to buffer |global-local|
 			{not in Vi}
 	Method used for encryption when the buffer is written to a file:
@@ -7748,6 +7748,9 @@ A jump table for the options with a short description can be found at |Q_op|.
 	current buffer: >
 		setlocal ul=-1
 <	This helps when you run out of memory for a single change.
+
+	The local value is set to -123456 when the global value is to be used.
+
 	Also see |clear-undo|.
 
 						*'undoreload'* *'ur'*
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 096921f003..727f6ac4b0 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt*  For Vim version 7.4.  Last change: 2014 Aug 06
+*quickref.txt*  For Vim version 7.4.  Last change: 2014 Oct 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1313,11 +1313,16 @@ Context-sensitive completion on the command-line:
 |CTRL-W_R|	CTRL-W R		rotate windows upwards
 |CTRL-W_x|	CTRL-W x		exchange current window with next one
 
-|CTRL-W_=|	CTRL-W =		make all windows equal height
+|CTRL-W_=|	CTRL-W =		make all windows equal height & width
 |CTRL-W_-|	CTRL-W -		decrease current window height
 |CTRL-W_+|	CTRL-W +		increase current window height
 |CTRL-W__|	CTRL-W _		set current window height (default:
 					   very high)
+
+|CTRL-W_<|	CTRL-W <		decrease current window width
+|CTRL-W_>|	CTRL-W >		increase current window width
+|CTRL-W_bar|	CTRL-W |		set current window width (default:
+					   widest possible)
 ------------------------------------------------------------------------------
 *Q_bu*		Buffer list commands
 
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 4b28e8617b..edeef6655e 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt*    For Vim version 7.4.  Last change: 2014 Mar 25
+*repeat.txt*    For Vim version 7.4.  Last change: 2014 Oct 29
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -64,6 +64,9 @@ replacement string.
 
 For the definition of a pattern, see |pattern|.
 
+NOTE [cmd] may contain a range; see |collapse| and |edit-paragraph-join| for
+examples.
+
 The global commands work by first scanning through the [range] lines and
 marking each line where a match occurs (for a multi-line pattern, only the
 start of the match matters).
diff --git a/runtime/doc/tags b/runtime/doc/tags
index f8db6553e1..460be9044e 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -5473,6 +5473,7 @@ edit-dialogs	editing.txt	/*edit-dialogs*
 edit-files	editing.txt	/*edit-files*
 edit-intro	editing.txt	/*edit-intro*
 edit-no-break	usr_25.txt	/*edit-no-break*
+edit-paragraph-join	usr_25.txt	/*edit-paragraph-join*
 editing.txt	editing.txt	/*editing.txt*
 efm-%>	quickfix.txt	/*efm-%>*
 efm-entries	quickfix.txt	/*efm-entries*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index daf5270e5a..32b1f901c3 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Oct 15
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -44,6 +44,7 @@ Regexp problems:
   2013 Dec 11)
 - Using \@> and \?. (Brett Stahlman, 2013 Dec 21) Remark from Marcin Szamotulski
   Remark from Brett 2014 Jan 6 and 7.
+- Difference in NFA and old engine. (Brett Stahlman, 2014 Nov 5)
 - Bug when using \>. (Ramel, 2014 Feb 2) (Aaron Bohannon, 2014 Feb 13)
 - NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
 - Does not work with NFA regexp engine:
@@ -63,10 +64,6 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-Patch to avoid problems with encoding conversion with diff.vim.
-(Yasuhiro Matsumoto, 2014 Sep 1.
-Depends on current language, language of file can be different.
-
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
@@ -77,31 +74,26 @@ Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
     Make ":-1close" close the previous window.
 Doesn't look right, asked for updates.
 
+C macro with number highlighted wrong. (Dominique Pelle, 2014 Oct 23)
+
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
-Patch to fix that 0x80 in abbreviation isn't handled correctly.
-(Christian Brabandt, 2014 Oct 1)
-
-Check for valid yank reg seems wrong.  Patch by Zyx, 2014 Oct 12.
-
-":sign-jump" uses first window in buffer instead of current window.
-Patch by James McCoy, 2013 Nov 22.  Update 2014 Oct 5.
-
-Patch to fix issue 57, on the issue.
-
-Patch for issue 101, maintainer unreachable.
-
 Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
 
-Patch to fix that last_changedtick is not update on saving. (Christian
-Brabandt, 2014 Oct 10, second one)
+Patch to add 'langnoremap'. (Christian Brabandt, 2014 Oct 15)
+Update Oct 20.
 
-substitute() can be slow with long strings.  Patch by Ozaki Kiichi, 2014 Oct
-12.
+Patch to add append mode to writefile(). (Yasuhiro Matsumoto, 2014 Nov 1)
 
 Remove restriction in NSIS installer that the end of the path must be "Vim".
-(Tim Lebedkov, 2014 Sep 24) Again Oct 12.
+(Tim Lebedkov, 2014 Sep 24) Again Oct 12.  Now on issue 272.
+
+Fix that on MS-Windows MAX_PATH in bytes causes problems for file names
+between MAX_PATH and double that for double-byte encodings. (Ken Takata, 2014
+Oct 15)
+
+Another problem with MAX_PATH, off-by-one. (Ken Takata, 2014 Oct 21)
 
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
@@ -117,11 +109,16 @@ Patch to fix issue 78. (Christian Brabandt, 2014 Oct 8)
 
 Patch to fix leak in map() with error. (Christian Brabandt, 2014 Oct 11)
 
+Patch to fix incsearch for "2/pattern/e".
+
+Change behavior of v:hlsearch?  Patch from Christian, 2014 Oct 22.
+
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
 On MS-Windows running tests with Mercurial has problems when the input files
 are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
+Update Nov 5.
 
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
@@ -129,6 +126,9 @@ MS-Windows: Crash opening very long file name starting with "\\".
 ml_updatechunk() is slow when retrying for another encoding. (John Little,
 2014 Sep 11)
 
+When 'balloonexpr' returns a list the result has a trailing newline.
+Just remove one trailing newline. (lcd, 2014 Oct 17)
+
 Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24)
 
 When in 'comments' "n:x" follows after three-part comment directly it repeats
@@ -136,8 +136,16 @@ any one-character from the previous line. (Kartik Agaram, 2014 Sep 19)
 
 Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 
+Patch to add the EndOfBuffer highlight group, used instead of NonText for "~"
+lines. (Marco Hinz, 2014 Nov 2)
+
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
+Can assign to s:type when a function s:type has been defined.
+Also the other way around: define a function while a variable with that name
+was already defined.
+(Yasuhiro Matsumoto, 2014 Nov 3)
+
 Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
 
 Patch for building a 32bit Vim with 64bit MingW compiler.
@@ -145,6 +153,11 @@ Patch for building a 32bit Vim with 64bit MingW compiler.
 
 Delete old code in os_msdos.c, mch_FullName().
 
+Using "." to repeat an Ex command puts that command in history.  Probably
+should not happen.  If the command is the result of a mapping it's not put in
+history either. (Jacob Niehus, 2014 Nov 2)
+Patch from Jacob, Nov 2.
+
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
 Jun 8)
 
@@ -183,6 +196,8 @@ its height?  It's like dragging the status bar above it at the same time.
 Can we make ":unlet $VAR" use unsetenv() to delete the env var?
 What for systems that don't have unsetenv()?
 
+Patch to add a :domodeline command. (Christian Brabandt, 2014 Oct 21)
+
 This does not give an error: (Andre Sihera, 2014 Mar 21)
     vim -u NONE 1 2 3 -c 'bufdo if 1 | echo 1'
 This neither: (ZyX)
@@ -635,6 +650,9 @@ Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2,
 only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug
 21, Ben Fritz, 2010 Sep 14)
 
+The :syntax cchar value can only be a single character.  It would be useful to
+support combining characters. (Charles Campbell)
+
 'cursorline' works on a text line only.  Add 'cursorscreenline' for
 highlighting the screen line. (Christian Brabandt, 2012 Mar 31)
 
@@ -759,6 +777,10 @@ Need for CursorHold that retriggers.  Use a key that doesn't do anything, or a
 function that resets did_cursorhold.
 Patch by Christian Brabandt, 2011 May 6.
 
+Add event for when the text scrolls.  A bit like CursorMoved.  Also a similar
+one for insert mode.  Use the event in matchparen to update the highlight if
+the match scrolls into view.
+
 7   Use "++--", "+++--" for different levels instead of "+---" "+----".
 Patch by Christian Brabandt, 2011 Jul 27.
 Update by Ben Fritz, with fix for TOhtml. (2011 Jul 30)
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
index 5a687599b3..23d76a8b0f 100644
--- a/runtime/doc/usr_25.txt
+++ b/runtime/doc/usr_25.txt
@@ -1,4 +1,4 @@
-*usr_25.txt*	For Vim version 7.4.  Last change: 2007 May 11
+*usr_25.txt*	For Vim version 7.4.  Last change: 2014 Oct 29
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -402,7 +402,7 @@ the cursor keys: >
 	:map <Down> gj
 
 
-TURNING A PARAGRAPH INTO ONE LINE
+TURNING A PARAGRAPH INTO ONE LINE			*edit-paragraph-join*
 
 If you want to import text into a program like MS-Word, each paragraph should
 be a single line.  If your paragraphs are currently separated with empty
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 67d1674537..508f19820b 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Oct 09
+" Last Change:	2014 Nov 05
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -782,6 +782,9 @@ au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
 au BufNewFile,BufRead *.git/modules/*/COMMIT_EDITMSG setf gitcommit
 au BufNewFile,BufRead *.git/modules/*/config	setf gitconfig
 au BufNewFile,BufRead */.config/git/config	setf gitconfig
+if !empty($XDG_CONFIG_HOME)
+  au BufNewFile,BufRead $XDG_CONFIG_HOME/git/config	setf gitconfig
+endif
 au BufNewFile,BufRead git-rebase-todo		setf gitrebase
 au BufNewFile,BufRead .msg.[0-9]*
       \ if getline(1) =~ '^From.*# This line is ignored.$' |
diff --git a/runtime/syntax/registry.vim b/runtime/syntax/registry.vim
index e9ff8fcaba..4524247a08 100644
--- a/runtime/syntax/registry.vim
+++ b/runtime/syntax/registry.vim
@@ -1,8 +1,9 @@
 " Vim syntax file
 " Language:	Windows Registry export with regedit (*.reg)
-" Maintainer:	Dominique St�phan (dominique@mggen.com)
-" URL: http://www.mggen.com/vim/syntax/registry.zip
-" Last change:	2004 Apr 23
+" Maintainer:	Dominique Stéphan (dominique@mggen.com)
+" URL: 		http://www.mggen.com/vim/syntax/registry.zip (doesn't work)
+" Last change:	2014 Oct 31
+"		Included patch from Alexander A. Ulitin
 
 " clear any unwanted syntax defs
 " For version 5.x: Clear all syntax items
@@ -17,7 +18,7 @@ endif
 syn case ignore
 
 " Head of regedit .reg files, it's REGEDIT4 on Win9#/NT
-syn match registryHead		"^REGEDIT[0-9]*$"
+syn match registryHead		"^REGEDIT[0-9]*\s*$\|^Windows Registry Editor Version \d*\.\d*\s*$"
 
 " Comment
 syn match  registryComment	"^;.*$"
@@ -58,7 +59,7 @@ syn region registryRemove	start="\[\-" end="\]" contains=registryHKEY,registryGU
 " Subkey
 syn match  registrySubKey		"^\".*\"="
 " Default value
-syn match  registrySubKey		"^\@="
+syn match  registrySubKey		"^@="
 
 " Numbers
 

From ade84df2ebb74cb3b0219c4e55a8c828f838c498 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 17:04:18 +0100
Subject: [PATCH 246/473] updated for version 7.4.501 Problem:    Typo in file
 pattern. Solution:   Insert a slash and remove a dot.

---
 Filelist      | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Filelist b/Filelist
index d8d9ecb59c..522375472a 100644
--- a/Filelist
+++ b/Filelist
@@ -104,7 +104,7 @@ SRC_ALL =	\
 		src/testdir/python_before/*.py \
 		src/testdir/bench*.in \
 		src/testdir/bench*.vim \
-		src/testdir/samples.*.txt \
+		src/testdir/samples/*.txt \
 		src/proto.h \
 		src/proto/blowfish.pro \
 		src/proto/buffer.pro \
diff --git a/src/version.c b/src/version.c
index 7f27975a43..3c48dc4334 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    501,
 /**/
     500,
 /**/

From e3c70428c8ac7aa118febc5d38e580489284b542 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 17:04:18 +0100
Subject: [PATCH 247/473] Added tag v7-4-501 for changeset 0ed561752653

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 46314496f4..9c69e662a5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3223,3 +3223,4 @@ adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
 24ee7a7a26b1ec8169bbb4656a99b3499e971b50 v7-4-498
 65e72747fecab7c43c72a1562e4fef6b530e2db7 v7-4-499
 fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
+0ed561752653050472279f14ec75144844b42bf8 v7-4-501

From 0b7b355fa9fd559c9b4343c050dae5731a712079 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 17:44:52 +0100
Subject: [PATCH 248/473] updated for version 7.4.502 Problem:    Language
 mapping also applies to mapped characters. Solution:   Add the 'langnoremap'
 option, when on 'langmap' does not apply to 	    mapped characters.
 (Christian Brabandt)

---
 runtime/doc/options.txt   | 12 ++++++++++++
 runtime/vimrc_example.vim |  9 ++++++++-
 src/macros.h              | 15 ++++++++++++---
 src/option.c              |  7 +++++++
 src/option.h              |  1 +
 src/version.c             |  2 ++
 6 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index ccf92991f7..525a08cdbe 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4589,6 +4589,18 @@ A jump table for the options with a short description can be found at |Q_op|.
 		:source $VIMRUNTIME/menu.vim
 <	Warning: This deletes all menus that you defined yourself!
 
+					*'langnoremap'* *'lnr'*
+'langnoremap' 'lnr'	boolean (default off)
+			global
+			{not in Vi}
+			{only available when compiled with the |+langmap|
+			feature}
+	When on, setting 'langmap' does not apply to characters resulting from
+	a mapping.  This basically means, if you noticed that setting
+	'langmap' disables some of your mappings, try setting this option.
+	This option defaults to off for backwards compatibility.  Set it on if
+	that works for you to avoid mappings to break.
+
 					*'laststatus'* *'ls'*
 'laststatus' 'ls'	number	(default 1)
 			global
diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim
index 27a5cfc222..215fd24658 100644
--- a/runtime/vimrc_example.vim
+++ b/runtime/vimrc_example.vim
@@ -1,7 +1,7 @@
 " An example for a vimrc file.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last change:	2014 Feb 05
+" Last change:	2014 Nov 05
 "
 " To use it, copy it to
 "     for Unix and OS/2:  ~/.vimrc
@@ -95,3 +95,10 @@ if !exists(":DiffOrig")
   command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
 		  \ | wincmd p | diffthis
 endif
+
+if has('langmap') && exists('+langnoremap')
+  " Prevent that the langmap option applies to characters that result from a
+  " mapping.  If unset (default), this may break plugins (but it's backward
+  " compatible).
+  set langnoremap
+endif
diff --git a/src/macros.h b/src/macros.h
index 2706a02524..01207d91b3 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -128,13 +128,18 @@
  * Adjust chars in a language according to 'langmap' option.
  * NOTE that there is no noticeable overhead if 'langmap' is not set.
  * When set the overhead for characters < 256 is small.
- * Don't apply 'langmap' if the character comes from the Stuff buffer.
+ * Don't apply 'langmap' if the character comes from the Stuff buffer or from
+ * a mapping and the langnoremap option was set.
  * The do-while is just to ignore a ';' after the macro.
  */
 # ifdef FEAT_MBYTE
 #  define LANGMAP_ADJUST(c, condition) \
     do { \
-	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0) \
+	if (*p_langmap \
+		&& (condition) \
+		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+		&& !KeyStuffed \
+		&& (c) >= 0) \
 	{ \
 	    if ((c) < 256) \
 		c = langmap_mapchar[c]; \
@@ -145,7 +150,11 @@
 # else
 #  define LANGMAP_ADJUST(c, condition) \
     do { \
-	if (*p_langmap && (condition) && !KeyStuffed && (c) >= 0 && (c) < 256) \
+	if (*p_langmap \
+		&& (condition) \
+		&& (!p_lnr || (p_lnr && typebuf_maplen() == 0)) \
+		&& !KeyStuffed \
+		&& (c) >= 0 && (c) < 256) \
 	    c = langmap_mapchar[c]; \
     } while (0)
 # endif
diff --git a/src/option.c b/src/option.c
index 5e8e95a6d2..6841d42d6c 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1691,6 +1691,13 @@ static struct vimoption
 			    (char_u *)NULL, PV_NONE,
 #endif
 			    {(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
+    {"langnoremap",  "lnr",   P_BOOL|P_VI_DEF,
+#ifdef FEAT_LANGMAP
+			    (char_u *)&p_lnr, PV_NONE,
+#else
+			    (char_u *)NULL, PV_NONE,
+#endif
+			    {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
     {"laststatus",  "ls",   P_NUM|P_VI_DEF|P_RALL,
 #ifdef FEAT_WINDOWS
 			    (char_u *)&p_ls, PV_NONE,
diff --git a/src/option.h b/src/option.h
index 23cdecdf01..b031466768 100644
--- a/src/option.h
+++ b/src/option.h
@@ -576,6 +576,7 @@ EXTERN char_u	*p_kp;		/* 'keywordprg' */
 EXTERN char_u	*p_km;		/* 'keymodel' */
 #ifdef FEAT_LANGMAP
 EXTERN char_u	*p_langmap;	/* 'langmap'*/
+EXTERN int	p_lnr;		/* 'langnoremap' */
 #endif
 #if defined(FEAT_MENU) && defined(FEAT_MULTI_LANG)
 EXTERN char_u	*p_lm;		/* 'langmenu' */
diff --git a/src/version.c b/src/version.c
index 3c48dc4334..7bc7153f77 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    502,
 /**/
     501,
 /**/

From b2362523e108f3a53943f6ee9a3e4a3289370573 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 17:44:52 +0100
Subject: [PATCH 249/473] Added tag v7-4-502 for changeset 7b28dc1d756e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9c69e662a5..5b1bc3bdbb 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3224,3 +3224,4 @@ adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
 65e72747fecab7c43c72a1562e4fef6b530e2db7 v7-4-499
 fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 0ed561752653050472279f14ec75144844b42bf8 v7-4-501
+7b28dc1d756e11bd7e25a19ffe272ac605613a40 v7-4-502

From 9cececc60efc7a94d9bcf49e68d8b7f8b8289444 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:06:01 +0100
Subject: [PATCH 250/473] updated for version 7.4.503 Problem:    Cannot append
 a list of lines to a file. Solution:   Add the append option to writefile().
 (Yasuhiro Matsumoto)

---
 runtime/doc/eval.txt          | 14 ++++++++++----
 src/Makefile                  |  4 ++++
 src/eval.c                    | 14 ++++++++++----
 src/testdir/test_writefile.in | 18 ++++++++++++++++++
 src/testdir/test_writefile.ok |  5 +++++
 src/version.c                 |  2 ++
 6 files changed, 49 insertions(+), 8 deletions(-)
 create mode 100644 src/testdir/test_writefile.in
 create mode 100644 src/testdir/test_writefile.ok

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index eb7fcbcaac..4e349a6e08 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -2041,7 +2041,7 @@ winrestcmd()			String	returns command to restore window sizes
 winrestview( {dict})		none	restore view of current window
 winsaveview()			Dict	save view of current window
 winwidth( {nr})			Number	width of window {nr}
-writefile( {list}, {fname} [, {binary}])
+writefile( {list}, {fname} [, {flags}])
 				Number	write list of lines to file {fname}
 xor( {expr}, {expr})		Number  bitwise XOR
 
@@ -6555,14 +6555,20 @@ winwidth({nr})						*winwidth()*
   :endif
 <
 							*writefile()*
-writefile({list}, {fname} [, {binary}])
+writefile({list}, {fname} [, {flags}])
 		Write |List| {list} to file {fname}.  Each list item is
 		separated with a NL.  Each list item must be a String or
 		Number.
-		When {binary} is equal to "b" binary mode is used: There will
+		When {flags} contains "b" then binary mode is used: There will
 		not be a NL after the last list item.  An empty item at the
 		end does cause the last line in the file to end in a NL.
-		All NL characters are replaced with a NUL character.
+
+		When {flags} contains "a" then append mode is used, lines are
+		append to the file: >
+			:call writefile(["foo"], "event.log", "a")
+			:call writefile(["bar"], "event.log", "a")
+>
+<		All NL characters are replaced with a NUL character.
 		Inserting CR characters needs to be done before passing {list}
 		to writefile().
 		An existing file is overwritten, if possible.
diff --git a/src/Makefile b/src/Makefile
index cfdca44fcd..39e2de99f9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1899,8 +1899,12 @@ test1 test2 test3 test4 test5 test6 test7 test8 test9 \
 	test_insertcount \
 	test_listlbr \
 	test_listlbr_utf8 \
+	test_mapping \
 	test_options \
 	test_qf_title \
+	test_signs \
+	test_utf8 \
+	test_writefile \
 	test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
 	test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
 	test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \
diff --git a/src/eval.c b/src/eval.c
index ecc5e3a572..ba456f2bc2 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -19689,6 +19689,7 @@ f_writefile(argvars, rettv)
     typval_T	*rettv;
 {
     int		binary = FALSE;
+    int		append = FALSE;
     char_u	*fname;
     FILE	*fd;
     int		ret = 0;
@@ -19704,14 +19705,19 @@ f_writefile(argvars, rettv)
     if (argvars[0].vval.v_list == NULL)
 	return;
 
-    if (argvars[2].v_type != VAR_UNKNOWN
-			      && STRCMP(get_tv_string(&argvars[2]), "b") == 0)
-	binary = TRUE;
+    if (argvars[2].v_type != VAR_UNKNOWN)
+    {
+	if (vim_strchr(get_tv_string(&argvars[2]), 'b') != NULL)
+	    binary = TRUE;
+	if (vim_strchr(get_tv_string(&argvars[2]), 'a') != NULL)
+	    append = TRUE;
+    }
 
     /* Always open the file in binary mode, library functions have a mind of
      * their own about CR-LF conversion. */
     fname = get_tv_string(&argvars[1]);
-    if (*fname == NUL || (fd = mch_fopen((char *)fname, WRITEBIN)) == NULL)
+    if (*fname == NUL || (fd = mch_fopen((char *)fname,
+				      append ? APPENDBIN : WRITEBIN)) == NULL)
     {
 	EMSG2(_(e_notcreate), *fname == NUL ? (char_u *)_("<empty>") : fname);
 	ret = -1;
diff --git a/src/testdir/test_writefile.in b/src/testdir/test_writefile.in
new file mode 100644
index 0000000000..f2dc7d50bb
--- /dev/null
+++ b/src/testdir/test_writefile.in
@@ -0,0 +1,18 @@
+Tests for writefile()
+
+STARTTEST
+:source small.vim
+:%delete _
+:let f = tempname()
+:call writefile(["over","written"], f, "b")
+:call writefile(["hello","world"], f, "b")
+:call writefile(["!", "good"], f, "a")
+:call writefile(["morning"], f, "ab")
+:call writefile(["", "vimmers"], f, "ab")
+:bwipeout!
+:$put =readfile(f)
+:1 delete _
+:w! test.out
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test_writefile.ok b/src/testdir/test_writefile.ok
new file mode 100644
index 0000000000..dfb6a2b29c
--- /dev/null
+++ b/src/testdir/test_writefile.ok
@@ -0,0 +1,5 @@
+hello
+world!
+good
+morning
+vimmers
diff --git a/src/version.c b/src/version.c
index 7bc7153f77..f9c0ece552 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    503,
 /**/
     502,
 /**/

From 9c92e5447c5c3d0091ee1cf83dc871bd71efd76b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:06:01 +0100
Subject: [PATCH 251/473] Added tag v7-4-503 for changeset 094a87e76155

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5b1bc3bdbb..824d40b6c1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3225,3 +3225,4 @@ adfbffe1e642d8779872ced560c13f3e62a39819 v7-4-497
 fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 0ed561752653050472279f14ec75144844b42bf8 v7-4-501
 7b28dc1d756e11bd7e25a19ffe272ac605613a40 v7-4-502
+094a87e76155fcbb43f7070eb605c2944192a7ff v7-4-503

From de1fb470d06a13ecbdaf772d9a0c921461608a8b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:18:17 +0100
Subject: [PATCH 252/473] updated for version 7.4.504 Problem:    Restriction
 of the MS-Windows installer that the path must end in 	    "Vim" prevents
 installing more than one version. Solution:   Remove the restriction. (Tim
 Lebedkov)

---
 nsis/gvim.nsi | 9 ++-------
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi
index 7b69e7d9cb..a2d20bf829 100644
--- a/nsis/gvim.nsi
+++ b/nsis/gvim.nsi
@@ -1,6 +1,6 @@
 # NSIS file to create a self-installing exe for Vim.
 # It requires NSIS version 2.0 or later.
-# Last Change:	2010 Jul 30
+# Last Change:	2014 Nov 5
 
 # WARNING: if you make changes to this script, look out for $0 to be valid,
 # because uninstall deletes most files in $0.
@@ -38,7 +38,7 @@ SetDatablockOptimize on
 RequestExecutionLevel highest
 
 ComponentText "This will install Vim ${VER_MAJOR}.${VER_MINOR} on your computer."
-DirText "Choose a directory to install Vim (must end in 'vim')"
+DirText "Choose a directory to install Vim (should contain 'vim')"
 Icon icons\vim_16c.ico
 # NSIS2 uses a different strategy with six different images in a strip...
 #EnabledBitmap icons\enabled.bmp
@@ -135,11 +135,6 @@ FunctionEnd
 # We only accept the directory if it ends in "vim".  Using .onVerifyInstDir has
 # the disadvantage that the browse dialog is difficult to use.
 Function CheckInstallDir
-  StrCpy $0 $INSTDIR 3 -3
-  StrCmp $0 "vim" PathGood
-    MessageBox MB_OK "The path must end in 'vim'."
-    Abort
-  PathGood:
 FunctionEnd
 
 Function .onInstSuccess
diff --git a/src/version.c b/src/version.c
index f9c0ece552..4bbc221552 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    504,
 /**/
     503,
 /**/

From e18ba1fb2b986a9b0b31bda72227de920fab66e3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:18:17 +0100
Subject: [PATCH 253/473] Added tag v7-4-504 for changeset edfa81ea1711

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 824d40b6c1..a88134649b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3226,3 +3226,4 @@ fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 0ed561752653050472279f14ec75144844b42bf8 v7-4-501
 7b28dc1d756e11bd7e25a19ffe272ac605613a40 v7-4-502
 094a87e76155fcbb43f7070eb605c2944192a7ff v7-4-503
+edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504

From 9079247ceb92f23c9eae539c681df78c3f62b3b7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:36:03 +0100
Subject: [PATCH 254/473] updated for version 7.4.505 Problem:    On MS-Windows
 when 'encoding' is a double-byte encoding a file 	    name longer than
 MAX_PATH bytes but shorter than that in 	    characters causes
 problems. Solution:   Fail on file names longer than MAX_PATH bytes. (Ken
 Takata)

---
 src/os_win32.c | 14 ++++++++++++++
 src/version.c  |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/src/os_win32.c b/src/os_win32.c
index c03b963c4f..fcfafa01e8 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -6139,6 +6139,13 @@ mch_open(char *name, int flags, int mode)
     }
 # endif
 
+    /* open() can open a file which name is longer than _MAX_PATH bytes
+     * and shorter than _MAX_PATH characters successfully, but sometimes it
+     * causes unexpected error in another part. We make it an error explicitly
+     * here. */
+    if (strlen(name) >= _MAX_PATH)
+	return -1;
+
     return open(name, flags, mode);
 }
 
@@ -6188,6 +6195,13 @@ mch_fopen(char *name, char *mode)
 	 * the _wfopen() fails for missing wide functions. */
     }
 
+    /* fopen() can open a file which name is longer than _MAX_PATH bytes
+     * and shorter than _MAX_PATH characters successfully, but sometimes it
+     * causes unexpected error in another part. We make it an error explicitly
+     * here. */
+    if (strlen(name) >= _MAX_PATH)
+	return NULL;
+
     return fopen(name, mode);
 }
 #endif
diff --git a/src/version.c b/src/version.c
index 4bbc221552..178a7845f2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    505,
 /**/
     504,
 /**/

From fd38f30082138647bb2ab75c13b95a60a9c3aeee Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 18:36:03 +0100
Subject: [PATCH 255/473] Added tag v7-4-505 for changeset 9bc6ce142cc3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a88134649b..2323977f36 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3227,3 +3227,4 @@ fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 7b28dc1d756e11bd7e25a19ffe272ac605613a40 v7-4-502
 094a87e76155fcbb43f7070eb605c2944192a7ff v7-4-503
 edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
+9bc6ce142cc385bb3d516ac5c2429dbaa3b32886 v7-4-505

From c4bbc6d8d64f35218aeda6ac46b1f3927f2b01cf Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 19:33:24 +0100
Subject: [PATCH 256/473] updated for version 7.4.506 Problem:    MS-Windows:
 Cannot open a file with 259 characters. Solution:   Fix off-by-one error.
 (Ken Takata)

---
 src/os_mswin.c | 2 +-
 src/version.c  | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/os_mswin.c b/src/os_mswin.c
index 0dfd7d6091..b50b86c888 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -411,7 +411,7 @@ mch_FullName(
 	     * - convert the result from UCS2 to 'encoding'.
 	     */
 	    wname = enc_to_utf16(fname, NULL);
-	    if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH - 1) != NULL)
+	    if (wname != NULL && _wfullpath(wbuf, wname, MAX_PATH) != NULL)
 	    {
 		cname = utf16_to_enc((short_u *)wbuf, NULL);
 		if (cname != NULL)
diff --git a/src/version.c b/src/version.c
index 178a7845f2..deaa7b556d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    506,
 /**/
     505,
 /**/

From f2cbd8ba4e36c091d5579f8e84759f96aba2a008 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 5 Nov 2014 19:33:24 +0100
Subject: [PATCH 257/473] Added tag v7-4-506 for changeset 79a667b879e7

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2323977f36..16fda67b40 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3228,3 +3228,4 @@ fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 094a87e76155fcbb43f7070eb605c2944192a7ff v7-4-503
 edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 9bc6ce142cc385bb3d516ac5c2429dbaa3b32886 v7-4-505
+79a667b879e70b81e21735997f5ce62372e37886 v7-4-506

From 18a0ef92a9a1e2cb0ee4beee451526b3cc6befe7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 6 Nov 2014 10:03:01 +0100
Subject: [PATCH 258/473] updated for version 7.4.507 Problem:    Building with
 MingW and Perl. Solution:   Remove quotes. (Ken Takata)

---
 src/Make_cyg_ming.mak | 4 ++--
 src/version.c         | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
index e4764c52bf..455750e33b 100644
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -132,7 +132,7 @@ XSUBPPTRY=$(PERLLIB)/ExtUtils/xsubpp
 endif
 XSUBPP_EXISTS=$(shell $(PERLEXE) -e "print 1 unless -e '$(XSUBPPTRY)'")
 ifeq "$(XSUBPP_EXISTS)" ""
-XSUBPP=$(PERLEXE) "$(XSUBPPTRY)"
+XSUBPP=$(PERLEXE) $(XSUBPPTRY)
 else
 XSUBPP=xsubpp
 endif
@@ -809,7 +809,7 @@ endif
 
 if_perl.c: if_perl.xs typemap
 	$(XSUBPP) -prototypes -typemap \
-	     "$(PERLTYPEMAP)" if_perl.xs > $@
+	     $(PERLTYPEMAP) if_perl.xs > $@
 
 $(OUTDIR)/netbeans.o:	netbeans.c $(INCL) $(NBDEBUG_INCL) $(NBDEBUG_SRC)
 	$(CC) -c $(CFLAGS) netbeans.c -o $(OUTDIR)/netbeans.o
diff --git a/src/version.c b/src/version.c
index deaa7b556d..329bcd2aa8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    507,
 /**/
     506,
 /**/

From 4270437ec3d50fb0d893c5e18e62f4601b50bbe9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 6 Nov 2014 10:03:01 +0100
Subject: [PATCH 259/473] Added tag v7-4-507 for changeset 5b2ff413125b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 16fda67b40..58c12f48c2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3229,3 +3229,4 @@ fd4dc6581b0ee754af50afefcacc1e241a3f591c v7-4-500
 edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 9bc6ce142cc385bb3d516ac5c2429dbaa3b32886 v7-4-505
 79a667b879e70b81e21735997f5ce62372e37886 v7-4-506
+5b2ff413125bf62b31d34efe1c816ebc05d8d7c2 v7-4-507

From 728f395338580b07a6e28c25b27d014024c2eb3e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 13:07:53 +0100
Subject: [PATCH 260/473] updated for version 7.4.508 Problem:    When
 generating ja.sjis.po the header is not correctly adjusted. Solution:   Check
 for the right header string. (Ken Takata)

---
 src/po/sjiscorr.c | 3 +--
 src/version.c     | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/po/sjiscorr.c b/src/po/sjiscorr.c
index fec4740c04..b8f7e632ad 100644
--- a/src/po/sjiscorr.c
+++ b/src/po/sjiscorr.c
@@ -23,9 +23,8 @@ main(argc, argv)
 				fputs("charset=cp932", stdout);
 				p += 12;
 			}
-			else if (strncmp(p, "ja.po - Japanese message file", 29) == 0)
+			else if (strncmp(p, "# Original translations", 23) == 0)
 			{
-				fputs("ja.sjis.po - Japanese message file for Vim (version 6.x)\n", stdout);
 				fputs("# generated from ja.po, DO NOT EDIT", stdout);
 				while (p[1] != '\n')
 					++p;
diff --git a/src/version.c b/src/version.c
index 329bcd2aa8..76ab14690d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    508,
 /**/
     507,
 /**/

From 9f6132215cdef76e7f223e89301a5c6a33043b95 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 13:07:54 +0100
Subject: [PATCH 261/473] Added tag v7-4-508 for changeset 65df2fba429b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 58c12f48c2..d29b72581b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3230,3 +3230,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 9bc6ce142cc385bb3d516ac5c2429dbaa3b32886 v7-4-505
 79a667b879e70b81e21735997f5ce62372e37886 v7-4-506
 5b2ff413125bf62b31d34efe1c816ebc05d8d7c2 v7-4-507
+65df2fba429b6eba6b25e1fa9422342c73afc64c v7-4-508

From 31484a795a17756d711d838b61e68cef690272d6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 15:15:42 +0100
Subject: [PATCH 262/473] updated for version 7.4.509 Problem:    Users are not
 aware their encryption is weak. Solution:   Give a warning when prompting for
 the key.

---
 src/crypt.c         | 20 ++++++++++++++++++++
 src/ex_docmd.c      |  1 +
 src/fileio.c        |  1 +
 src/main.c          |  1 +
 src/proto/crypt.pro |  2 ++
 src/version.c       |  2 ++
 6 files changed, 27 insertions(+)

diff --git a/src/crypt.c b/src/crypt.c
index c54e15c4af..f25a2c4a9d 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -503,6 +503,26 @@ crypt_free_key(key)
     }
 }
 
+/*
+ * Check the crypt method and give a warning if it's outdated.
+ */
+    void
+crypt_check_method(method)
+    int method;
+{
+    if (method < CRYPT_M_BF2)
+    {
+	msg_scroll = TRUE;
+	MSG(_("Warning: Using a weak encryption method; see :help 'cm'"));
+    }
+}
+
+    void
+crypt_check_current_method()
+{
+    crypt_check_method(crypt_get_method_nr(curbuf));
+}
+
 /*
  * Ask the user for a crypt key.
  * When "store" is TRUE, the new key is stored in the 'key' option, and the
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 35e44f0f3c..e90a36ecc6 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -11524,6 +11524,7 @@ ex_match(eap)
 ex_X(eap)
     exarg_T	*eap UNUSED;
 {
+    crypt_check_current_method();
     (void)crypt_get_key(TRUE, TRUE);
 }
 #endif
diff --git a/src/fileio.c b/src/fileio.c
index 0843d04296..a978ec241d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2958,6 +2958,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
 		 * Happens when retrying to detect encoding. */
 		smsg((char_u *)_(need_key_msg), fname);
 		msg_scroll = TRUE;
+		crypt_check_method(method);
 		cryptkey = crypt_get_key(newfile, FALSE);
 		*did_ask = TRUE;
 
diff --git a/src/main.c b/src/main.c
index fe75495828..1814385197 100644
--- a/src/main.c
+++ b/src/main.c
@@ -854,6 +854,7 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
 #ifdef FEAT_CRYPT
     if (params.ask_for_key)
     {
+	crypt_check_current_method();
 	(void)crypt_get_key(TRUE, TRUE);
 	TIME_MSG("getting crypt key");
     }
diff --git a/src/proto/crypt.pro b/src/proto/crypt.pro
index d61df718bd..7b29026a1d 100644
--- a/src/proto/crypt.pro
+++ b/src/proto/crypt.pro
@@ -19,6 +19,8 @@ void crypt_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u
 void crypt_encode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
 void crypt_decode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len));
 void crypt_free_key __ARGS((char_u *key));
+void crypt_check_method __ARGS((int method));
+void crypt_check_current_method __ARGS((void));
 char_u *crypt_get_key __ARGS((int store, int twice));
 void crypt_append_msg __ARGS((buf_T *buf));
 /* vim: set ft=c : */
diff --git a/src/version.c b/src/version.c
index 76ab14690d..06c4016bec 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    509,
 /**/
     508,
 /**/

From 228d61e4a01b8c042b2203120ab09d05964da066 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 15:15:42 +0100
Subject: [PATCH 263/473] Added tag v7-4-509 for changeset 60659773c73b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d29b72581b..c93f7f1944 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3231,3 +3231,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 79a667b879e70b81e21735997f5ce62372e37886 v7-4-506
 5b2ff413125bf62b31d34efe1c816ebc05d8d7c2 v7-4-507
 65df2fba429b6eba6b25e1fa9422342c73afc64c v7-4-508
+60659773c73bc34f16340dba6f96f02f4664c7e7 v7-4-509

From 0a8a846b9dd2616538576cdc4af36f7a8133791e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 15:45:21 +0100
Subject: [PATCH 264/473] updated for version 7.4.510 Problem:    "-fwrapv"
 argument breaks use of cproto. Solution:   Remove the alphabetic arguments in
 a drastic way.

---
 src/Makefile  | 7 +++----
 src/version.c | 2 ++
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 39e2de99f9..6bf8c1737d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1779,13 +1779,12 @@ update-po:
 proto: $(PRO_AUTO) $(PRO_MANUAL)
 
 # Filter out arguments that cproto doesn't support.
-# Don't pass "-pthread" to cproto, it sees it as a list of individual flags.
-# Don't pass "-fstack-protector" to cproto, for the same reason.
-# Don't pass "-g" to cproto.
+# Don't pass "-pthread", "-fwrapv" and similar arguments to cproto, it sees
+# them as a list of individual flags.
 # The -E"gcc -E" argument must be separate to avoid problems with shell
 # quoting.
 CPROTO = cproto $(PROTO_FLAGS) -DPROTO \
-	 `echo '$(LINT_CFLAGS)' | sed -e 's/-pthread//g' -e 's/-fstack-protector//g' -e 's/\ -g\ / /g'`
+	 `echo '$(LINT_CFLAGS)' | sed -e 's/ -[a-z-]\+//g'`
 
 ### Would be nice if this would work for "normal" make.
 ### Currently it only works for (Free)BSD make.
diff --git a/src/version.c b/src/version.c
index 06c4016bec..89272be506 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    510,
 /**/
     509,
 /**/

From 310cb24801668995ba6548b0ea89aa637871c87a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 15:45:21 +0100
Subject: [PATCH 265/473] Added tag v7-4-510 for changeset 05850b74218b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c93f7f1944..613e0cb987 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3232,3 +3232,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 5b2ff413125bf62b31d34efe1c816ebc05d8d7c2 v7-4-507
 65df2fba429b6eba6b25e1fa9422342c73afc64c v7-4-508
 60659773c73bc34f16340dba6f96f02f4664c7e7 v7-4-509
+05850b74218baa3daa2f5a8c40e14d07e9371825 v7-4-510

From 3adb3c84f282571f7e16d7080dac9c0e54d3cba4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 16:05:04 +0100
Subject: [PATCH 266/473] updated for version 7.4.511 Problem:    Generating
 proto for if_ruby.c uses type not defined elsewhere. Solution:   Do not
 generate a prototype for 	    rb_gc_writebarrier_unprotect_promoted()

---
 src/if_ruby.c | 3 ++-
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/if_ruby.c b/src/if_ruby.c
index 06465bd5a7..9301b72927 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -418,7 +418,8 @@ VALUE rb_num2ulong(VALUE x)
 #  endif
 # endif
 
-# if defined(USE_RGENGC) && USE_RGENGC
+   /* Do not generate a prototype here, VALUE isn't always defined. */
+# if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
 {
     return dll_rb_gc_writebarrier_unprotect_promoted(obj);
diff --git a/src/version.c b/src/version.c
index 89272be506..f2b1ca7c5a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    511,
 /**/
     510,
 /**/

From 44c6afd3c5af7904abee3eb4add114bb4e554071 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 16:05:05 +0100
Subject: [PATCH 267/473] Added tag v7-4-511 for changeset 7623d953d3bc

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 613e0cb987..84c45b3d1f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3233,3 +3233,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 65df2fba429b6eba6b25e1fa9422342c73afc64c v7-4-508
 60659773c73bc34f16340dba6f96f02f4664c7e7 v7-4-509
 05850b74218baa3daa2f5a8c40e14d07e9371825 v7-4-510
+7623d953d3bc2973e7a40f5a28c8f2d7d16f7891 v7-4-511

From 6afa2b7ddb10a5e2f56a49af445509d2f9baa736 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 16:10:48 +0100
Subject: [PATCH 268/473] updated for version 7.4.512 Problem:    Cannot
 generate prototypes for Win32 files and VMS. Solution:   Add typedefs and
 #ifdef

---
 src/gui_w32.c  | 4 +++-
 src/os_vms.c   | 2 +-
 src/os_win32.c | 2 ++
 src/version.c  | 2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gui_w32.c b/src/gui_w32.c
index 374ed47258..b81a74df96 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -29,12 +29,14 @@
 # include "gui_dwrite.h"
 #endif
 
-#if defined(FEAT_DIRECTX) || defined(PROTO)
+#if defined(FEAT_DIRECTX)
 static DWriteContext *s_dwc = NULL;
 static int s_directx_enabled = 0;
 static int s_directx_load_attempted = 0;
 # define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL)
+#endif
 
+#if defined(FEAT_DIRECTX) || defined(PROTO)
     int
 directx_enabled(void)
 {
diff --git a/src/os_vms.c b/src/os_vms.c
index 55876b27fe..12eceedd0c 100644
--- a/src/os_vms.c
+++ b/src/os_vms.c
@@ -12,7 +12,7 @@
 #include	"vim.h"
 
 /* define _generic_64 for use in time functions */
-#ifndef VAX
+#if !defined(VAX) && !defined(PROTO)
 #   include <gen64def.h>
 #else
 /* based on Alpha's gen64def.h; the file is absent on VAX */
diff --git a/src/os_win32.c b/src/os_win32.c
index fcfafa01e8..939563805a 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -135,6 +135,8 @@ typedef int BY_HANDLE_FILE_INFORMATION;
 typedef int SE_OBJECT_TYPE;
 typedef int PSNSECINFO;
 typedef int PSNSECINFOW;
+typedef int STARTUPINFO;
+typedef int PROCESS_INFORMATION;
 #endif
 
 #ifndef FEAT_GUI_W32
diff --git a/src/version.c b/src/version.c
index f2b1ca7c5a..2aaef3cc8a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    512,
 /**/
     511,
 /**/

From 04af9b2a089009459b4eb39d7472e2a6d70897e1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 16:10:48 +0100
Subject: [PATCH 269/473] Added tag v7-4-512 for changeset 9f9058aeba0d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 84c45b3d1f..9fd872a562 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3234,3 +3234,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 60659773c73bc34f16340dba6f96f02f4664c7e7 v7-4-509
 05850b74218baa3daa2f5a8c40e14d07e9371825 v7-4-510
 7623d953d3bc2973e7a40f5a28c8f2d7d16f7891 v7-4-511
+9f9058aeba0d41d264c1ec1ef6ee4cee5aaa8ab6 v7-4-512

From e7983309822173db1b06f119f19636ac8350efee Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 18:49:16 +0100
Subject: [PATCH 270/473] updated for version 7.4.513 Problem:    Crash because
 reference count is wrong for list returned by 	    getreg(). Solution:  
 Increment the reference count. (Kimmy Lindvall)

---
 src/eval.c    | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/eval.c b/src/eval.c
index ba456f2bc2..ea24a9c37f 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -12008,6 +12008,8 @@ f_getreg(argvars, rettv)
 	rettv->v_type = VAR_LIST;
 	rettv->vval.v_list = (list_T *)get_reg_contents(regname,
 				      (arg2 ? GREG_EXPR_SRC : 0) | GREG_LIST);
+	if (rettv->vval.v_list != NULL)
+	    ++rettv->vval.v_list->lv_refcount;
     }
     else
     {
diff --git a/src/version.c b/src/version.c
index 2aaef3cc8a..df18f5e962 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    513,
 /**/
     512,
 /**/

From 429e8977b81a749240705207ab74f8461b20cfbf Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 18:49:16 +0100
Subject: [PATCH 271/473] Added tag v7-4-513 for changeset 6ad9facba57d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9fd872a562..54304610cd 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3235,3 +3235,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 05850b74218baa3daa2f5a8c40e14d07e9371825 v7-4-510
 7623d953d3bc2973e7a40f5a28c8f2d7d16f7891 v7-4-511
 9f9058aeba0d41d264c1ec1ef6ee4cee5aaa8ab6 v7-4-512
+6ad9facba57daad4c68b8d1cb3a8efe12d6ae4a9 v7-4-513

From 752b10995ca40c1836289df0a2ef6fb21e33cc1b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 18:59:25 +0100
Subject: [PATCH 272/473] updated for version 7.4.514 Problem:    Memory access
 error. (Dominique Pelle) Solution:   Update tpos. (Christian Brabandt)

---
 src/edit.c    | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/edit.c b/src/edit.c
index ee63daa1c7..13faafeb78 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -6918,6 +6918,8 @@ stop_insert(end_insert_pos, esc, nomove)
 		curwin->w_cursor = tpos;
 	    else
 	    {
+		/* reset tpos, could have been invalidated in the loop above */
+		tpos = curwin->w_cursor;
 		tpos.col++;
 		if (cc != NUL && gchar_pos(&tpos) == NUL)
 		    ++curwin->w_cursor.col;	/* put cursor back on the NUL */
diff --git a/src/version.c b/src/version.c
index df18f5e962..5ca2f2723c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    514,
 /**/
     513,
 /**/

From f1957ad7bdace5d57e7bd537c7d1e6ebfeffcb69 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 18:59:25 +0100
Subject: [PATCH 273/473] Added tag v7-4-514 for changeset e6c5ff35500d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 54304610cd..ad98f79756 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3236,3 +3236,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 7623d953d3bc2973e7a40f5a28c8f2d7d16f7891 v7-4-511
 9f9058aeba0d41d264c1ec1ef6ee4cee5aaa8ab6 v7-4-512
 6ad9facba57daad4c68b8d1cb3a8efe12d6ae4a9 v7-4-513
+e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514

From f4990a3bbad1abcb5e9ff4daf906dedeb63abaeb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 19:28:16 +0100
Subject: [PATCH 274/473] updated for version 7.4.515 Problem:    In a help
 buffer the global 'foldmethod' is used.  (Paul Marshall) Solution:   Reset
 'foldmethod' when starting to edit a help file.  Move the 	    code to a
 separate function.

---
 src/ex_cmds.c | 130 +++++++++++++++++++++++++++-----------------------
 src/version.c |   2 +
 2 files changed, 72 insertions(+), 60 deletions(-)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index b8076fc37b..1114f85345 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -34,6 +34,7 @@ static int
     _RTLENTRYF
 #endif
 	help_compare __ARGS((const void *s1, const void *s2));
+static void prepare_help_buffer __ARGS((void));
 
 /*
  * ":ascii" and "ga".
@@ -3531,71 +3532,15 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
 	oldbuf = (flags & ECMD_OLDBUF);
     }
 
-    if ((flags & ECMD_SET_HELP) || keep_help_flag)
-    {
-	char_u	*p;
-
-	curbuf->b_help = TRUE;
-#ifdef FEAT_QUICKFIX
-	set_string_option_direct((char_u *)"buftype", -1,
-				     (char_u *)"help", OPT_FREE|OPT_LOCAL, 0);
-#endif
-
-	/*
-	 * Always set these options after jumping to a help tag, because the
-	 * user may have an autocommand that gets in the way.
-	 * Accept all ASCII chars for keywords, except ' ', '*', '"', '|', and
-	 * latin1 word characters (for translated help files).
-	 * Only set it when needed, buf_init_chartab() is some work.
-	 */
-	p =
-#ifdef EBCDIC
-		(char_u *)"65-255,^*,^|,^\"";
-#else
-		(char_u *)"!-~,^*,^|,^\",192-255";
-#endif
-	if (STRCMP(curbuf->b_p_isk, p) != 0)
-	{
-	    set_string_option_direct((char_u *)"isk", -1, p,
-						       OPT_FREE|OPT_LOCAL, 0);
-	    check_buf_options(curbuf);
-	    (void)buf_init_chartab(curbuf, FALSE);
-	}
-
-	curbuf->b_p_ts = 8;		/* 'tabstop' is 8 */
-	curwin->w_p_list = FALSE;	/* no list mode */
-
-	curbuf->b_p_ma = FALSE;		/* not modifiable */
-	curbuf->b_p_bin = FALSE;	/* reset 'bin' before reading file */
-	curwin->w_p_nu = 0;		/* no line numbers */
-	curwin->w_p_rnu = 0;		/* no relative line numbers */
-	RESET_BINDING(curwin);		/* no scroll or cursor binding */
-#ifdef FEAT_ARABIC
-	curwin->w_p_arab = FALSE;	/* no arabic mode */
-#endif
-#ifdef FEAT_RIGHTLEFT
-	curwin->w_p_rl  = FALSE;	/* help window is left-to-right */
-#endif
-#ifdef FEAT_FOLDING
-	curwin->w_p_fen = FALSE;	/* No folding in the help window */
-#endif
-#ifdef FEAT_DIFF
-	curwin->w_p_diff = FALSE;	/* No 'diff' */
-#endif
-#ifdef FEAT_SPELL
-	curwin->w_p_spell = FALSE;	/* No spell checking */
-#endif
-
 #ifdef FEAT_AUTOCMD
-	buf = curbuf;
+    buf = curbuf;
 #endif
-	set_buflisted(FALSE);
+    if ((flags & ECMD_SET_HELP) || keep_help_flag)
+    {
+	prepare_help_buffer();
     }
     else
     {
-#ifdef FEAT_AUTOCMD
-	buf = curbuf;
-#endif
 	/* Don't make a buffer listed if it's a help buffer.  Useful when
 	 * using CTRL-O to go back to a help file. */
 	if (!curbuf->b_help)
@@ -6221,6 +6166,71 @@ find_help_tags(arg, num_matches, matches, keep_lang)
     return OK;
 }
 
+/*
+ * Called when starting to edit a buffer for a help file.
+ */
+    static void
+prepare_help_buffer()
+{
+    char_u	*p;
+
+    curbuf->b_help = TRUE;
+#ifdef FEAT_QUICKFIX
+    set_string_option_direct((char_u *)"buftype", -1,
+				     (char_u *)"help", OPT_FREE|OPT_LOCAL, 0);
+#endif
+
+    /*
+     * Always set these options after jumping to a help tag, because the
+     * user may have an autocommand that gets in the way.
+     * Accept all ASCII chars for keywords, except ' ', '*', '"', '|', and
+     * latin1 word characters (for translated help files).
+     * Only set it when needed, buf_init_chartab() is some work.
+     */
+    p =
+#ifdef EBCDIC
+	    (char_u *)"65-255,^*,^|,^\"";
+#else
+	    (char_u *)"!-~,^*,^|,^\",192-255";
+#endif
+    if (STRCMP(curbuf->b_p_isk, p) != 0)
+    {
+	set_string_option_direct((char_u *)"isk", -1, p, OPT_FREE|OPT_LOCAL, 0);
+	check_buf_options(curbuf);
+	(void)buf_init_chartab(curbuf, FALSE);
+    }
+
+    /* Don't use the global foldmethod.*/
+    set_string_option_direct((char_u *)"fdm", -1, (char_u *)"manual",
+						       OPT_FREE|OPT_LOCAL, 0);
+
+    curbuf->b_p_ts = 8;		/* 'tabstop' is 8 */
+    curwin->w_p_list = FALSE;	/* no list mode */
+
+    curbuf->b_p_ma = FALSE;		/* not modifiable */
+    curbuf->b_p_bin = FALSE;	/* reset 'bin' before reading file */
+    curwin->w_p_nu = 0;		/* no line numbers */
+    curwin->w_p_rnu = 0;		/* no relative line numbers */
+    RESET_BINDING(curwin);		/* no scroll or cursor binding */
+#ifdef FEAT_ARABIC
+    curwin->w_p_arab = FALSE;	/* no arabic mode */
+#endif
+#ifdef FEAT_RIGHTLEFT
+    curwin->w_p_rl  = FALSE;	/* help window is left-to-right */
+#endif
+#ifdef FEAT_FOLDING
+    curwin->w_p_fen = FALSE;	/* No folding in the help window */
+#endif
+#ifdef FEAT_DIFF
+    curwin->w_p_diff = FALSE;	/* No 'diff' */
+#endif
+#ifdef FEAT_SPELL
+    curwin->w_p_spell = FALSE;	/* No spell checking */
+#endif
+
+    set_buflisted(FALSE);
+}
+
 /*
  * After reading a help file: May cleanup a help buffer when syntax
  * highlighting is not used.
diff --git a/src/version.c b/src/version.c
index 5ca2f2723c..2f524c85d6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    515,
 /**/
     514,
 /**/

From ceb54e5fb2401bf8cebc9ea58c7e5b9ad7bd517d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 19:28:16 +0100
Subject: [PATCH 275/473] Added tag v7-4-515 for changeset 387e63680524

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ad98f79756..5f90e61aa5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3237,3 +3237,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 9f9058aeba0d41d264c1ec1ef6ee4cee5aaa8ab6 v7-4-512
 6ad9facba57daad4c68b8d1cb3a8efe12d6ae4a9 v7-4-513
 e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
+387e636805243f4ade8da63fa7c115dec64aa56e v7-4-515

From 064fca754d649a334f42d9db732d8c7b7539c820 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 20:09:06 +0100
Subject: [PATCH 276/473] updated for version 7.4.516 Problem:    Completing a
 function name containing a # does not work.  Issue 	    253. Solution:  
 Recognize the # character. (Christian Brabandt)

---
 src/eval.c    | 4 ++--
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index ea24a9c37f..1b1072cd80 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -3368,11 +3368,11 @@ set_context_for_expression(xp, arg, cmdidx)
 	    got_eq = TRUE;
 	    xp->xp_context = EXPAND_EXPRESSION;
 	}
-	else if (c == '<'
+	else if ((c == '<' || c == '#')
 		&& xp->xp_context == EXPAND_FUNCTIONS
 		&& vim_strchr(xp->xp_pattern, '(') == NULL)
 	{
-	    /* Function name can start with "<SNR>" */
+	    /* Function name can start with "<SNR>" and contain '#'. */
 	    break;
 	}
 	else if (cmdidx != CMD_let || got_eq)
diff --git a/src/version.c b/src/version.c
index 2f524c85d6..826679ef38 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    516,
 /**/
     515,
 /**/

From 991eb28c519105e8d18f0859da969eb5c4533f90 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 12 Nov 2014 20:09:07 +0100
Subject: [PATCH 277/473] Added tag v7-4-516 for changeset 81c9b19ee0fb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5f90e61aa5..3353883d63 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3238,3 +3238,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 6ad9facba57daad4c68b8d1cb3a8efe12d6ae4a9 v7-4-513
 e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 387e636805243f4ade8da63fa7c115dec64aa56e v7-4-515
+81c9b19ee0fb867a8364f73bdcc865676220cb0b v7-4-516

From e6c2b15a81c9c803b279416f7a9947d46fdc58f8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 13 Nov 2014 14:25:38 +0100
Subject: [PATCH 278/473] Update runtime files.

---
 runtime/doc/editing.txt  | 12 +++++------
 runtime/doc/eval.txt     |  4 ++--
 runtime/doc/options.txt  |  2 ++
 runtime/doc/tags         |  2 ++
 runtime/doc/todo.txt     | 43 ++++++++++++++++++++--------------------
 runtime/ftplugin/man.vim |  6 ++++--
 runtime/indent/lua.vim   |  4 ++--
 runtime/syntax/diff.vim  |  4 ++--
 8 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index add3bb0878..b02f8faec2 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Sep 19
+*editing.txt*   For Vim version 7.4.  Last change: 2014 Nov 12
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1415,13 +1415,11 @@ Do this before writing the file.  When reading an encrypted file it will be
 set automatically to the method used when that file was written.  You can
 change 'cryptmethod' before writing that file to change the method.
 
-To set the default method, used for new files, use one of these in your
-|vimrc| file: >
-	set cm=zip
+To set the default method, used for new files, use this in your |vimrc| 
+file: >
 	set cm=blowfish2
-Use the first one if you need to be compatible with Vim 7.2 and older.  Using
-"blowfish2" is highly recommended if you can use a Vim version that supports
-it.
+Using "blowfish2" is highly recommended.  Only use another method if you
+must use an older Vim version that does not support it.
 
 The message given for reading and writing a file will show "[crypted]" when
 using zip, "[blowfish]" when using blowfish, etc.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 4e349a6e08..f21e051b6e 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Sep 27
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 05
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -4851,7 +4851,7 @@ readfile({fname} [, {binary} [, {max}]])
 		separated with CR will result in a single long line (unless a
 		NL appears somewhere).
 		All NUL characters are replaced with a NL character.
-		When {binary} is equal to "b" binary mode is used:
+		When {binary/append} is contains "b" binary mode is used:
 		- When the last line ends in a NL an extra empty list item is
 		  added.
 		- No CR characters are removed.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 525a08cdbe..72459b0fc5 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -4534,6 +4534,8 @@ A jump table for the options with a short description can be found at |Q_op|.
 	be able to execute Normal mode commands.
 	This is the opposite of the 'keymap' option, where characters are
 	mapped in Insert mode.
+	Also consider setting 'langnoremap' to avoid 'langmap' applies to
+	characters resulting from a mapping.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
 
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 460be9044e..9a23ce4cf9 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -392,6 +392,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 'kp'	options.txt	/*'kp'*
 'langmap'	options.txt	/*'langmap'*
 'langmenu'	options.txt	/*'langmenu'*
+'langnoremap'	options.txt	/*'langnoremap'*
 'laststatus'	options.txt	/*'laststatus'*
 'lazyredraw'	options.txt	/*'lazyredraw'*
 'lbr'	options.txt	/*'lbr'*
@@ -405,6 +406,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 'listchars'	options.txt	/*'listchars'*
 'lm'	options.txt	/*'lm'*
 'lmap'	options.txt	/*'lmap'*
+'lnr'	options.txt	/*'lnr'*
 'loadplugins'	options.txt	/*'loadplugins'*
 'lpl'	options.txt	/*'lpl'*
 'ls'	options.txt	/*'ls'*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 32b1f901c3..aa44d481d9 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 05
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 13
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -34,6 +34,8 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+Add langnoremap in quickref.txt and  optwin.vim.
+
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
@@ -73,6 +75,7 @@ Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
     Make ":+1close" close the next window.
     Make ":-1close" close the previous window.
 Doesn't look right, asked for updates.
+Update 2014 Nov 8. Replied with suggestions.
 
 C macro with number highlighted wrong. (Dominique Pelle, 2014 Oct 23)
 
@@ -81,30 +84,12 @@ set with setmatches(). (lcd47, 2014 Jun 29)
 
 Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
 
-Patch to add 'langnoremap'. (Christian Brabandt, 2014 Oct 15)
-Update Oct 20.
-
-Patch to add append mode to writefile(). (Yasuhiro Matsumoto, 2014 Nov 1)
-
-Remove restriction in NSIS installer that the end of the path must be "Vim".
-(Tim Lebedkov, 2014 Sep 24) Again Oct 12.  Now on issue 272.
-
-Fix that on MS-Windows MAX_PATH in bytes causes problems for file names
-between MAX_PATH and double that for double-byte encodings. (Ken Takata, 2014
-Oct 15)
-
-Another problem with MAX_PATH, off-by-one. (Ken Takata, 2014 Oct 21)
-
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-'foldexpr' applies to help. (Paul Marshall, 2014 Sep 24)
-
 Patch to fix issue 203. (Christian Brabandt, 2014 Oct 8)
 
-Patch to fix issue 253. (Christian Brabandt, 2014 Oct 8)
-
 Patch to fix issue 78. (Christian Brabandt, 2014 Oct 8)
 
 Patch to fix leak in map() with error. (Christian Brabandt, 2014 Oct 11)
@@ -113,9 +98,20 @@ Patch to fix incsearch for "2/pattern/e".
 
 Change behavior of v:hlsearch?  Patch from Christian, 2014 Oct 22.
 
+MS-Windows: When editing a file with a leading space, writing it uses the
+wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
+
+patch to remove FEAT_OSFILETYPE from fileio.c. (Christian, 2014 Nov 12)
+
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
+Fix for wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014 Nov
+12)
+
+Patch to support hex values for setting option value.
+(Zyx, 2015 Nov 6)
+
 On MS-Windows running tests with Mercurial has problems when the input files
 are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
 Update Nov 5.
@@ -123,6 +119,9 @@ Update Nov 5.
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
 
+Problem using diff syntax with cp932 encoding.  Idea from Yasuhiro Matsumoto,
+patch from Ken Takata (2014 Nov 6)
+
 ml_updatechunk() is slow when retrying for another encoding. (John Little,
 2014 Sep 11)
 
@@ -161,8 +160,10 @@ Patch from Jacob, Nov 2.
 "hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
 Jun 8)
 
-Patch to switch to the BT regexp engine when the NFA engine uses many states.
-(Christian Brabandt, 2014 Oct 3)
+Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not
+insert a space. (Micha Mos, 2014 Nov 7)
+
+Patch to add the :bvimgrep command.  (Christian Brabandt, 2014 Nov 12)
 
 Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
 
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index c6e1e9d4f7..11b2b0a665 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:	man
 " Maintainer:	SungHyun Nam <goweol@gmail.com>
-" Last Change:	2013 Jul 17
+" Last Change:	2014 Nov 12
 
 " To make the ":Man" command available before editing a manual page, source
 " this script from your startup vimrc file.
@@ -63,7 +63,9 @@ endtry
 func <SID>PreGetPage(cnt)
   if a:cnt == 0
     let old_isk = &iskeyword
-    setl iskeyword+=(,)
+    if &ft == 'man'
+      setl iskeyword+=(,)
+    endif
     let str = expand("<cword>")
     let &l:iskeyword = old_isk
     let page = substitute(str, '(*\(\k\+\).*', '\1', '')
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 21b02f1549..5f049d4585 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -2,7 +2,7 @@
 " Language:	Lua script
 " Maintainer:	Marcus Aurelius Farias <marcus.cf 'at' bol.com.br>
 " First Author:	Max Ischenko <mfi 'at' ukr.net>
-" Last Change:	2007 Jul 23
+" Last Change:	2014 Nov 12
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -54,7 +54,7 @@ function! GetLuaIndent()
 
   " Subtract a 'shiftwidth' on end, else (and elseif), until and '}'
   " This is the part that requires 'indentkeys'.
-  let midx = match(getline(v:lnum), '^\s*\%(end\|else\|until\|}\)')
+  let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|until\>\|}\)')
   if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
     let ind = ind - &shiftwidth
   endif
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
index aa5be3f6fe..a0005140b2 100644
--- a/runtime/syntax/diff.vim
+++ b/runtime/syntax/diff.vim
@@ -2,7 +2,7 @@
 " Language:	Diff (context or unified)
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
 "               Translations by Jakson Alves de Aquino.
-" Last Change:	2013 Oct 06
+" Last Change:	2014 Nov 12
 
 " Quit when a (custom) syntax file was already loaded
 if exists("b:current_syntax")
@@ -125,7 +125,7 @@ syn match diffIdentical	"^םיהז םניה .*-ו .* םיצבקה$"
 syn match diffDiffer	"^הזמ הז םינוש `.*'-ו `.*' םיצבקה$"
 syn match diffBDiffer	"^הזמ הז םינוש `.*'-ו `.*' םיירניב םיצבק$"
 syn match diffIsA	"^.* .*-ל .* .* תוושהל ןתינ אל$"
-syn match diffNoEOL	"^\\ ץבוקה ףוסב השדח-הרוש ות רסח"
+syn match diffNoEOL	"^\\ ץבוקה ףוסב השד.-הרוש ות רס."
 syn match diffCommon	"^.*-ו .* :תוהז תויקית-תת$"
 
 " hr

From e4878c52e1da5aabec86daf5c257cab9821449ad Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 13 Nov 2014 14:26:09 +0100
Subject: [PATCH 279/473] Update translations.

---
 src/po/eo.po        | 203 +++++++++------
 src/po/fr.po        | 616 +++++++++++++++++++++++++++++---------------
 src/po/ja.sjis.po   |   2 +-
 src/po/uk.cp1251.po | 153 ++++++++---
 src/po/uk.po        | 153 ++++++++---
 5 files changed, 775 insertions(+), 352 deletions(-)

diff --git a/src/po/eo.po b/src/po/eo.po
index 580c7ac797..2070991af7 100644
--- a/src/po/eo.po
+++ b/src/po/eo.po
@@ -23,8 +23,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Vim(Esperanto)\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-03-21 23:15+0100\n"
-"PO-Revision-Date: 2014-03-21 23:16+0100\n"
+"POT-Creation-Date: 2014-11-05 21:12+0100\n"
+"PO-Revision-Date: 2014-11-05 21:12+0100\n"
 "Last-Translator: Dominique PELLÉ <dominique.pelle@gmail.com>\n"
 "Language-Team: \n"
 "Language: eo\n"
@@ -42,10 +42,10 @@ msgid "E817: Blowfish big/little endian use wrong"
 msgstr "E817: Misuzo de pezkomenca/pezfina en blowfish"
 
 msgid "E818: sha256 test failed"
-msgstr "E818: Testo de sha256 fiaskis"
+msgstr "E818: Testo de sha256 malsukcesis"
 
 msgid "E819: Blowfish test failed"
-msgstr "E819: Testo de blowfish fiaskis"
+msgstr "E819: Testo de blowfish malsukcesis"
 
 msgid "[Location List]"
 msgstr "[Listo de lokoj]"
@@ -219,6 +219,21 @@ msgstr "Emfazaj simbolaĵoj de %s:"
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    linio=%ld  id=%d  nomo=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
+
+msgid "Enter encryption key: "
+msgstr "Tajpu la ŝlosilon de ĉifrado: "
+
+msgid "Enter same key again: "
+msgstr "Tajpu la ŝlosilon denove: "
+
+msgid "Keys don't match!"
+msgstr "Ŝlosiloj ne kongruas!"
+
+msgid "[crypted]"
+msgstr "[ĉifrita]"
+
 #, c-format
 msgid "E96: Can not diff more than %ld buffers"
 msgstr "E96: Ne eblas dosierdiferenci pli ol %ld bufrojn"
@@ -676,8 +691,14 @@ msgstr "E258: Ne eblas sendi al kliento"
 msgid "sort() argument"
 msgstr "argumento de sort()"
 
+msgid "uniq() argument"
+msgstr "argumento de uniq()"
+
 msgid "E702: Sort compare function failed"
-msgstr "E702: Ordiga funkcio fiaskis"
+msgstr "E702: Ordiga funkcio malsukcesis"
+
+msgid "E882: Uniq compare function failed"
+msgstr "E882: kompara funkcio de uniq() malsukcesis"
 
 msgid "(Invalid)"
 msgstr "(Nevalida)"
@@ -774,8 +795,12 @@ msgid "E129: Function name required"
 msgstr "E129: Nomo de funkcio bezonata"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr "E128: Nomo de funkcio devas eki per majusklo aŭ enhavi dupunkton: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr "E128: Nomo de funkcio devas eki per majusklo aŭ per \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Nomo de funkcio ne povas enhavi dupunkton: %s"
 
 #, c-format
 msgid "E131: Cannot delete function %s: It is in use"
@@ -877,7 +902,7 @@ msgid " oldfiles"
 msgstr " malnovaj dosieroj"
 
 msgid " FAILED"
-msgstr " FIASKIS"
+msgstr " MALSUKCESIS"
 
 #. avoid a wait_return for this message, it's annoying
 #, c-format
@@ -892,6 +917,10 @@ msgstr "E138: Ne eblas skribi dosieron viminfo %s!"
 msgid "Writing viminfo file \"%s\""
 msgstr "Skribas dosieron viminfo \"%s\""
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Ne eblas renomi dosieron viminfo al %s!"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1093,6 +1122,10 @@ msgstr "E158: Nevalida nomo de bufro: %s"
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: Nevalida identigilo de simbolo: %ld"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Ne eblas ŝanĝi simbolon %s"
+
 msgid " (NOT FOUND)"
 msgstr "  (NETROVITA)"
 
@@ -1679,12 +1712,6 @@ msgstr "[NE konvertita]"
 msgid "[converted]"
 msgstr "[konvertita]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[ĉifrita]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[ERARO DE KONVERTO en linio %ld]"
@@ -1700,14 +1727,11 @@ msgid "Can't find temp file for conversion"
 msgstr "Ne eblas trovi provizoran dosieron por konverti"
 
 msgid "Conversion with 'charconvert' failed"
-msgstr "Konverto kun 'charconvert' fiaskis"
+msgstr "Konverto kun 'charconvert' malsukcesis"
 
 msgid "can't read output of 'charconvert'"
 msgstr "ne eblas legi la eligon de 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Dosiero estas ĉifrata per nekonata metodo"
-
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: Neniu kongrua aŭtokomando por la bufro acwrite"
 
@@ -1764,21 +1788,22 @@ msgstr "E212: Ne eblas malfermi la dosieron por skribi"
 
 # AM: fsync: ne traduku (nomo de C-komando)
 msgid "E667: Fsync failed"
-msgstr "E667: Fsync fiaskis"
+msgstr "E667: Fsync malsukcesis"
 
 msgid "E512: Close failed"
-msgstr "E512: Fermo fiaskis"
+msgstr "E512: Fermo malsukcesis"
 
 msgid "E513: write error, conversion failed (make 'fenc' empty to override)"
-msgstr "E513: skriberaro, konverto fiaskis (igu 'fenc' malplena por transpasi)"
+msgstr ""
+"E513: skriberaro, konverto malsukcesis (igu 'fenc' malplena por transpasi)"
 
 #, c-format
 msgid ""
 "E513: write error, conversion failed in line %ld (make 'fenc' empty to "
 "override)"
 msgstr ""
-"E513: skriberaro, konverto fiaskis en linio %ld (igu 'fenc' malplena  por "
-"transpasi)"
+"E513: skriberaro, konverto malsukcesis en linio %ld (igu 'fenc' malplena  "
+"por transpasi)"
 
 msgid "E514: write error (file system full?)"
 msgstr "E514: skriberaro (ĉu plena dosiersistemo?)"
@@ -2052,10 +2077,10 @@ msgid "E228: makemap: Illegal mode"
 msgstr "E228: makemap: Nevalida reĝimo"
 
 msgid "E851: Failed to create a new process for the GUI"
-msgstr "E851: Ne sukcesis krei novan procezon por la grafika interfaco"
+msgstr "E851: Malsukcesis krei novan procezon por la grafika interfaco"
 
 msgid "E852: The child process failed to start the GUI"
-msgstr "E852: La ida procezo ne sukcesis startigi la grafikan interfacon"
+msgstr "E852: La ida procezo malsukcesis startigi la grafikan interfacon"
 
 msgid "E229: Cannot start the GUI"
 msgstr "E229: Ne eblas lanĉi la grafikan interfacon"
@@ -2414,7 +2439,7 @@ msgid "Sending to printer..."
 msgstr "Sendas al presilo..."
 
 msgid "E365: Failed to print PostScript file"
-msgstr "E365: Presado de PostSkripta dosiero fiaskis"
+msgstr "E365: Presado de PostSkripta dosiero malsukcesis"
 
 msgid "Print job sent."
 msgstr "Laboro de presado sendita."
@@ -2479,16 +2504,16 @@ msgid "E622: Could not fork for cscope"
 msgstr "E622: Ne eblis forki cscope"
 
 msgid "cs_create_connection setpgid failed"
-msgstr "plenumo de cs_create_connection-setgpid fiaskis"
+msgstr "plenumo de cs_create_connection-setgpid malsukcesis"
 
 msgid "cs_create_connection exec failed"
-msgstr "plenumo de cs_create_connection fiaskis"
+msgstr "plenumo de cs_create_connection malsukcesis"
 
 msgid "cs_create_connection: fdopen for to_fp failed"
-msgstr "cs_create_connection: fdopen de to_fp fiaskis"
+msgstr "cs_create_connection: fdopen de to_fp malsukcesis"
 
 msgid "cs_create_connection: fdopen for fr_fp failed"
-msgstr "cs_create_connection: fdopen de fr_fp fiaskis"
+msgstr "cs_create_connection: fdopen de fr_fp malsukcesis"
 
 msgid "E623: Could not spawn cscope process"
 msgstr "E623: Ne eblis naskigi procezon cscope"
@@ -2655,6 +2680,13 @@ msgstr ""
 "E263: Bedaŭrinde tiu komando estas malŝaltita: la biblioteko de Pitono ne "
 "ŝargeblis."
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887` Bedaŭrinde tiu komando estas malŝaltita: la biblioteko de Pitono ne "
+"ŝargeblis."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: Ne eblas alvoki Pitonon rekursie"
 
@@ -2860,7 +2892,7 @@ msgid "Unable to register a command server name"
 msgstr "Ne eblas registri nomon de komanda servilo"
 
 msgid "E248: Failed to send command to the destination program"
-msgstr "E248: Sendo de komando al cela programo fiaskis"
+msgstr "E248: Sendo de komando al cela programo malsukcesis"
 
 #, c-format
 msgid "E573: Invalid server id used: %s"
@@ -2911,7 +2943,7 @@ msgid "Cannot open for script output: \""
 msgstr "Ne eblas malfermi por eligo de skripto: \""
 
 msgid "Vim: Error: Failure to start gvim from NetBeans\n"
-msgstr "Vim: Eraro: Fiaskis lanĉi gvim el NetBeans\n"
+msgstr "Vim: Eraro: malsukcesis lanĉi gvim el NetBeans\n"
 
 msgid "Vim: Warning: Output is not to a terminal\n"
 msgstr "Vim: Averto: Eligo ne estas al terminalo\n"
@@ -3280,21 +3312,21 @@ msgstr "Neniu ekrano"
 
 #. Failed to send, abort.
 msgid ": Send failed.\n"
-msgstr ": Sendo fiaskis.\n"
+msgstr ": Sendo malsukcesis.\n"
 
 #. Let vim start normally.
 msgid ": Send failed. Trying to execute locally\n"
-msgstr ": Sendo fiaskis. Provo de loka plenumo\n"
+msgstr ": Sendo malsukcesis. Provo de loka plenumo\n"
 
 #, c-format
 msgid "%d of %d edited"
 msgstr "%d de %d redaktita(j)"
 
 msgid "No display: Send expression failed.\n"
-msgstr "Neniu ekrano: Sendado de esprimo fiaskis.\n"
+msgstr "Neniu ekrano: Sendado de esprimo malsukcesis.\n"
 
 msgid ": Send expression failed.\n"
-msgstr ": Sendado de esprimo fiaskis.\n"
+msgstr ": Sendado de esprimo malsukcesis.\n"
 
 msgid "No marks set"
 msgstr "Neniu marko"
@@ -3359,10 +3391,10 @@ msgid "E284: Cannot set IC values"
 msgstr "E284: Ne eblas agordi valorojn de IC"
 
 msgid "E285: Failed to create input context"
-msgstr "E285: Ne eblis krei enigan kuntekston"
+msgstr "E285: Kreado de eniga kunteksto malsukcesis"
 
 msgid "E286: Failed to open input method"
-msgstr "E286: Ne eblis malfermi enigan metodon"
+msgstr "E286: Malfermo de eniga metodo malsukcesis"
 
 msgid "E287: Warning: Could not set destroy callback to IM"
 msgstr "E287: Averto: Ne eblis agordi detruan reagfunkcion al IM"
@@ -3689,7 +3721,7 @@ msgid "File preserved"
 msgstr "Dosiero konservita"
 
 msgid "E314: Preserve failed"
-msgstr "E314: Konservo fiaskis"
+msgstr "E314: Konservo malsukcesis"
 
 #, c-format
 msgid "E315: ml_get: invalid lnum: %ld"
@@ -3967,7 +3999,7 @@ msgid "E766: Insufficient arguments for printf()"
 msgstr "E766: Ne sufiĉaj argumentoj por printf()"
 
 msgid "E807: Expected Float argument for printf()"
-msgstr "E807: Atendis Glitpunktnombron kiel argumento de printf()"
+msgstr "E807: Atendis Glitpunktnombron kiel argumenton de printf()"
 
 msgid "E767: Too many arguments to printf()"
 msgstr "E767: Tro da argumentoj al printf()"
@@ -4052,15 +4084,6 @@ msgstr "E548: cifero atendata"
 msgid "E549: Illegal percentage"
 msgstr "E549: Nevalida procento"
 
-msgid "Enter encryption key: "
-msgstr "Tajpu la ŝlosilon de ĉifrado: "
-
-msgid "Enter same key again: "
-msgstr "Tajpu la ŝlosilon denove: "
-
-msgid "Keys don't match!"
-msgstr "Ŝlosiloj ne kongruas!"
-
 msgid "E854: path too long for completion"
 msgstr "E854: tro longa vojo por kompletigo"
 
@@ -4232,6 +4255,12 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: Nekonata tipo de reĝistro %d"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: serĉa ŝablono kaj esprima reĝistro ne povas enhavi du aŭ pliajn liniojn"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "%ld Kolumnoj; "
@@ -4368,7 +4397,7 @@ msgid "E541: too many items"
 msgstr "E541: tro da elementoj"
 
 msgid "E542: unbalanced groups"
-msgstr "E542: misekvilibritaj grupoj"
+msgstr "E542: misekvilibraj grupoj"
 
 msgid "E590: A preview window already exists"
 msgstr "E590: Antaŭvida fenestro jam ekzistas"
@@ -4486,10 +4515,10 @@ msgid "Message"
 msgstr "Mesaĝo"
 
 msgid "'columns' is not 80, cannot execute external commands"
-msgstr "'columns' ne estas 80, ne eblas plenumi eksternajn komandojn"
+msgstr "'columns' ne estas 80, ne eblas plenumi eksterajn komandojn"
 
 msgid "E237: Printer selection failed"
-msgstr "E237: Elekto de presilo fiaskis"
+msgstr "E237: Elekto de presilo malsukcesis"
 
 #, c-format
 msgid "to %s on %s"
@@ -4527,7 +4556,7 @@ msgstr ""
 "Vim: Alvenis X eraro\n"
 
 msgid "Testing the X display failed"
-msgstr "Testo de la vidigo X fiaskis"
+msgstr "Testo de la vidigo X malsukcesis"
 
 msgid "Opening the X display timed out"
 msgstr "Tempolimo okazis dum malfermo de vidigo X"
@@ -4546,6 +4575,19 @@ msgstr ""
 "\n"
 "Ne povis ŝalti kuntekston de sekureco por "
 
+msgid "Could not set security context "
+msgstr "Ne povis akiri kuntekston de sekureco "
+
+msgid " for "
+msgstr " por "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Ne povis akiri kuntekston de sekureco "
+
+msgid ". Removing it!\n"
+msgstr ". Ĝi estas foriganta!\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -4596,7 +4638,7 @@ msgid "dlerror = \"%s\""
 msgstr "dlerror = \"%s\""
 
 msgid "Opening the X display failed"
-msgstr "Malfermo de vidigo X fiaskis"
+msgstr "Malfermo de vidigo X malsukcesis"
 
 msgid "XSMP handling save-yourself request"
 msgstr "XSMP: traktado de peto konservi-mem"
@@ -4605,11 +4647,11 @@ msgid "XSMP opening connection"
 msgstr "XSMP: malfermo de konekto"
 
 msgid "XSMP ICE connection watch failed"
-msgstr "XSMP: kontrolo de konekto ICE fiaskis"
+msgstr "XSMP: kontrolo de konekto ICE malsukcesis"
 
 #, c-format
 msgid "XSMP SmcOpenConnection failed: %s"
-msgstr "XSMP: SmcOpenConnection fiaskis: %s"
+msgstr "XSMP: SmcOpenConnection malsukcesis: %s"
 
 msgid "At line"
 msgstr "Ĉe linio"
@@ -4816,6 +4858,10 @@ msgstr "E554: Sintaksa eraro en %s{...}"
 msgid "External submatches:\n"
 msgstr "Eksteraj subkongruoj:\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA-regulesprimo) ne eblas ripeti %s"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
@@ -4823,6 +4869,9 @@ msgstr ""
 "E864: \\%#= povas nur esti sekvita de 0, 1, aŭ 2. La aŭtomata motoro de "
 "regulesprimo estos uzata "
 
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Ŝangota al malavanca motoro de regulesprimo por ŝablono: "
+
 msgid "E865: (NFA) Regexp end encountered prematurely"
 msgstr "E865: (NFA) Trovis finon de regulesprimo tro frue"
 
@@ -5547,7 +5596,7 @@ msgstr "E412: Ne sufiĉaj argumentoj: \":highlight link %s\""
 
 #, c-format
 msgid "E413: Too many arguments: \":highlight link %s\""
-msgstr "E413: Tro argumentoj: \":highlight link %s\""
+msgstr "E413: Tro da argumentoj: \":highlight link %s\""
 
 msgid "E414: group has settings, highlight link ignored"
 msgstr "E414: grupo havas agordojn, ligilo de emfazo ignorita"
@@ -5788,7 +5837,7 @@ msgstr "E832: Ne ĉifrata dosiero havas ĉifratan malfaran dosieron: %s"
 
 #, c-format
 msgid "E826: Undo file decryption failed: %s"
-msgstr "E826: Malĉifrado de malfara dosiero fiaskis: %s"
+msgstr "E826: Malĉifrado de malfara dosiero malsukcesis: %s"
 
 #, c-format
 msgid "E827: Undo file is encrypted: %s"
@@ -6228,6 +6277,9 @@ msgstr "E446: Neniu dosiernomo sub la kursoro"
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: Ne eblas trovi dosieron \"%s\" en serĉvojo"
 
+msgid "List or number required"
+msgstr "Listo aŭ nombro bezonata"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: Ne eblis ŝargi bibliotekon %s"
@@ -6314,7 +6366,7 @@ msgid "E13: File exists (add ! to override)"
 msgstr "E13: Dosiero ekzistas (aldonu ! por transpasi)"
 
 msgid "E472: Command failed"
-msgstr "E472: La komando fiaskis"
+msgstr "E472: La komando malsukcesis"
 
 #, c-format
 msgid "E234: Unknown fontset: %s"
@@ -6360,7 +6412,7 @@ msgstr "E17: \"%s\" estas dosierujo"
 
 #, c-format
 msgid "E364: Library call failed for \"%s()\""
-msgstr "E364: Alvoko al biblioteko fiaskis por \"%s()\""
+msgstr "E364: Alvoko al biblioteko malsukcesis por \"%s()\""
 
 #, c-format
 msgid "E448: Could not load library function %s"
@@ -6630,7 +6682,7 @@ msgstr "listo estas ŝlosita"
 
 #, c-format
 msgid "failed to add key '%s' to dictionary"
-msgstr "aldono de ŝlosilo '%s' al vortaro fiaskis"
+msgstr "aldono de ŝlosilo '%s' al vortaro malsukcesis"
 
 #, c-format
 msgid "index must be int or slice, not %s"
@@ -6676,7 +6728,7 @@ msgid "E264: Python: Error initialising I/O objects"
 msgstr "E264: Pitono: Eraro de pravalorizo de eneligaj objektoj"
 
 msgid "failed to change directory"
-msgstr "ne povis ŝanĝi dosierujon"
+msgstr "malsukcesis ŝanĝi dosierujon"
 
 #, c-format
 msgid "expected 3-tuple as imp.find_module() result, but got %s"
@@ -6715,7 +6767,7 @@ msgstr "indekso de listo ekster limoj"
 #. No more suitable format specifications in python-2.3
 #, c-format
 msgid "internal error: failed to get vim list item %d"
-msgstr "interna eraro: obteno de vim-a listero %d fiaskis"
+msgstr "interna eraro: obteno de vim-a listero %d malsukcesis"
 
 msgid "slice step cannot be zero"
 msgstr "paŝo de sekco ne povas esti nul"
@@ -6732,14 +6784,14 @@ msgid "internal error: not enough list items"
 msgstr "interna eraro: ne sufiĉaj listeroj"
 
 msgid "internal error: failed to add item to list"
-msgstr "interna eraro: aldono de listero fiaskis"
+msgstr "interna eraro: aldono de listero malsukcesis"
 
 #, c-format
 msgid "attempt to assign sequence of size %d to extended slice of size %d"
 msgstr "provis valorizi sekvencon kun %d eroj al etendita sekco kun %d eroj"
 
 msgid "failed to add item to list"
-msgstr "aldono de listero fiaskis"
+msgstr "aldono de listero malsukcesis"
 
 msgid "cannot delete vim.List attributes"
 msgstr "ne eblas forviŝi atributojn de 'vim.List'"
@@ -6760,10 +6812,10 @@ msgstr "konstruilo de funkcio ne akceptas ŝlosilvortajn argumentojn"
 
 #, c-format
 msgid "failed to run function %s"
-msgstr "fiaskis ruli funkcion %s"
+msgstr "malsukcesis ruli funkcion %s"
 
 msgid "unable to get option value"
-msgstr "fiaskis akiri valoron de opcio"
+msgstr "malsukcesis akiri valoron de opcio"
 
 msgid "internal error: unknown option type"
 msgstr "interna eraro: nekonata tipo de opcio"
@@ -6801,7 +6853,7 @@ msgid "attempt to refer to deleted buffer"
 msgstr "provo de referenco al forviŝita bufro"
 
 msgid "failed to rename buffer"
-msgstr "ne povis renomi bufron"
+msgstr "malsukcesis renomi bufron"
 
 msgid "mark name must be a single character"
 msgstr "nomo de marko devas esti unuopa signo"
@@ -6812,14 +6864,14 @@ msgstr "atendis objekton vim.Buffer, sed ricevis %s"
 
 #, c-format
 msgid "failed to switch to buffer %d"
-msgstr "ne povis salti al la bufro %d"
+msgstr "salto al la bufro %d malsukcesis"
 
 #, c-format
 msgid "expected vim.Window object, but got %s"
 msgstr "atendis objekton vim.window, sed ricevis %s"
 
 msgid "failed to find window in the current tab page"
-msgstr "ne povis trovi vindozon en la nuna langeto"
+msgstr "malsukcesis trovi vindozon en la nuna langeto"
 
 msgid "did not switch to the specified window"
 msgstr "ne saltis al la specifita vindozo"
@@ -6832,13 +6884,13 @@ msgid "did not switch to the specified tab page"
 msgstr "ne saltis al la specifita langeto"
 
 msgid "failed to run the code"
-msgstr "fiaskis ruli la kodon"
+msgstr "malsukcesis ruli la kodon"
 
 msgid "E858: Eval did not return a valid python object"
 msgstr "E858: Eval ne revenis kun valida python-objekto"
 
 msgid "E859: Failed to convert returned python object to vim value"
-msgstr "E859: Konverto de revena python-objekto al vim-valoro fiaskis"
+msgstr "E859: Konverto de revena python-objekto al vim-valoro malsukcesis"
 
 #, c-format
 msgid "unable to convert %s to vim dictionary"
@@ -6860,7 +6912,7 @@ msgid ""
 "- append vim.path_hook to sys.path_hooks\n"
 "- append vim.VIM_SPECIAL_PATH to sys.path\n"
 msgstr ""
-"Fiaskis valorizi sys.path_hooks: sys.path_hooks ne estas listo\n"
+"Valorizo de sys.path_hooks malsukcesis: sys.path_hooks ne estas listo\n"
 "Vi nun devas fari tion:\n"
 "- postaldoni vim.path_hook al sys.path_hooks\n"
 "- postaldoni vim.VIM_SPECIAL_PATH al sys.path\n"
@@ -6869,5 +6921,8 @@ msgid ""
 "Failed to set path: sys.path is not a list\n"
 "You should now append vim.VIM_SPECIAL_PATH to sys.path"
 msgstr ""
-"Ne povis agordi serĉvojon: sys.path ne estas listo\n"
+"Agordo de serĉvojo malsukcesis: sys.path ne estas listo\n"
 "Vi nun devas aldoni vim.VIM_SPECIAL_PATH al sys.path"
+
+#~ msgid "[blowfish]"
+#~ msgstr "[blowfish]"
diff --git a/src/po/fr.po b/src/po/fr.po
index fe466b301f..0ae8327cf7 100644
--- a/src/po/fr.po
+++ b/src/po/fr.po
@@ -6,7 +6,7 @@
 #  FIRST AUTHOR  DindinX         <David.Odin@bigfoot.com>     2000.
 # SECOND AUTHOR  Adrien Beau     <version.francaise@free.fr>  2002, 2003.
 #  THIRD AUTHOR  David Blanchet  <david.blanchet@free.fr>     2006, 2008.
-# FOURTH AUTHOR  Dominique Pell� <dominique.pelle@gmail.com>  2008, 2013.
+# FOURTH AUTHOR  Dominique Pell� <dominique.pelle@gmail.com>  2008, 2014.
 #
 # Latest translation available at:
 #   http://dominique.pelle.free.fr/vim-fr.php
@@ -15,8 +15,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Vim(Fran�ais)\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-05-27 04:55+0200\n"
-"PO-Revision-Date: 2013-05-27 10:22+0200\n"
+"POT-Creation-Date: 2014-11-05 21:12+0100\n"
+"PO-Revision-Date: 2014-11-05 21:23+0100\n"
 "Last-Translator: Dominique Pell� <dominique.pelle@gmail.com>\n"
 "Language-Team: \n"
 "Language: fr\n"
@@ -90,6 +90,9 @@ msgstr "1 tampon a 
 msgid "%d buffers wiped out"
 msgstr "%d tampons ont �t� d�truits"
 
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Impossible de d�charger le dernier tampon"
+
 # AB - La version fran�aise est meilleure que la version anglaise.
 msgid "E84: No modified buffer found"
 msgstr "E84: Aucun tampon n'est modifi�"
@@ -115,9 +118,6 @@ msgid "E89: No write since last change for buffer %ld (add ! to override)"
 msgstr ""
 "E89: Le tampon %ld n'a pas �t� enregistr� (ajoutez ! pour passer outre)"
 
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: Impossible de d�charger le dernier tampon"
-
 msgid "W14: Warning: List of file names overflow"
 msgstr "W14: Alerte : La liste des noms de fichier d�borde"
 
@@ -156,6 +156,9 @@ msgstr "[Nouveau fichier]"
 msgid "[Read errors]"
 msgstr "[Erreurs de lecture]"
 
+msgid "[RO]"
+msgstr "[RO]"
+
 # AB - La version courte, "[RO]", devrait-elle �tre traduite par "[LS]" ?
 #      Il faudrait faire un sondage aupr�s des utilisateurs francophones.
 msgid "[readonly]"
@@ -230,6 +233,21 @@ msgstr "Symboles dans %s :"
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    ligne=%ld  id=%d  nom=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Le fichier est chiffr� avec une m�thode inconnue"
+
+msgid "Enter encryption key: "
+msgstr "Tapez la cl� de chiffrement : "
+
+msgid "Enter same key again: "
+msgstr "Tapez la cl� � nouveau : "
+
+msgid "Keys don't match!"
+msgstr "Les cl�s ne correspondent pas !"
+
+msgid "[crypted]"
+msgstr "[chiffr�]"
+
 # AB - Je n'ai pas trouv� de traduction satisfaisante au verbe "diff". Comme
 #      Vim fait en pratique appel au programme "diff" pour evaluer les
 #      diff�rences entre fichiers, "to diff" a �t� traduit par "utiliser diff"
@@ -491,6 +509,9 @@ msgstr "E130: Fonction inconnue : %s"
 msgid "E461: Illegal variable name: %s"
 msgstr "E461: Nom de variable invalide : %s"
 
+msgid "E806: using Float as a String"
+msgstr "E806: Utilisation d'un Flottant comme une Cha�ne"
+
 # DB - todo : trouver mieux que "destinations".
 msgid "E687: Less targets than List items"
 msgstr "E687: Moins de destinations que d'�l�ments dans la Liste"
@@ -662,13 +683,13 @@ msgstr "E785: complete() n'est utilisable que dans le mode Insertion"
 msgid "&Ok"
 msgstr "&Ok"
 
-msgid "extend() argument"
-msgstr "argument de extend()"
-
 #, c-format
 msgid "E737: Key already exists: %s"
 msgstr "E737: un mappage existe d�j� pour %s"
 
+msgid "extend() argument"
+msgstr "argument de extend()"
+
 msgid "map() argument"
 msgstr "argument de map()"
 
@@ -742,9 +763,15 @@ msgstr "E258: La r
 msgid "sort() argument"
 msgstr "argument de sort()"
 
+msgid "uniq() argument"
+msgstr "argument de uniq()"
+
 msgid "E702: Sort compare function failed"
 msgstr "E702: La fonction de comparaison de sort() a �chou�"
 
+msgid "E882: Uniq compare function failed"
+msgstr "E882: La fonction de comparaison de uniq() a �chou�"
+
 msgid "(Invalid)"
 msgstr "(Invalide)"
 
@@ -772,9 +799,6 @@ msgstr "E730: Utilisation d'une Liste comme une Cha
 msgid "E731: using Dictionary as a String"
 msgstr "E731: Utilisation d'un Dictionnaire comme une Cha�ne"
 
-msgid "E806: using Float as a String"
-msgstr "E806: Utilisation d'un Flottant comme une Cha�ne"
-
 # DB : On doit pouvoir trouver nettement mieux que �a.
 #, c-format
 msgid "E706: Variable type mismatch for: %s"
@@ -848,8 +872,15 @@ msgid "E129: Function name required"
 msgstr "E129: Nom de fonction requis"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
-msgstr "E128: La fonction %s ne commence pas par une majuscule ou contient ':'"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
+msgstr ""
+"E128: Le nom de la fonction doit commencer par une majuscule ou \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr ""
+"E884: Le nom de la fonction ne peut pas contenir le caract�re deux-points : "
+"%s"
 
 # AB - Il est difficile de cr�er une version fran�aise qui fasse moins de 80
 #      caract�res de long, nom de la fonction compris : "It is in use" est une
@@ -1013,6 +1044,10 @@ msgstr "E138: Impossible d'
 msgid "Writing viminfo file \"%s\""
 msgstr "�criture du fichier viminfo \"%s\""
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Impossible de renommer viminfo en %s"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1267,6 +1302,10 @@ msgstr "E158: Le tampon %s est introuvable"
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: Le symbole %ld est introuvable"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Impossible de changer le symbole %s"
+
 msgid " (NOT FOUND)"
 msgstr "  (INTROUVABLE)"
 
@@ -1856,9 +1895,6 @@ msgstr "[socket]"
 msgid "[character special]"
 msgstr "[caract�re sp�cial]"
 
-msgid "[RO]"
-msgstr "[RO]"
-
 msgid "[CR missing]"
 msgstr "[CR manquant]"
 
@@ -1871,12 +1907,6 @@ msgstr "[NON converti]"
 msgid "[converted]"
 msgstr "[converti]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[chiffr�]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[ERREUR DE CONVERSION � la ligne %ld]"
@@ -1898,9 +1928,6 @@ msgstr "La conversion avec 'charconvert' a 
 msgid "can't read output of 'charconvert'"
 msgstr "Impossible de lire la sortie de 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Le fichier est chiffr� avec une m�thode inconnue"
-
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: Pas d'autocommande correspondante pour le tampon acwrite"
 
@@ -2490,32 +2517,28 @@ msgid "Font '%s' is not fixed-width"
 msgstr "La police '%s' n'a pas une largeur fixe"
 
 #, c-format
-msgid "E253: Fontset name: %s\n"
-msgstr "E253: Nom du jeu de polices : %s\n"
+msgid "E253: Fontset name: %s"
+msgstr "E253: Nom du jeu de polices : %s"
 
 #, c-format
-msgid "Font0: %s\n"
-msgstr "Font0: %s\n"
+msgid "Font0: %s"
+msgstr "Font0: %s"
 
 #, c-format
-msgid "Font1: %s\n"
-msgstr "Font1: %s\n"
+msgid "Font1: %s"
+msgstr "Font1: %s"
 
 #, c-format
-msgid "Font%ld width is not twice that of font0\n"
-msgstr "La largeur de Font%ld n'est pas le double de celle de Font0\n"
+msgid "Font%ld width is not twice that of font0"
+msgstr "La largeur de Font%ld n'est pas le double de celle de Font0"
 
 #, c-format
-msgid "Font0 width: %ld\n"
-msgstr "Largeur de Font0 : %ld\n"
+msgid "Font0 width: %ld"
+msgstr "Largeur de Font0 : %ld"
 
 #, c-format
-msgid ""
-"Font1 width: %ld\n"
-"\n"
-msgstr ""
-"Largeur de Font1 : %ld\n"
-"\n"
+msgid "Font1 width: %ld"
+msgstr "Largeur de Font1 : %ld"
 
 # DB - todo : Pas certain de mon coup, ici...
 msgid "Invalid font specification"
@@ -2709,6 +2732,9 @@ msgstr "E566: Impossible de cr
 msgid "E622: Could not fork for cscope"
 msgstr "E622: Impossible de forker pour cscope"
 
+msgid "cs_create_connection setpgid failed"
+msgstr "cs_create_connection setpgid a �chou�"
+
 msgid "cs_create_connection exec failed"
 msgstr "exec de cs_create_connection a �chou�"
 
@@ -2879,9 +2905,6 @@ msgstr "non autoris
 msgid "E836: This Vim cannot execute :python after using :py3"
 msgstr "E836: Vim ne peut pas ex�cuter :python apr�s avoir utilis� :py3"
 
-msgid "only string keys are allowed"
-msgstr "seule une chaine est autoris�e comme cl�"
-
 msgid ""
 "E263: Sorry, this command is disabled, the Python library could not be "
 "loaded."
@@ -2889,15 +2912,19 @@ msgstr ""
 "E263: D�sol�, commande d�sactiv�e : la biblioth�que Python n'a pas pu �tre "
 "charg�e."
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: D�sol�, commande d�sactiv�e : la biblioth�que Python n'a pas pu �tre "
+"charg�e."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: Impossible d'invoquer Python r�cursivement"
 
 msgid "E837: This Vim cannot execute :py3 after using :python"
 msgstr "E837: Vim ne peut pas ex�cuter :py3 apr�s avoir utilis� :python"
 
-msgid "index must be int or slice"
-msgstr "index doit �tre int ou slice"
-
 msgid "E265: $_ must be an instance of String"
 msgstr "E265: $_ doit �tre une instance de cha�ne (String)"
 
@@ -4249,13 +4276,6 @@ msgstr " (Interrompu)"
 msgid "Beep!"
 msgstr "Bip !"
 
-msgid "Vim: preserving files...\n"
-msgstr "Vim : pr�servation des fichiers...\n"
-
-#. close all memfiles, without deleting
-msgid "Vim: Finished.\n"
-msgstr "Vim : Fini.\n"
-
 msgid "ERROR: "
 msgstr "ERREUR : "
 
@@ -4305,15 +4325,6 @@ msgstr "E548: chiffre attendu"
 msgid "E549: Illegal percentage"
 msgstr "E549: Pourcentage non autoris�"
 
-msgid "Enter encryption key: "
-msgstr "Tapez la cl� de chiffrement : "
-
-msgid "Enter same key again: "
-msgstr "Tapez la cl� � nouveau : "
-
-msgid "Keys don't match!"
-msgstr "Les cl�s ne correspondent pas !"
-
 msgid "E854: path too long for completion"
 msgstr "E854: chemin trop long pour compl�tement"
 
@@ -4488,6 +4499,13 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: Type de registre %d inconnu"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: le motif de recherche et le registre d'expression ne peuvent pas "
+"contenir deux lignes ou plus"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "%ld Colonnes ; "
@@ -4777,17 +4795,6 @@ msgstr "E244: Jeu de caract
 msgid "E245: Illegal char '%c' in font name \"%s\""
 msgstr "E245: Caract�re '%c' invalide dans le nom de fonte \"%s\""
 
-msgid "Vim: Double signal, exiting\n"
-msgstr "Vim : Double signal, sortie\n"
-
-#, c-format
-msgid "Vim: Caught deadly signal %s\n"
-msgstr "Vim : Signal mortel %s intercept�\n"
-
-#, c-format
-msgid "Vim: Caught deadly signal\n"
-msgstr "Vim : Signal mortel intercept�\n"
-
 #, c-format
 msgid "Opening the X display took %ld msec"
 msgstr "L'ouverture du display X a pris %ld ms"
@@ -4819,6 +4826,19 @@ msgstr ""
 "\n"
 "Impossible de modifier le contexte de s�curit� pour "
 
+msgid "Could not set security context "
+msgstr "Impossible d'initialiser le contexte de s�curit� "
+
+msgid " for "
+msgstr " pour "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Impossible d'obtenir le contexte de s�curit� "
+
+msgid ". Removing it!\n"
+msgstr ". Suppression !\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -5017,6 +5037,20 @@ msgstr "E54: %s( ouvrante non ferm
 msgid "E55: Unmatched %s)"
 msgstr "E55: %s) fermante non ouverte"
 
+msgid "E66: \\z( not allowed here"
+msgstr "E66: \\z( n'est pas autoris� ici"
+
+msgid "E67: \\z1 et al. not allowed here"
+msgstr "E67: \\z1 et co. ne sont pas autoris�s ici"
+
+#, c-format
+msgid "E69: Missing ] after %s%%["
+msgstr "E69: ']' manquant apr�s %s%%["
+
+#, c-format
+msgid "E70: Empty %s%%[]"
+msgstr "E70: %s%%[] vide"
+
 msgid "E339: Pattern too long"
 msgstr "E339: Motif trop long"
 
@@ -5056,23 +5090,9 @@ msgstr "E64: %s%c ne suit aucun atome"
 msgid "E65: Illegal back reference"
 msgstr "E65: post-r�f�rence invalide"
 
-msgid "E66: \\z( not allowed here"
-msgstr "E66: \\z( n'est pas autoris� ici"
-
-msgid "E67: \\z1 et al. not allowed here"
-msgstr "E67: \\z1 et co. ne sont pas autoris�s ici"
-
 msgid "E68: Invalid character after \\z"
 msgstr "E68: Caract�re invalide apr�s \\z"
 
-#, c-format
-msgid "E69: Missing ] after %s%%["
-msgstr "E69: ']' manquant apr�s %s%%["
-
-#, c-format
-msgid "E70: Empty %s%%[]"
-msgstr "E70: %s%%[] vide"
-
 #, c-format
 msgid "E678: Invalid character after %s%%[dxouU]"
 msgstr "E678: Caract�re invalide apr�s %s%%[dxouU]"
@@ -5088,6 +5108,10 @@ msgstr "E554: Erreur de syntaxe dans %s{...}"
 msgid "External submatches:\n"
 msgstr "Sous-correspondances externes :\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (regexp NFA) %s ne peut pas �tre r�p�t�"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
@@ -5095,17 +5119,28 @@ msgstr ""
 "E864: \\%#= peut �tre suivi uniquement de 0, 1 ou 2. Le moteur automatique "
 "sera utilis� "
 
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Moteur RE avec backtracking utilis� pour le motif : " 
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) Fin de regexp rencontr�e pr�matur�ment"
+
 #, c-format
 msgid "E866: (NFA regexp) Misplaced %c"
 msgstr "E866: (regexp NFA) %c au mauvais endroit"
 
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) Fin de regexp rencontr�e pr�matur�ment"
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (regexp NFA) Classe de caract�re invalide : %ld"
 
 #, c-format
 msgid "E867: (NFA) Unknown operator '\\z%c'"
 msgstr "E867: (NFA) Op�rateur inconnu '\\z%c'"
 
+#, c-format
+msgid "E867: (NFA) Unknown operator '\\%%%c'"
+msgstr "E867: (NFA) Op�rateur inconnu '\\%%%c'"
+
 #. should never happen
 msgid "E868: Error building NFA with equivalence class!"
 msgstr "E868: Erreur lors de la construction du NFA avec classe d'�quivalence"
@@ -5117,12 +5152,17 @@ msgstr "E869: (NFA) Op
 msgid "E870: (NFA regexp) Error reading repetition limits"
 msgstr "E870: (regexp NFA) Erreur � la lecture des limites de r�p�tition"
 
+#. Can't have a multi follow a multi.
 msgid "E871: (NFA regexp) Can't have a multi follow a multi !"
 msgstr "E871: (regexp NFA) Un multi ne peut pas suivre un multi !"
 
+#. Too many `('
 msgid "E872: (NFA regexp) Too many '('"
 msgstr "E872: (regexp NFA) Trop de '('"
 
+msgid "E879: (NFA regexp) Too many \\z("
+msgstr "E879: (regexp NFA) Trop de \\z("
+
 msgid "E873: (NFA regexp) proper termination error"
 msgstr "E873: (NFA regexp) erreur de terminaison"
 
@@ -5139,18 +5179,9 @@ msgstr ""
 msgid "E876: (NFA regexp) Not enough space to store the whole NFA "
 msgstr "E876: (regexp NFA) Pas assez de m�moire pour stocker le NFA"
 
-msgid "E999: (NFA regexp internal error) Should not process NOT node !"
+msgid "E878: (NFA) Could not allocate memory for branch traversal!"
 msgstr ""
-"E999: (erreur interne du regexp NFA) Un noeud 'NOT' ne devrait pas �tre "
-"trait� !"
-
-#. should not be here :P
-msgid "E877: (NFA regexp) Invalid character class "
-msgstr "E877: (regexp NFA) Classe de caract�re invalide "
-
-#, c-format
-msgid "(NFA) COULD NOT OPEN %s !"
-msgstr "(NFA) IMPOSSIBLE D'OUVRIR %s !"
+"E878: (NFA) Impossible d'allouer la m�moire pour parcourir les branches !"
 
 msgid ""
 "Could not open temporary log file for writing, displaying on stderr ... "
@@ -5158,9 +5189,9 @@ msgstr ""
 "Impossible d'ouvrir le fichier de log temporaire en �criture, affichage sur "
 "stderr ... "
 
-msgid "E878: (NFA) Could not allocate memory for branch traversal!"
-msgstr ""
-"E878: (NFA) Impossible d'allouer la m�moire pour parcourir les branches!"
+#, c-format
+msgid "(NFA) COULD NOT OPEN %s !"
+msgstr "(NFA) IMPOSSIBLE D'OUVRIR %s !"
 
 msgid "Could not open temporary log file for writing "
 msgstr "Impossible d'ouvrir le fichier de log en �criture"
@@ -5607,12 +5638,12 @@ msgid "E765: 'spellfile' does not have %ld entries"
 msgstr "E765: 'spellfile' n'a pas %ld entr�es"
 
 #, c-format
-msgid "Word removed from %s"
-msgstr "Mot retir� de %s"
+msgid "Word '%.*s' removed from %s"
+msgstr "Mot '%.*s' retir� de %s"
 
 #, c-format
-msgid "Word added to %s"
-msgstr "Mot ajout� dans %s"
+msgid "Word '%.*s' added to %s"
+msgstr "Mot '%.*s' ajout� dans %s"
 
 msgid "E763: Word characters differ between spell files"
 msgstr ""
@@ -5668,6 +5699,9 @@ msgstr "E782: Erreur lors de la lecture de fichier de suggestions : %s"
 msgid "E783: duplicate char in MAP entry"
 msgstr "E783: caract�res dupliqu� dans l'entr�e MAP"
 
+msgid "No Syntax items defined for this buffer"
+msgstr "Aucun �l�ment de syntaxe d�fini pour ce tampon"
+
 #, c-format
 msgid "E390: Illegal argument: %s"
 msgstr "E390: Argument invalide : %s"
@@ -5676,9 +5710,6 @@ msgstr "E390: Argument invalide : %s"
 msgid "E391: No such syntax cluster: %s"
 msgstr "E391: Aucune grappe de syntaxe %s"
 
-msgid "No Syntax items defined for this buffer"
-msgstr "Aucun �l�ment de syntaxe d�fini pour ce tampon"
-
 msgid "syncing on C-style comments"
 msgstr "synchronisation sur les commentaires de type C"
 
@@ -5808,6 +5839,11 @@ msgstr "E409: Nom de groupe inconnu : %s"
 msgid "E410: Invalid :syntax subcommand: %s"
 msgstr "E410: Sous-commande de :syntax invalide : %s"
 
+msgid ""
+"  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN"
+msgstr ""
+"  TOTAL      NOMBRE MATCH   PLUS LENT   MOYEN     NOM                MOTIF"
+
 msgid "E679: recursive loop loading syncolor.vim"
 msgstr "E679: boucle r�cursive lors du chargement de syncolor.vim"
 
@@ -6005,8 +6041,8 @@ msgstr "CUT_BUFFER0 utilis
 
 #. This happens when the FileChangedRO autocommand changes the
 #. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: Le nombre de lignes a �t� chang� inopin�ment"
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: Le nombre de lignes a �t� chang� inopin�ment"
 
 # DB - Question O/N.
 #. must display the prompt
@@ -6501,6 +6537,9 @@ msgstr "E446: Aucun nom de fichier sous le curseur"
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: Le fichier \"%s\" est introuvable dans 'path'"
 
+msgid "List or number required"
+msgstr "Liste ou nombre requis"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: Impossible de charger la biblioth�que %s"
@@ -6737,6 +6776,9 @@ msgstr "E485: Impossible de lire le fichier %s"
 msgid "E37: No write since last change (add ! to override)"
 msgstr "E37: Modifications non enregistr�es (ajoutez ! pour passer outre)"
 
+msgid "E37: No write since last change"
+msgstr "E37: Modifications non enregistr�es"
+
 msgid "E38: Null argument"
 msgstr "E38: Argument null"
 
@@ -6897,107 +6939,180 @@ msgstr "La recherche a atteint le BAS, et continue en HAUT"
 msgid "Need encryption key for \"%s\""
 msgstr "Besoin de la cl� de chiffrement pour \"%s\""
 
-msgid "can't delete OutputObject attributes"
-msgstr "impossible d'effacer les attributs d'OutputObject"
+msgid "empty keys are not allowed"
+msgstr "les cl�s vides ne sont pas autoris�es"
+
+msgid "dictionary is locked"
+msgstr "dictionnaire est verrouill�"
+
+msgid "list is locked"
+msgstr "liste verrouill�e"
+
+#, c-format
+msgid "failed to add key '%s' to dictionary"
+msgstr "l'ajout de cl� '%s' au dictionnaire a �chou�"
 
-msgid "softspace must be an integer"
-msgstr "softspace doit �tre un nombre entier"
+#, c-format
+msgid "index must be int or slice, not %s"
+msgstr "index doit �tre int ou slice, et non %s"
 
-msgid "invalid attribute"
-msgstr "attribut invalide"
+#, c-format
+msgid "expected str() or unicode() instance, but got %s"
+msgstr "attendu instance de str() ou unicode(), mais re�u %s"
 
-msgid "writelines() requires list of strings"
-msgstr "writelines() requiert une liste de cha�nes"
+#, c-format
+msgid "expected bytes() or str() instance, but got %s"
+msgstr "attendu instance de bytes() ou str(), mais re�u %s"
+
+#, c-format
+msgid ""
+"expected int(), long() or something supporting coercing to long(), but got %s"
+msgstr ""
+"attendu int(), long() ou quelque chose qui peut �tre transform� en long(), "
+"mais re�u %s"
+
+#, c-format
+msgid "expected int() or something supporting coercing to int(), but got %s"
+msgstr ""
+"attendu int() ou quelque chose qui peut �tre transform� en int(), mais re�u "
+"%s"
+
+msgid "value is too large to fit into C int type"
+msgstr "valeur trop grande pour �tre stock�e dans le type C int"
+
+msgid "value is too small to fit into C int type"
+msgstr "valeur trop petite pour �tre stock�e dans le type C int"
+
+msgid "number must be greater than zero"
+msgstr "le nombre doit �tre plus grand que z�ro"
+
+msgid "number must be greater or equal to zero"
+msgstr "le nombre doit �tre plus grand ou �gal � z�ro"
+
+msgid "can't delete OutputObject attributes"
+msgstr "impossible d'effacer les attributs d'OutputObject"
+
+#, c-format
+msgid "invalid attribute: %s"
+msgstr "attribut invalide : %s"
 
 msgid "E264: Python: Error initialising I/O objects"
 msgstr "E264: Python : Erreur d'initialisation des objets d'E/S"
 
-msgid "empty keys are not allowed"
-msgstr "les cl�s vides ne sont pas autoris�es"
+msgid "failed to change directory"
+msgstr "changement de r�pertoire a �chou�"
 
-msgid "Cannot delete DictionaryObject attributes"
-msgstr "Impossible d'effacer les attributs de DictionaryObject"
+#, c-format
+msgid "expected 3-tuple as imp.find_module() result, but got %s"
+msgstr "attendu un 3-tuple comme r�sultat de imp.find_module(), mais re�u %s"
 
-msgid "Cannot modify fixed dictionary"
-msgstr "Impossible de modifier un dictionnaire fixe"
+#, c-format
+msgid "expected 3-tuple as imp.find_module() result, but got tuple of size %d"
+msgstr ""
+"attendu un 3-tuple comme r�sultat de imp.find_module(), mais re�u un tuple "
+"de taille %d"
 
-msgid "Cannot set this attribute"
-msgstr "Impossible d'initialiser cet attribut"
+msgid "internal error: imp.find_module returned tuple with NULL"
+msgstr "erreur interne : imp.find_module a retourn� un tuple contenant NULL"
 
-msgid "dict is locked"
-msgstr "dictionnaire est verrouill�"
+msgid "cannot delete vim.Dictionary attributes"
+msgstr "impossible d'effacer les attributs de vim.Dictionary"
 
-msgid "failed to add key to dictionary"
-msgstr "l'ajout de cl� au dictionnaire a �chou�"
+msgid "cannot modify fixed dictionary"
+msgstr "impossible de modifier un dictionnaire fixe"
+
+#, c-format
+msgid "cannot set attribute %s"
+msgstr "impossible d'initialiser l'attribut %s"
+
+msgid "hashtab changed during iteration"
+msgstr "la table de hachage a �t� chang�e pendant une it�ration"
+
+#, c-format
+msgid "expected sequence element of size 2, but got sequence of size %d"
+msgstr ""
+"attendu une s�quence d'�l�ments de taille 2, mais re�u une s�quence de "
+"taille %d"
+
+msgid "list constructor does not accept keyword arguments"
+msgstr "le constructeur de liste n'accepte pas les arguments nomm�s"
 
 msgid "list index out of range"
 msgstr "index de liste hors limites"
 
-msgid "internal error: failed to get vim list item"
-msgstr "erreur interne : acc�s � un �l�ment de liste a �chou�"
+#. No more suitable format specifications in python-2.3
+#, c-format
+msgid "internal error: failed to get vim list item %d"
+msgstr "erreur interne : acc�s � un �l�ment %d de liste a �chou�"
 
-msgid "list is locked"
-msgstr "liste verrouill�e"
+msgid "slice step cannot be zero"
+msgstr "le pas du d�coupage en tranche ne peut pas �tre z�ro"
 
-msgid "Failed to add item to list"
-msgstr "Ajout � la liste a �chou�"
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr ""
+"tentative d'assigner une s�quence de taille plus grande que %d � un "
+"d�coupage en tranche �tendu "
 
-msgid "internal error: no vim list item"
-msgstr "erreur interne : pas d'�l�ment de liste vim"
+#, c-format
+msgid "internal error: no vim list item %d"
+msgstr "erreur interne : pas d'�l�ment %d de liste vim"
 
-msgid "can only assign lists to slice"
-msgstr "seules des tranches peuvent �tre assign�es aux listes"
+msgid "internal error: not enough list items"
+msgstr "erreur interne : pas assez d'�l�ments de liste"
 
 msgid "internal error: failed to add item to list"
 msgstr "erreur interne : ajout d'�l�ment � la liste a �chou�"
 
-msgid "can only concatenate with lists"
-msgstr "on ne peut que concat�ner avec des listes"
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+"tentative d'assigner une s�quence de taille %d � un d�coupage en tranche "
+"�tendu de taille %d"
 
-msgid "cannot delete vim.dictionary attributes"
-msgstr "impossible d'effacer les attributs de vim.dictionary"
+msgid "failed to add item to list"
+msgstr "ajout � la liste a �chou�"
+
+msgid "cannot delete vim.List attributes"
+msgstr "impossible d'effacer les attributs de vim.List"
 
 msgid "cannot modify fixed list"
 msgstr "impossible de modifier une liste fixe"
 
-msgid "cannot set this attribute"
-msgstr "impossible d'initialiser cet attribut"
+#, c-format
+msgid "unnamed function %s does not exist"
+msgstr "la fonction sans nom %s n'existe pas"
 
-msgid "'self' argument must be a dictionary"
-msgstr "l'argument 'self' doit �tre un dictionnaire"
+#, c-format
+msgid "function %s does not exist"
+msgstr "la fonction %s n'existe pas"
+
+msgid "function constructor does not accept keyword arguments"
+msgstr "le constructeur de fonction n'accepte pas les arguments nomm�s"
 
-msgid "failed to run function"
-msgstr "ex�cution de la fonction a �chou�"
+#, c-format
+msgid "failed to run function %s"
+msgstr "ex�cution de la fonction %s a �chou�"
 
 msgid "unable to get option value"
 msgstr "impossible d'obtenir la valeur d'une option"
 
-msgid "unable to unset global option"
-msgstr "impossible de d�sactiver une option globale"
-
-msgid "unable to unset option without global value"
-msgstr "impossible de d�sactiver une option sans une valeur globale"
+msgid "internal error: unknown option type"
+msgstr "erreur interne : type d'option inconnu"
 
-msgid "object must be integer"
-msgstr "objet doit �tre un nombre entier"
-
-msgid "object must be string"
-msgstr "objet doit �tre de type string"
-
-msgid "attempt to refer to deleted tab page"
-msgstr "tentative de r�f�rencer un onglet effac�"
+msgid "problem while switching windows"
+msgstr "probl�me lors du changement de fen�tres"
 
 #, c-format
-msgid "<tabpage object (deleted) at %p>"
-msgstr "<objet onglet (effac�) � %p>"
+msgid "unable to unset global option %s"
+msgstr "impossible de d�sactiver une option globale %s"
 
 #, c-format
-msgid "<tabpage object (unknown) at %p>"
-msgstr "<objet onglet (inconnu) � %p>"
+msgid "unable to unset option %s which does not have global value"
+msgstr "impossible de d�sactiver l'option %s qui n'a pas de valeur globale"
 
-#, c-format
-msgid "<tabpage %d>"
-msgstr "<onglet %d>"
+msgid "attempt to refer to deleted tab page"
+msgstr "tentative de r�f�rencer un onglet effac�"
 
 msgid "no such tab page"
 msgstr "cet onglet n'existe pas"
@@ -7005,45 +7120,35 @@ msgstr "cet onglet n'existe pas"
 msgid "attempt to refer to deleted window"
 msgstr "tentative de r�f�rencer une fen�tre effac�e"
 
-msgid "readonly attribute"
-msgstr "attribut en lecture seule"
+msgid "readonly attribute: buffer"
+msgstr "attribut en lecture seule : tampon"
 
 msgid "cursor position outside buffer"
 msgstr "curseur positionn� en dehors du tampon"
 
-#, c-format
-msgid "<window object (deleted) at %p>"
-msgstr "<objet fen�tre (effac�) � %p>"
-
-#, c-format
-msgid "<window object (unknown) at %p>"
-msgstr "<objet fen�tre (inconnu) � %p>"
-
-#, c-format
-msgid "<window %d>"
-msgstr "<fen�tre %d>"
-
 msgid "no such window"
 msgstr "Cette fen�tre n'existe pas"
 
 msgid "attempt to refer to deleted buffer"
 msgstr "tentative de r�f�rencer un tampon effac�"
 
-#, c-format
-msgid "<buffer object (deleted) at %p>"
-msgstr "<objet tampon (effac�) � %p>"
+msgid "failed to rename buffer"
+msgstr "impossible de renommer le tampon"
 
-msgid "key must be integer"
-msgstr "la cl� doit �tre un nombre entier"
+msgid "mark name must be a single character"
+msgstr "le nom de marque doit �tre un seul caract�re"
 
-msgid "expected vim.buffer object"
-msgstr "objet vim.buffer attendu"
+#, c-format
+msgid "expected vim.Buffer object, but got %s"
+msgstr "attendu un objet objet vim.Buffer, mais re�u %s"
 
-msgid "failed to switch to given buffer"
-msgstr "impossible de se d�placer au tampon donn�"
+#, c-format
+msgid "failed to switch to buffer %d"
+msgstr "impossible de se d�placer au tampon %d"
 
-msgid "expected vim.window object"
-msgstr "objet vim.window attendu"
+#, c-format
+msgid "expected vim.Window object, but got %s"
+msgstr "attendu un objet vim.Window, mais re�u %s"
 
 msgid "failed to find window in the current tab page"
 msgstr "impossible de trouver une fen�tre dans l'onglet courant"
@@ -7051,8 +7156,9 @@ msgstr "impossible de trouver une fen
 msgid "did not switch to the specified window"
 msgstr "ne s'est pas d�plac� � la fen�tre sp�cifi�e"
 
-msgid "expected vim.tabpage object"
-msgstr "objet vim.tabpage attendu"
+#, c-format
+msgid "expected vim.TabPage object, but got %s"
+msgstr "attendu un objet vim.TabPage, mais re�u %s"
 
 msgid "did not switch to the specified tab page"
 msgstr "impossible de se d�placer � l'onglet sp�cifi�"
@@ -7066,15 +7172,115 @@ msgstr "E858: Eval n'a pas retourn
 msgid "E859: Failed to convert returned python object to vim value"
 msgstr "E859: Conversion d'objet python � une valeur de vim a �chou�"
 
-msgid "unable to convert to vim structure"
-msgstr "conversion � une structure vim impossible"
+#, c-format
+msgid "unable to convert %s to vim dictionary"
+msgstr "impossible de convertir %s � un dictionnaire vim"
 
-msgid "NULL reference passed"
-msgstr "r�f�rence NULL pass�e"
+#, c-format
+msgid "unable to convert %s to vim structure"
+msgstr "impossible de convertir %s � une structure de vim"
+
+msgid "internal error: NULL reference passed"
+msgstr "erreur interne : r�f�rence NULL pass�e"
 
 msgid "internal error: invalid value type"
 msgstr "erreur interne : type de valeur invalide"
 
+msgid ""
+"Failed to set path hook: sys.path_hooks is not a list\n"
+"You should now do the following:\n"
+"- append vim.path_hook to sys.path_hooks\n"
+"- append vim.VIM_SPECIAL_PATH to sys.path\n"
+msgstr ""
+"Impossible d'initialiser sys.path_hook qui n'est pas un liste\n"
+"Vous devez maintenant :\n"
+"- ajouter vim.path_hook � sys.path_hooks\n"
+"- ajouter vim.VIM_SPECIAL_PATH � sys.path\n"
+
+msgid ""
+"Failed to set path: sys.path is not a list\n"
+"You should now append vim.VIM_SPECIAL_PATH to sys.path"
+msgstr ""
+"Impossible d'initialiser le chemin : sys.math n'est pas une liste\n"
+"Vous devez maintenant ajouter vim.VIM_SPECIAL_PATH � sys.path"
+
+#~ msgid "[blowfish]"
+#~ msgstr "[blowfish]"
+
+#~ msgid "only string keys are allowed"
+#~ msgstr "seule une chaine est autoris�e comme cl�"
+
+#~ msgid "Vim: preserving files...\n"
+#~ msgstr "Vim : pr�servation des fichiers...\n"
+
+#~ msgid "Vim: Finished.\n"
+#~ msgstr "Vim : Fini.\n"
+
+#~ msgid "Vim: Double signal, exiting\n"
+#~ msgstr "Vim : Double signal, sortie\n"
+
+#~ msgid "Vim: Caught deadly signal %s\n"
+#~ msgstr "Vim : Signal mortel %s intercept�\n"
+
+#~ msgid "Vim: Caught deadly signal\n"
+#~ msgstr "Vim : Signal mortel intercept�\n"
+
+#~ msgid "E999: (NFA regexp internal error) Should not process NOT node !"
+#~ msgstr ""
+#~ "E999: (erreur interne du regexp NFA) Un noeud 'NOT' ne devrait pas �tre "
+#~ "trait� !"
+
+#~ msgid "softspace must be an integer"
+#~ msgstr "softspace doit �tre un nombre entier"
+
+#~ msgid "writelines() requires list of strings"
+#~ msgstr "writelines() requiert une liste de cha�nes"
+
+#~ msgid "Cannot delete DictionaryObject attributes"
+#~ msgstr "Impossible d'effacer les attributs de DictionaryObject"
+
+#~ msgid "Cannot set this attribute"
+#~ msgstr "Impossible d'initialiser cet attribut"
+
+#~ msgid "can only assign lists to slice"
+#~ msgstr "seules des tranches peuvent �tre assign�es aux listes"
+
+#~ msgid "can only concatenate with lists"
+#~ msgstr "on ne peut que concat�ner avec des listes"
+
+#~ msgid "'self' argument must be a dictionary"
+#~ msgstr "l'argument 'self' doit �tre un dictionnaire"
+
+#~ msgid "object must be integer"
+#~ msgstr "objet doit �tre un nombre entier"
+
+#~ msgid "object must be string"
+#~ msgstr "objet doit �tre de type string"
+
+#~ msgid "<tabpage object (deleted) at %p>"
+#~ msgstr "<objet onglet (effac�) � %p>"
+
+#~ msgid "<tabpage object (unknown) at %p>"
+#~ msgstr "<objet onglet (inconnu) � %p>"
+
+#~ msgid "<tabpage %d>"
+#~ msgstr "<onglet %d>"
+
+#~ msgid "<window object (deleted) at %p>"
+#~ msgstr "<objet fen�tre (effac�) � %p>"
+
+#~ msgid "<window object (unknown) at %p>"
+#~ msgstr "<objet fen�tre (inconnu) � %p>"
+
+#~ msgid "<window %d>"
+#~ msgstr "<fen�tre %d>"
+
+#~ msgid "<buffer object (deleted) at %p>"
+#~ msgstr "<objet tampon (effac�) � %p>"
+
+#~ msgid "key must be integer"
+#~ msgstr "la cl� doit �tre un nombre entier"
+
 #~ msgid "E860: Eval did not return a valid python 3 object"
 #~ msgstr "E860: Eval n'a pas retourn� un object python 3 valid"
 
diff --git a/src/po/ja.sjis.po b/src/po/ja.sjis.po
index e9c392d8a3..8d7e7cf5bb 100644
--- a/src/po/ja.sjis.po
+++ b/src/po/ja.sjis.po
@@ -8,7 +8,7 @@
 # Copyright (C) 2001-13 MURAOKA Taro <koron.kaoriya@gmail.com>
 # THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE.
 #
-# Original translations.
+# generated from ja.po, DO NOT EDIT
 #
 msgid ""
 msgstr ""
diff --git a/src/po/uk.cp1251.po b/src/po/uk.cp1251.po
index e97aaf1caf..e3f8df0cac 100644
--- a/src/po/uk.cp1251.po
+++ b/src/po/uk.cp1251.po
@@ -12,7 +12,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: vim 7.4\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-29 09:05+0300\n"
+"POT-Creation-Date: 2014-11-08 08:23+0200\n"
 "PO-Revision-Date: 2010-06-18 21:53+0300\n"
 "Last-Translator: ������� ������ <sakhnik@gmail.com>\n"
 "Language-Team: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
@@ -81,6 +81,9 @@ msgstr "
 msgid "%d buffers wiped out"
 msgstr "������� %d ������(��)"
 
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: �� ���� ����������� �������� �����"
+
 msgid "E84: No modified buffer found"
 msgstr "E84: ����� ����� �� ������"
 
@@ -102,9 +105,6 @@ msgstr "E88: 
 msgid "E89: No write since last change for buffer %ld (add ! to override)"
 msgstr "E89: ����� %ld �� ���� (! ��� �� �������)"
 
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: �� ���� ����������� �������� �����"
-
 msgid "W14: Warning: List of file names overflow"
 msgstr "W14: ��������: ������ ���� ����� �����������"
 
@@ -204,6 +204,21 @@ msgstr "
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    �����=%ld  id=%d �����=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: ���� ����������� �������� �������"
+
+msgid "Enter encryption key: "
+msgstr "������ ���� �����: "
+
+msgid "Enter same key again: "
+msgstr "�������� ����: "
+
+msgid "Keys don't match!"
+msgstr "����� �� �������!"
+
+msgid "[crypted]"
+msgstr "[�����������]"
+
 #, c-format
 msgid "E96: Can not diff more than %ld buffers"
 msgstr "E96: �� ����� ���������� ����� %ld ������(��)"
@@ -683,9 +698,17 @@ msgstr "E258: 
 msgid "sort() argument"
 msgstr "�������� sort()"
 
+# msgstr "E14: "
+msgid "uniq() argument"
+msgstr "�������� unique()"
+
 # msgstr "E364: "
 msgid "E702: Sort compare function failed"
-msgstr "E702: ������� � ������� ���������"
+msgstr "E702: ������� � ������� ��������� sort"
+
+# msgstr "E364: "
+msgid "E882: Uniq compare function failed"
+msgstr "E882: ������� � ������� ��������� uniq"
 
 msgid "(Invalid)"
 msgstr "(���������)"
@@ -783,9 +806,13 @@ msgid "E129: Function name required"
 msgstr "E129: �� ������� ����� �������"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
 msgstr ""
-"E128: ����� ������� �� ���������� � ������ ����� ��� ������ ���������: %s"
+"E128: ����� ������� �� ���������� � ������ ����� ��� \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: ����� ������� �� ���� ���� ���������: %s"
 
 #, c-format
 msgid "E131: Cannot delete function %s: It is in use"
@@ -1036,6 +1063,10 @@ msgstr "E138: 
 msgid "Writing viminfo file \"%s\""
 msgstr "���������� ���� viminfo �%s�"
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: �� ������� ������������� ���� viminfo � %s!"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1233,6 +1264,10 @@ msgstr "E158: 
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: ������������ ID �������: %ld"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: ��������� ������ ���� %s"
+
 msgid " (NOT FOUND)"
 msgstr " (�� ��������)"
 
@@ -1707,12 +1742,6 @@ msgstr "[
 msgid "[converted]"
 msgstr "[������������]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[�����������]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[������� ��������ֲ� � ����� %ld]"
@@ -1733,9 +1762,6 @@ msgstr "
 msgid "can't read output of 'charconvert'"
 msgstr "�� ������� ��������� ���� 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: ���� ����������� �������� �������"
-
 # msgstr "E217: "
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: ���� ��������� ����������"
@@ -2710,6 +2736,13 @@ msgstr ""
 msgid "E836: This Vim cannot execute :python after using :py3"
 msgstr "E836: Python: �� ����� ����������� :py � :py3 � ������ �����"
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: �������, �� ������� ��������, ������ �������� Python �� ���� ���� "
+"�����������."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: �� ����� ���������� ��������� Python"
 
@@ -4130,15 +4163,6 @@ msgstr "E548: 
 msgid "E549: Illegal percentage"
 msgstr "E549: ������������ �������"
 
-msgid "Enter encryption key: "
-msgstr "������ ���� �����: "
-
-msgid "Enter same key again: "
-msgstr "�������� ����: "
-
-msgid "Keys don't match!"
-msgstr "����� �� �������!"
-
 msgid "E854: path too long for completion"
 msgstr "E854: ���� ������� ������ ��� ����������"
 
@@ -4316,6 +4340,13 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: �������� ��� ������� %d"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: ������ ������ � ���������� ����� �� ������ ������ ��� �� ����� "
+"�����"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "����.: %ld; "
@@ -4638,6 +4669,19 @@ msgstr ""
 "\n"
 "�� ������� ���������� �������� ������� ��� "
 
+msgid "Could not set security context "
+msgstr "�� ������� ���������� �������� ������� "
+
+msgid " for "
+msgstr " ��� "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "�� ������� �������� �������� ������� "
+
+msgid ". Removing it!\n"
+msgstr ". ������� ����!\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -4923,18 +4967,30 @@ msgstr "E554: 
 msgid "External submatches:\n"
 msgstr "�������� ��-����:\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA regexp) �� ����� ��������� %s"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
 msgstr ""
-"E864: ���� \\%#= ���� ���� ����� 0, 1, or 2. ���� ����������� ������������ �������� "
+"E864: ���� \\%#= ���� ���� ����� 0, 1, or 2. ���� ����������� ������������ "
+"�������� "
+
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "������������ �� ������ � ����������� ��� �������: "
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) ������ �������� ����� ����������� ������"
 
 #, c-format
 msgid "E866: (NFA regexp) Misplaced %c"
 msgstr "E866: (NFA regexp) �� �� ���� %c"
 
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) ������ �������� ����� ����������� ������"
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (NFA regexp) ������������ ���� �������: %ld"
 
 #, c-format
 msgid "E867: (NFA) Unknown operator '\\z%c'"
@@ -4988,7 +5044,8 @@ msgstr "E878: (NFA) 
 msgid ""
 "Could not open temporary log file for writing, displaying on stderr ... "
 msgstr ""
-"�� ������� ������� ���������� ���� ������� ��� ������, ���������� �� stderr ... "
+"�� ������� ������� ���������� ���� ������� ��� ������, ���������� �� "
+"stderr ... "
 
 #, c-format
 msgid "(NFA) COULD NOT OPEN %s !"
@@ -5871,8 +5928,8 @@ msgstr "
 
 #. This happens when the FileChangedRO autocommand changes the
 #. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: ʳ������ ����� ���������� ��������"
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: ʳ������ ����� ���������� ��������"
 
 #. must display the prompt
 msgid "No undo possible; continue anyway"
@@ -6368,6 +6425,10 @@ msgstr "E446: 
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: ���� �%s� �� �������� � ����� ������"
 
+# msgstr "E396: "
+msgid "List or number required"
+msgstr "������� ������ �� �����"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: �� ������� ����������� �������� %s"
@@ -6622,6 +6683,9 @@ msgstr "E485: 
 msgid "E37: No write since last change (add ! to override)"
 msgstr "E37: ���� �� ���� �������� (! ��� �� �������)"
 
+msgid "E37: No write since last change"
+msgstr "E37: �� �������� ��������� ����"
+
 msgid "E38: Null argument"
 msgstr "E38: ³������� ��������"
 
@@ -6812,7 +6876,8 @@ msgstr "
 msgid ""
 "expected int(), long() or something supporting coercing to long(), but got %s"
 msgstr ""
-"���������� int(), long() �� ����, �� ���� ���� ������ long(), ��� �������� %s"
+"���������� int(), long() �� ����, �� ���� ���� ������ long(), ��� �������� "
+"%s"
 
 #, c-format
 msgid "expected int() or something supporting coercing to int(), but got %s"
@@ -6824,7 +6889,7 @@ msgstr "
 msgid "value is too small to fit into C int type"
 msgstr "�������� ������, ��� ��������� � ��� C int"
 
-msgid "number must be greater then zero"
+msgid "number must be greater than zero"
 msgstr "����� �� ���� �����, ��� ����"
 
 msgid "number must be greater or equal to zero"
@@ -6870,7 +6935,8 @@ msgstr "
 
 #, c-format
 msgid "expected sequence element of size 2, but got sequence of size %d"
-msgstr "����������� ������������ ������� 2, ��� �������� ������������ ������ %d"
+msgstr ""
+"����������� ������������ ������� 2, ��� �������� ������������ ������ %d"
 
 msgid "list constructor does not accept keyword arguments"
 msgstr "��������� ����������� �� ������ ��������� ���������"
@@ -6883,16 +6949,31 @@ msgstr "
 msgid "internal error: failed to get vim list item %d"
 msgstr "�������� �������: �� ������� �������� ������� ������ vim %d"
 
-msgid "failed to add item to list"
-msgstr "�� ������� ������ ������� �� ������"
+msgid "slice step cannot be zero"
+msgstr "���� ���� �� ���� ���� ����"
+
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr "������ ���������� ������������ ������ �����, ��� %d, � ���������� ���"
 
 #, c-format
 msgid "internal error: no vim list item %d"
 msgstr "�������� �������: ���� �������� ������ vim %d"
 
+msgid "internal error: not enough list items"
+msgstr "�������� �������: ����� �������� � ������"
+
 msgid "internal error: failed to add item to list"
 msgstr "�������� �������: �� ������� ������ ������� �� ������"
 
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+"������ ���������� ������������ ������� %d � ���������� ��� ������ %d"
+
+msgid "failed to add item to list"
+msgstr "�� ������� ������ ������� �� ������"
+
 msgid "cannot delete vim.List attributes"
 msgstr "�� ������� ������� �������� vim.List"
 
diff --git a/src/po/uk.po b/src/po/uk.po
index 0c74293955..3ac0c4b442 100644
--- a/src/po/uk.po
+++ b/src/po/uk.po
@@ -12,7 +12,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: vim 7.4\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-09-29 09:05+0300\n"
+"POT-Creation-Date: 2014-11-08 08:23+0200\n"
 "PO-Revision-Date: 2010-06-18 21:53+0300\n"
 "Last-Translator: Анатолій Сахнік <sakhnik@gmail.com>\n"
 "Language-Team: Bohdan Vlasyuk <bohdan@vstu.edu.ua>\n"
@@ -81,6 +81,9 @@ msgstr "Витерто один буфер"
 msgid "%d buffers wiped out"
 msgstr "Витерто %d буфери(ів)"
 
+msgid "E90: Cannot unload last buffer"
+msgstr "E90: Не можу вивантажити останній буфер"
+
 msgid "E84: No modified buffer found"
 msgstr "E84: Жоден буфер не змінено"
 
@@ -102,9 +105,6 @@ msgstr "E88: Це вже найперший буфер"
 msgid "E89: No write since last change for buffer %ld (add ! to override)"
 msgstr "E89: Буфер %ld має зміни (! щоб не зважати)"
 
-msgid "E90: Cannot unload last buffer"
-msgstr "E90: Не можу вивантажити останній буфер"
-
 msgid "W14: Warning: List of file names overflow"
 msgstr "W14: Обережно: Список назв файлів переповнено"
 
@@ -204,6 +204,21 @@ msgstr "Позначки для %s:"
 msgid "    line=%ld  id=%d  name=%s"
 msgstr "    рядок=%ld  id=%d назва=%s"
 
+msgid "E821: File is encrypted with unknown method"
+msgstr "E821: Файл зашифровано невідомим методом"
+
+msgid "Enter encryption key: "
+msgstr "Вкажіть ключ шифру: "
+
+msgid "Enter same key again: "
+msgstr "Повторіть ключ: "
+
+msgid "Keys don't match!"
+msgstr "Ключі не однакові!"
+
+msgid "[crypted]"
+msgstr "[зашифровано]"
+
 #, c-format
 msgid "E96: Can not diff more than %ld buffers"
 msgstr "E96: Не можна порівнювати понад %ld буфери(ів)"
@@ -683,9 +698,17 @@ msgstr "E258: Не вдалося надіслати клієнту"
 msgid "sort() argument"
 msgstr "аргумент sort()"
 
+# msgstr "E14: "
+msgid "uniq() argument"
+msgstr "аргумент unique()"
+
 # msgstr "E364: "
 msgid "E702: Sort compare function failed"
-msgstr "E702: Помилка у функції порівняння"
+msgstr "E702: Помилка у функції порівняння sort"
+
+# msgstr "E364: "
+msgid "E882: Uniq compare function failed"
+msgstr "E882: Помилка у функції порівняння uniq"
 
 msgid "(Invalid)"
 msgstr "(Неможливо)"
@@ -783,9 +806,13 @@ msgid "E129: Function name required"
 msgstr "E129: Не вказано назву функції"
 
 #, c-format
-msgid "E128: Function name must start with a capital or contain a colon: %s"
+msgid "E128: Function name must start with a capital or \"s:\": %s"
 msgstr ""
-"E128: Назва функції має починатися з великої літери або містити двокрапку: %s"
+"E128: Назва функції має починатися з великої літери або \"s:\": %s"
+
+#, c-format
+msgid "E884: Function name cannot contain a colon: %s"
+msgstr "E884: Назва функції не може мати двокрапку: %s"
 
 #, c-format
 msgid "E131: Cannot delete function %s: It is in use"
@@ -1036,6 +1063,10 @@ msgstr "E138: Не вдалося записати файл viminfo %s!"
 msgid "Writing viminfo file \"%s\""
 msgstr "Записується файл viminfo «%s»"
 
+#, c-format
+msgid "E886: Can't rename viminfo file to %s!"
+msgstr "E886: Не вдалося перейменувати файл viminfo у %s!"
+
 #. Write the info:
 #, c-format
 msgid "# This viminfo file was generated by Vim %s.\n"
@@ -1233,6 +1264,10 @@ msgstr "E158: Некоректна назва буфера: %s"
 msgid "E157: Invalid sign ID: %ld"
 msgstr "E157: Неправильний ID надпису: %ld"
 
+#, c-format
+msgid "E885: Not possible to change sign %s"
+msgstr "E885: Неможливо змінити знак %s"
+
 msgid " (NOT FOUND)"
 msgstr " (НЕ ЗНАЙДЕНО)"
 
@@ -1707,12 +1742,6 @@ msgstr "[НЕ конвертовано]"
 msgid "[converted]"
 msgstr "[конвертовано]"
 
-msgid "[blowfish]"
-msgstr "[blowfish]"
-
-msgid "[crypted]"
-msgstr "[зашифровано]"
-
 #, c-format
 msgid "[CONVERSION ERROR in line %ld]"
 msgstr "[ПОМИЛКА КОНВЕРТАЦІЇ у рядку %ld]"
@@ -1733,9 +1762,6 @@ msgstr "Конвертація з 'charconvert' не вдалася"
 msgid "can't read output of 'charconvert'"
 msgstr "не вдалося прочитати вивід 'charconvert'"
 
-msgid "E821: File is encrypted with unknown method"
-msgstr "E821: Файл зашифровано невідомим методом"
-
 # msgstr "E217: "
 msgid "E676: No matching autocommands for acwrite buffer"
 msgstr "E676: Немає відповідних автокоманд"
@@ -2710,6 +2736,13 @@ msgstr ""
 msgid "E836: This Vim cannot execute :python after using :py3"
 msgstr "E836: Python: Не можна використати :py і :py3 в одному сеансі"
 
+msgid ""
+"E887: Sorry, this command is disabled, the Python's site module could not be "
+"loaded."
+msgstr ""
+"E887: Вибачте, ця команда вимкнена, місцева бібліотека Python не може бути "
+"завантажена."
+
 msgid "E659: Cannot invoke Python recursively"
 msgstr "E659: Не можна рекурсивно викликати Python"
 
@@ -4130,15 +4163,6 @@ msgstr "E548: Потрібна цифра"
 msgid "E549: Illegal percentage"
 msgstr "E549: Неправильний відсоток"
 
-msgid "Enter encryption key: "
-msgstr "Вкажіть ключ шифру: "
-
-msgid "Enter same key again: "
-msgstr "Повторіть ключ: "
-
-msgid "Keys don't match!"
-msgstr "Ключі не однакові!"
-
 msgid "E854: path too long for completion"
 msgstr "E854: шлях занадто довгий для доповнення"
 
@@ -4316,6 +4340,13 @@ msgstr ""
 msgid "E574: Unknown register type %d"
 msgstr "E574: Невідомий тип регістру %d"
 
+msgid ""
+"E883: search pattern and expression register may not contain two or more "
+"lines"
+msgstr ""
+"E883: шаблон пошуку і регістровий вираз не можуть містити два чи більше "
+"рядків"
+
 #, c-format
 msgid "%ld Cols; "
 msgstr "довж.: %ld; "
@@ -4638,6 +4669,19 @@ msgstr ""
 "\n"
 "Не вдалося встановити контекст безпеки для "
 
+msgid "Could not set security context "
+msgstr "Не вдалося встановити контекст безпеки "
+
+msgid " for "
+msgstr " для "
+
+#. no enough size OR unexpected error
+msgid "Could not get security context "
+msgstr "Не вдалося отримати контекст безпеки "
+
+msgid ". Removing it!\n"
+msgstr ". Знищуємо його!\n"
+
 msgid ""
 "\n"
 "Cannot execute shell "
@@ -4923,18 +4967,30 @@ msgstr "E554: Синтаксична помилка в %s{...}"
 msgid "External submatches:\n"
 msgstr "Зовнішні під-збіги:\n"
 
+#, c-format
+msgid "E888: (NFA regexp) cannot repeat %s"
+msgstr "E888: (NFA regexp) не можна повторити %s"
+
 msgid ""
 "E864: \\%#= can only be followed by 0, 1, or 2. The automatic engine will be "
 "used "
 msgstr ""
-"E864: після \\%#= може бути тільки 0, 1, or 2. Буде використано автоматичний механізм "
+"E864: після \\%#= може бути тільки 0, 1, or 2. Буде використано автоматичний "
+"механізм "
+
+msgid "Switching to backtracking RE engine for pattern: "
+msgstr "Перемикаємося до пошуку з поверненням для шаблона: "
+
+msgid "E865: (NFA) Regexp end encountered prematurely"
+msgstr "E865: (NFA) Зарано трапився кінець регулярного виразу"
 
 #, c-format
 msgid "E866: (NFA regexp) Misplaced %c"
 msgstr "E866: (NFA regexp) Не на місці %c"
 
-msgid "E865: (NFA) Regexp end encountered prematurely"
-msgstr "E865: (NFA) Зарано трапився кінець регулярного виразу"
+#, c-format
+msgid "E877: (NFA regexp) Invalid character class: %ld"
+msgstr "E877: (NFA regexp) Неправильний клас символу: %ld"
 
 #, c-format
 msgid "E867: (NFA) Unknown operator '\\z%c'"
@@ -4988,7 +5044,8 @@ msgstr "E878: (NFA) Не вдалося отримати пам’ять для
 msgid ""
 "Could not open temporary log file for writing, displaying on stderr ... "
 msgstr ""
-"Не вдалося відкрити тимчасовий файл журналу для запису, показується на stderr ... "
+"Не вдалося відкрити тимчасовий файл журналу для запису, показується на "
+"stderr ... "
 
 #, c-format
 msgid "(NFA) COULD NOT OPEN %s !"
@@ -5871,8 +5928,8 @@ msgstr "Використано CUT_BUFFER0 замість порожнього 
 
 #. This happens when the FileChangedRO autocommand changes the
 #. * file in a way it becomes shorter.
-msgid "E834: Line count changed unexpectedly"
-msgstr "E834: Кількість рядків несподівано змінилася"
+msgid "E881: Line count changed unexpectedly"
+msgstr "E881: Кількість рядків несподівано змінилася"
 
 #. must display the prompt
 msgid "No undo possible; continue anyway"
@@ -6368,6 +6425,10 @@ msgstr "E446: Немає назви файлу над курсором"
 msgid "E447: Can't find file \"%s\" in path"
 msgstr "E447: Файл «%s» не знайдено у шляху пошуку"
 
+# msgstr "E396: "
+msgid "List or number required"
+msgstr "Потрібен список чи число"
+
 #, c-format
 msgid "E370: Could not load library %s"
 msgstr "E370: Не вдалося завантажити бібліотеку %s"
@@ -6622,6 +6683,9 @@ msgstr "E485: Не вдалося прочитати файл %s"
 msgid "E37: No write since last change (add ! to override)"
 msgstr "E37: Зміни не було записано (! щоб не зважати)"
 
+msgid "E37: No write since last change"
+msgstr "E37: Не записано попередні зміни"
+
 msgid "E38: Null argument"
 msgstr "E38: Відсутній аргумент"
 
@@ -6812,7 +6876,8 @@ msgstr "очікувався екземпляр bytes() чи str(), але от
 msgid ""
 "expected int(), long() or something supporting coercing to long(), but got %s"
 msgstr ""
-"очікувався int(), long() чи щось, що може бути вміщене long(), але отримано %s"
+"очікувався int(), long() чи щось, що може бути вміщене long(), але отримано "
+"%s"
 
 #, c-format
 msgid "expected int() or something supporting coercing to int(), but got %s"
@@ -6824,7 +6889,7 @@ msgstr "значення завелике, щоб вміститися у тип
 msgid "value is too small to fit into C int type"
 msgstr "значення замале, щоб вміститися у тип C int"
 
-msgid "number must be greater then zero"
+msgid "number must be greater than zero"
 msgstr "число має бути більше, ніж нуль"
 
 msgid "number must be greater or equal to zero"
@@ -6870,7 +6935,8 @@ msgstr "хеш-таблиця змінилася під час перебира
 
 #, c-format
 msgid "expected sequence element of size 2, but got sequence of size %d"
-msgstr "очікувалась послідовність розміром 2, але отримано послідовність розміру %d"
+msgstr ""
+"очікувалась послідовність розміром 2, але отримано послідовність розміру %d"
 
 msgid "list constructor does not accept keyword arguments"
 msgstr "списковий конструктор не приймає іменовані аргументи"
@@ -6883,16 +6949,31 @@ msgstr "індекс списку за межами"
 msgid "internal error: failed to get vim list item %d"
 msgstr "внутрішня помилка: не вдалося отримати елемент списку vim %d"
 
-msgid "failed to add item to list"
-msgstr "не вдалося додати елемент до списку"
+msgid "slice step cannot be zero"
+msgstr "крок зрізу не може бути нуль"
+
+#, c-format
+msgid "attempt to assign sequence of size greater than %d to extended slice"
+msgstr "спроба призначити послідовність розміру більше, ніж %d, у розширений зріз"
 
 #, c-format
 msgid "internal error: no vim list item %d"
 msgstr "внутрішня помилка: немає елемента списку vim %d"
 
+msgid "internal error: not enough list items"
+msgstr "внутрішня помилка: бракує елементів у списку"
+
 msgid "internal error: failed to add item to list"
 msgstr "внутрішня помилка: не вдалося додати елемент до списку"
 
+#, c-format
+msgid "attempt to assign sequence of size %d to extended slice of size %d"
+msgstr ""
+"спроба призначити послідовність розміром %d у розширений зріз розміру %d"
+
+msgid "failed to add item to list"
+msgstr "не вдалося додати елемент до списку"
+
 msgid "cannot delete vim.List attributes"
 msgstr "не вдалося знищити атрибути vim.List"
 

From 578479a34795856cc7d22cda426e20eea6f7aacf Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 13:21:57 +0100
Subject: [PATCH 280/473] updated for version 7.4.517 Problem:    With a
 wrapping line the cursor may not end up in the right place. 	    (Nazri
 Ramliy) Solution:   Adjust n_extra for a Tab that wraps. (Christian Brabandt)

---
 src/screen.c  | 4 ++++
 src/version.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/screen.c b/src/screen.c
index 36afc2dcda..e11bdc3775 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -4456,6 +4456,10 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		    /* TODO: is passing p for start of the line OK? */
 		    n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol,
 								    NULL) - 1;
+		    if (c == TAB && n_extra + col > W_WIDTH(wp))
+			n_extra = (int)wp->w_buffer->b_p_ts
+				       - vcol % (int)wp->w_buffer->b_p_ts - 1;
+
 		    c_extra = ' ';
 		    if (vim_iswhite(c))
 		    {
diff --git a/src/version.c b/src/version.c
index 826679ef38..ae9fbad89d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    517,
 /**/
     516,
 /**/

From 0dd973a04ab357f97937958e3425fa9f27c74f87 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 13:21:58 +0100
Subject: [PATCH 281/473] Added tag v7-4-517 for changeset 93560d4bca68

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3353883d63..6ea2611e57 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3239,3 +3239,4 @@ edfa81ea17117e6db410db58cb2a26789aff50b5 v7-4-504
 e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 387e636805243f4ade8da63fa7c115dec64aa56e v7-4-515
 81c9b19ee0fb867a8364f73bdcc865676220cb0b v7-4-516
+93560d4bca68e9086539c273c4e3f7e792fc1739 v7-4-517

From 81b367eb0758e7d1635783070042d63117a39596 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 13:40:08 +0100
Subject: [PATCH 282/473] updated for version 7.4.518 Problem:    Using status
 line height in width computations. Solution:   Use one instead. (Hirohito
 Higashi)

---
 src/version.c | 2 ++
 src/window.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/version.c b/src/version.c
index ae9fbad89d..910ffaab94 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    518,
 /**/
     517,
 /**/
diff --git a/src/window.c b/src/window.c
index b975a61420..6490fd3868 100644
--- a/src/window.c
+++ b/src/window.c
@@ -796,7 +796,7 @@ win_split_ins(size, flags, new_wp, dir)
 		if (frp->fr_win != oldwin && frp->fr_win != NULL
 			&& (frp->fr_win->w_width > new_size
 			    || frp->fr_win->w_width > oldwin->w_width
-						   - new_size - STATUS_HEIGHT))
+							      - new_size - 1))
 		{
 		    do_equal = TRUE;
 		    break;

From 18109ff8e5e7898ebc4d477de5f0b6655088f8ca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 13:40:09 +0100
Subject: [PATCH 283/473] Added tag v7-4-518 for changeset 383cb9ddb561

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6ea2611e57..9801f8cd91 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3240,3 +3240,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 387e636805243f4ade8da63fa7c115dec64aa56e v7-4-515
 81c9b19ee0fb867a8364f73bdcc865676220cb0b v7-4-516
 93560d4bca68e9086539c273c4e3f7e792fc1739 v7-4-517
+383cb9ddb56115f95933c5b994e0cec64ee578a5 v7-4-518

From 7bbc9cc2ae97da5f757fdc6ceb35c9185f9c9ff1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 16:38:07 +0100
Subject: [PATCH 284/473] updated for version 7.4.519 Problem:    Crash when
 using syntax highlighting. Solution:   When regprog is freed and replaced,
 store the result.

---
 src/buffer.c         | 48 ++++++++++++++++++++++----------------------
 src/ex_cmds2.c       |  5 +----
 src/fileio.c         | 17 ++++++++++------
 src/os_unix.c        |  6 +-----
 src/proto/fileio.pro |  1 -
 src/proto/regexp.pro |  1 +
 src/regexp.c         | 26 ++++++++++++++++++++++++
 src/spell.c          | 28 +++++++++++---------------
 src/syntax.c         | 28 ++++++++++++++++++--------
 src/version.c        |  2 ++
 10 files changed, 98 insertions(+), 64 deletions(-)

diff --git a/src/buffer.c b/src/buffer.c
index 9eb67164e9..37182e146c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,9 +28,9 @@
 #include "vim.h"
 
 #if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
-static char_u	*buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
+static char_u	*buflist_match __ARGS((regmatch_T *rmp, buf_T *buf, int ignore_case));
 # define HAVE_BUFLIST_MATCH
-static char_u	*fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
+static char_u	*fname_match __ARGS((regmatch_T *rmp, char_u *name, int ignore_case));
 #endif
 static void	buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
 static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
@@ -2220,7 +2220,6 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
     int		curtab_only;	/* find buffers in current tab only */
 {
     buf_T	*buf;
-    regprog_T	*prog;
     int		match = -1;
     int		find_listed;
     char_u	*pat;
@@ -2265,14 +2264,16 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
 	{
 	    for (attempt = 0; attempt <= 3; ++attempt)
 	    {
+		regmatch_T	regmatch;
+
 		/* may add '^' and '$' */
 		if (toggledollar)
 		    *patend = (attempt < 2) ? NUL : '$'; /* add/remove '$' */
 		p = pat;
 		if (*p == '^' && !(attempt & 1))	 /* add/remove '^' */
 		    ++p;
-		prog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
-		if (prog == NULL)
+		regmatch.regprog = vim_regcomp(p, p_magic ? RE_MAGIC : 0);
+		if (regmatch.regprog == NULL)
 		{
 		    vim_free(pat);
 		    return -1;
@@ -2283,7 +2284,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
 #ifdef FEAT_DIFF
 			    && (!diffmode || diff_mode_buf(buf))
 #endif
-			    && buflist_match(prog, buf, FALSE) != NULL)
+			    && buflist_match(&regmatch, buf, FALSE) != NULL)
 		    {
 			if (curtab_only)
 			{
@@ -2310,7 +2311,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
 			match = buf->b_fnum;	/* remember first match */
 		    }
 
-		vim_regfree(prog);
+		vim_regfree(regmatch.regprog);
 		if (match >= 0)			/* found one match */
 		    break;
 	    }
@@ -2352,7 +2353,6 @@ ExpandBufnames(pat, num_file, file, options)
     int		round;
     char_u	*p;
     int		attempt;
-    regprog_T	*prog;
     char_u	*patc;
 
     *num_file = 0;		    /* return values in case of FAIL */
@@ -2376,10 +2376,12 @@ ExpandBufnames(pat, num_file, file, options)
      */
     for (attempt = 0; attempt <= 1; ++attempt)
     {
+	regmatch_T	regmatch;
+
 	if (attempt > 0 && patc == pat)
 	    break;	/* there was no anchor, no need to try again */
-	prog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
-	if (prog == NULL)
+	regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC);
+	if (regmatch.regprog == NULL)
 	{
 	    if (patc != pat)
 		vim_free(patc);
@@ -2397,7 +2399,7 @@ ExpandBufnames(pat, num_file, file, options)
 	    {
 		if (!buf->b_p_bl)	/* skip unlisted buffers */
 		    continue;
-		p = buflist_match(prog, buf, p_wic);
+		p = buflist_match(&regmatch, buf, p_wic);
 		if (p != NULL)
 		{
 		    if (round == 1)
@@ -2419,14 +2421,14 @@ ExpandBufnames(pat, num_file, file, options)
 		*file = (char_u **)alloc((unsigned)(count * sizeof(char_u *)));
 		if (*file == NULL)
 		{
-		    vim_regfree(prog);
+		    vim_regfree(regmatch.regprog);
 		    if (patc != pat)
 			vim_free(patc);
 		    return FAIL;
 		}
 	    }
 	}
-	vim_regfree(prog);
+	vim_regfree(regmatch.regprog);
 	if (count)		/* match(es) found, break here */
 	    break;
     }
@@ -2445,17 +2447,17 @@ ExpandBufnames(pat, num_file, file, options)
  * Check for a match on the file name for buffer "buf" with regprog "prog".
  */
     static char_u *
-buflist_match(prog, buf, ignore_case)
-    regprog_T	*prog;
+buflist_match(rmp, buf, ignore_case)
+    regmatch_T	*rmp;
     buf_T	*buf;
     int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match;
 
     /* First try the short file name, then the long file name. */
-    match = fname_match(prog, buf->b_sfname, ignore_case);
+    match = fname_match(rmp, buf->b_sfname, ignore_case);
     if (match == NULL)
-	match = fname_match(prog, buf->b_ffname, ignore_case);
+	match = fname_match(rmp, buf->b_ffname, ignore_case);
 
     return match;
 }
@@ -2465,27 +2467,25 @@ buflist_match(prog, buf, ignore_case)
  * Return "name" when there is a match, NULL when not.
  */
     static char_u *
-fname_match(prog, name, ignore_case)
-    regprog_T	*prog;
+fname_match(rmp, name, ignore_case)
+    regmatch_T	*rmp;
     char_u	*name;
     int		ignore_case;  /* when TRUE ignore case, when FALSE use 'fic' */
 {
     char_u	*match = NULL;
     char_u	*p;
-    regmatch_T	regmatch;
 
     if (name != NULL)
     {
-	regmatch.regprog = prog;
 	/* Ignore case when 'fileignorecase' or the argument is set. */
-	regmatch.rm_ic = p_fic || ignore_case;
-	if (vim_regexec(&regmatch, name, (colnr_T)0))
+	rmp->rm_ic = p_fic || ignore_case;
+	if (vim_regexec(rmp, name, (colnr_T)0))
 	    match = name;
 	else
 	{
 	    /* Replace $(HOME) with '~' and try matching again. */
 	    p = home_replace_save(NULL, name);
-	    if (p != NULL && vim_regexec(&regmatch, p, (colnr_T)0))
+	    if (p != NULL && vim_regexec(rmp, p, (colnr_T)0))
 		match = name;
 	    vim_free(p);
 	}
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 908552d580..4614deab80 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -739,7 +739,6 @@ debuggy_find(file, fname, after, gap, fp)
     struct debuggy *bp;
     int		i;
     linenr_T	lnum = 0;
-    regmatch_T	regmatch;
     char_u	*name = fname;
     int		prev_got_int;
 
@@ -771,8 +770,6 @@ debuggy_find(file, fname, after, gap, fp)
 #endif
 		(bp->dbg_lnum > after && (lnum == 0 || bp->dbg_lnum < lnum)))))
 	{
-	    regmatch.regprog = bp->dbg_prog;
-	    regmatch.rm_ic = FALSE;
 	    /*
 	     * Save the value of got_int and reset it.  We don't want a
 	     * previous interruption cancel matching, only hitting CTRL-C
@@ -780,7 +777,7 @@ debuggy_find(file, fname, after, gap, fp)
 	     */
 	    prev_got_int = got_int;
 	    got_int = FALSE;
-	    if (vim_regexec(&regmatch, name, (colnr_T)0))
+	    if (vim_regexec_prog(&bp->dbg_prog, FALSE, name, (colnr_T)0))
 	    {
 		lnum = bp->dbg_lnum;
 		if (fp != NULL)
diff --git a/src/fileio.c b/src/fileio.c
index a978ec241d..0af3627f8e 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7772,6 +7772,9 @@ static int au_get_grouparg __ARGS((char_u **argp));
 static int do_autocmd_event __ARGS((event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group));
 static int apply_autocmds_group __ARGS((event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap));
 static void auto_next_pat __ARGS((AutoPatCmd *apc, int stop_at_last));
+#if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN)
+static int match_file_pat __ARGS((char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
+#endif
 
 
 static event_T	last_event;
@@ -9640,7 +9643,7 @@ auto_next_pat(apc, stop_at_last)
 	{
 	    /* execution-condition */
 	    if (ap->buflocal_nr == 0
-		    ? (match_file_pat(NULL, ap->reg_prog, apc->fname,
+		    ? (match_file_pat(NULL, &ap->reg_prog, apc->fname,
 				      apc->sfname, apc->tail, ap->allow_dirs))
 		    : ap->buflocal_nr == apc->arg_bufnr)
 	    {
@@ -9774,7 +9777,7 @@ has_autocmd(event, sfname, buf)
     for (ap = first_autopat[(int)event]; ap != NULL; ap = ap->next)
 	if (ap->pat != NULL && ap->cmds != NULL
 	      && (ap->buflocal_nr == 0
-		? match_file_pat(NULL, ap->reg_prog,
+		? match_file_pat(NULL, &ap->reg_prog,
 					  fname, sfname, tail, ap->allow_dirs)
 		: buf != NULL && ap->buflocal_nr == buf->b_fnum
 	   ))
@@ -10035,10 +10038,10 @@ aucmd_restbuf(aco)
  * Used for autocommands and 'wildignore'.
  * Returns TRUE if there is a match, FALSE otherwise.
  */
-    int
+    static int
 match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
     char_u	*pattern;		/* pattern to match with */
-    regprog_T	*prog;			/* pre-compiled regprog or NULL */
+    regprog_T	**prog;			/* pre-compiled regprog or NULL */
     char_u	*fname;			/* full path of file name */
     char_u	*sfname;		/* short file name or NULL */
     char_u	*tail;			/* tail of path */
@@ -10093,7 +10096,7 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
 #endif
     {
 	if (prog != NULL)
-	    regmatch.regprog = prog;
+	    regmatch.regprog = *prog;
 	else
 	    regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
     }
@@ -10119,7 +10122,9 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
 		 || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
 	result = TRUE;
 
-    if (prog == NULL)
+    if (prog != NULL)
+	*prog = regmatch.regprog;
+    else
 	vim_regfree(regmatch.regprog);
     return result;
 }
diff --git a/src/os_unix.c b/src/os_unix.c
index 6209605cfa..8cd6b14eb7 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1610,8 +1610,6 @@ x_IOerror_handler(dpy)
     static int
 x_connect_to_server()
 {
-    regmatch_T	regmatch;
-
 #if defined(FEAT_CLIENTSERVER)
     if (x_force_connect)
 	return TRUE;
@@ -1622,9 +1620,7 @@ x_connect_to_server()
     /* Check for a match with "exclude:" from 'clipboard'. */
     if (clip_exclude_prog != NULL)
     {
-	regmatch.rm_ic = FALSE;		/* Don't ignore case */
-	regmatch.regprog = clip_exclude_prog;
-	if (vim_regexec(&regmatch, T_NAME, (colnr_T)0))
+	if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
 	    return FALSE;
     }
     return TRUE;
diff --git a/src/proto/fileio.pro b/src/proto/fileio.pro
index 5b71d0aadc..45e7b38727 100644
--- a/src/proto/fileio.pro
+++ b/src/proto/fileio.pro
@@ -59,7 +59,6 @@ char_u *set_context_in_autocmd __ARGS((expand_T *xp, char_u *arg, int doautocmd)
 char_u *get_event_name __ARGS((expand_T *xp, int idx));
 int autocmd_supported __ARGS((char_u *name));
 int au_exists __ARGS((char_u *arg));
-int match_file_pat __ARGS((char_u *pattern, regprog_T *prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs));
 int match_file_list __ARGS((char_u *list, char_u *sfname, char_u *ffname));
 char_u *file_pat_to_reg_pat __ARGS((char_u *pat, char_u *pat_end, char *allow_dirs, int no_bslash));
 long read_eintr __ARGS((int fd, void *buf, size_t bufsize));
diff --git a/src/proto/regexp.pro b/src/proto/regexp.pro
index a42c5944a8..099121eaef 100644
--- a/src/proto/regexp.pro
+++ b/src/proto/regexp.pro
@@ -13,6 +13,7 @@ char_u *reg_submatch __ARGS((int no));
 list_T *reg_submatch_list __ARGS((int no));
 regprog_T *vim_regcomp __ARGS((char_u *expr_arg, int re_flags));
 void vim_regfree __ARGS((regprog_T *prog));
+int vim_regexec_prog __ARGS((regprog_T **prog, int ignore_case, char_u *line, colnr_T col));
 int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
 int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col));
 long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm));
diff --git a/src/regexp.c b/src/regexp.c
index 6e5655a995..fe28dc6845 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -8163,6 +8163,7 @@ static int vim_regexec_both __ARGS((regmatch_T *rmp, char_u *line, colnr_T col,
 /*
  * Match a regexp against a string.
  * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Note: "rmp->regprog" may be freed and changed.
  * Uses curbuf for line count and 'iskeyword'.
  * When "nl" is TRUE consider a "\n" in "line" to be a line break.
  *
@@ -8203,6 +8204,29 @@ vim_regexec_both(rmp, line, col, nl)
     return result;
 }
 
+/*
+ * Note: "*prog" may be freed and changed.
+ */
+    int
+vim_regexec_prog(prog, ignore_case, line, col)
+    regprog_T	**prog;
+    int		ignore_case;
+    char_u	*line;
+    colnr_T	col;
+{
+    int r;
+    regmatch_T regmatch;
+
+    regmatch.regprog = *prog;
+    regmatch.rm_ic = ignore_case;
+    r = vim_regexec_both(&regmatch, line, col, FALSE);
+    *prog = regmatch.regprog;
+    return r;
+}
+
+/*
+ * Note: "rmp->regprog" may be freed and changed.
+ */
     int
 vim_regexec(rmp, line, col)
     regmatch_T	*rmp;
@@ -8216,6 +8240,7 @@ vim_regexec(rmp, line, col)
 	|| defined(FIND_REPLACE_DIALOG) || defined(PROTO)
 /*
  * Like vim_regexec(), but consider a "\n" in "line" to be a line break.
+ * Note: "rmp->regprog" may be freed and changed.
  */
     int
 vim_regexec_nl(rmp, line, col)
@@ -8230,6 +8255,7 @@ vim_regexec_nl(rmp, line, col)
 /*
  * Match a regexp against multiple lines.
  * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
+ * Note: "rmp->regprog" may be freed and changed.
  * Uses curbuf for line count and 'iskeyword'.
  *
  * Return zero if there is no match.  Return number of lines contained in the
diff --git a/src/spell.c b/src/spell.c
index 1e52dfb26e..9d7f933a26 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1154,11 +1154,14 @@ spell_check(wp, ptr, attrp, capcol, docount)
 	    if (capcol != NULL && wp->w_s->b_cap_prog != NULL)
 	    {
 		regmatch_T	regmatch;
+		int		r;
 
 		/* Check for end of sentence. */
 		regmatch.regprog = wp->w_s->b_cap_prog;
 		regmatch.rm_ic = FALSE;
-		if (vim_regexec(&regmatch, ptr, 0))
+		r = vim_regexec(&regmatch, ptr, 0);
+		wp->w_s->b_cap_prog = regmatch.regprog;
+		if (r)
 		    *capcol = (int)(regmatch.endp[0] - ptr);
 	    }
 
@@ -1786,7 +1789,6 @@ can_compound(slang, word, flags)
     char_u	*word;
     char_u	*flags;
 {
-    regmatch_T	regmatch;
 #ifdef FEAT_MBYTE
     char_u	uflags[MAXWLEN * 2];
     int		i;
@@ -1808,9 +1810,7 @@ can_compound(slang, word, flags)
     else
 #endif
 	p = flags;
-    regmatch.regprog = slang->sl_compprog;
-    regmatch.rm_ic = FALSE;
-    if (!vim_regexec(&regmatch, p, 0))
+    if (!vim_regexec_prog(&slang->sl_compprog, FALSE, p, 0))
 	return FALSE;
 
     /* Count the number of syllables.  This may be slow, do it last.  If there
@@ -1930,8 +1930,7 @@ valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
 {
     int		prefcnt;
     int		pidx;
-    regprog_T	*rp;
-    regmatch_T	regmatch;
+    regprog_T	**rp;
     int		prefid;
 
     prefid = (unsigned)flags >> 24;
@@ -1950,12 +1949,10 @@ valid_word_prefix(totprefcnt, arridx, flags, word, slang, cond_req)
 
 	/* Check the condition, if there is one.  The condition index is
 	 * stored in the two bytes above the prefix ID byte.  */
-	rp = slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
-	if (rp != NULL)
+	rp = &slang->sl_prefprog[((unsigned)pidx >> 8) & 0xffff];
+	if (*rp != NULL)
 	{
-	    regmatch.regprog = rp;
-	    regmatch.rm_ic = FALSE;
-	    if (!vim_regexec(&regmatch, word, 0))
+	    if (!vim_regexec_prog(rp, FALSE, word, 0))
 		continue;
 	}
 	else if (cond_req)
@@ -6903,7 +6900,6 @@ store_aff_word(spin, word, afflist, affile, ht, xht, condit, flags,
     hashitem_T	*hi;
     affheader_T	*ah;
     affentry_T	*ae;
-    regmatch_T	regmatch;
     char_u	newword[MAXWLEN];
     int		retval = OK;
     int		i, j;
@@ -6944,15 +6940,14 @@ store_aff_word(spin, word, afflist, affile, ht, xht, condit, flags,
 		     * When a previously added affix had CIRCUMFIX this one
 		     * must have it too, if it had not then this one must not
 		     * have one either. */
-		    regmatch.regprog = ae->ae_prog;
-		    regmatch.rm_ic = FALSE;
 		    if ((xht != NULL || !affile->af_pfxpostpone
 				|| ae->ae_chop != NULL
 				|| ae->ae_flags != NULL)
 			    && (ae->ae_chop == NULL
 				|| STRLEN(ae->ae_chop) < wordlen)
 			    && (ae->ae_prog == NULL
-				|| vim_regexec(&regmatch, word, (colnr_T)0))
+				|| vim_regexec_prog(&ae->ae_prog, FALSE,
+							    word, (colnr_T)0))
 			    && (((condit & CONDIT_CFIX) == 0)
 				== ((condit & CONDIT_AFF) == 0
 				    || ae->ae_flags == NULL
@@ -10478,6 +10473,7 @@ check_need_cap(lnum, col)
 		break;
 	    }
 	}
+	curwin->w_s->b_cap_prog = regmatch.regprog;
     }
 
     vim_free(line_copy);
diff --git a/src/syntax.c b/src/syntax.c
index a935810181..fcd20c8ace 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -992,13 +992,16 @@ syn_match_linecont(lnum)
     linenr_T	lnum;
 {
     regmmatch_T regmatch;
+    int r;
 
     if (syn_block->b_syn_linecont_prog != NULL)
     {
 	regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
 	regmatch.regprog = syn_block->b_syn_linecont_prog;
-	return syn_regexec(&regmatch, lnum, (colnr_T)0,
+	r = syn_regexec(&regmatch, lnum, (colnr_T)0,
 				IF_SYN_TIME(&syn_block->b_syn_linecont_time));
+	syn_block->b_syn_linecont_prog = regmatch.regprog;
+	return r;
     }
     return FALSE;
 }
@@ -2075,6 +2078,8 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
 					    cur_si->si_cont_list, &spp->sp_syn,
 					    spp->sp_flags & HL_CONTAINED))))
 			{
+			    int r;
+
 			    /* If we already tried matching in this line, and
 			     * there isn't a match before next_match_col, skip
 			     * this item. */
@@ -2089,10 +2094,12 @@ syn_current_attr(syncing, displaying, can_spell, keep_state)
 
 			    regmatch.rmm_ic = spp->sp_ic;
 			    regmatch.regprog = spp->sp_prog;
-			    if (!syn_regexec(&regmatch,
+			    r = syn_regexec(&regmatch,
 					     current_lnum,
 					     (colnr_T)lc_col,
-				             IF_SYN_TIME(&spp->sp_time)))
+				             IF_SYN_TIME(&spp->sp_time));
+			    spp->sp_prog = regmatch.regprog;
+			    if (!r)
 			    {
 				/* no match in this line, try another one */
 				spp->sp_startcol = MAXCOL;
@@ -2963,6 +2970,7 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
 	for (idx = start_idx; idx < syn_block->b_syn_patterns.ga_len; ++idx)
 	{
 	    int lc_col = matchcol;
+	    int r;
 
 	    spp = &(SYN_ITEMS(syn_block)[idx]);
 	    if (spp->sp_type != SPTYPE_END)	/* past last END pattern */
@@ -2973,8 +2981,10 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
 
 	    regmatch.rmm_ic = spp->sp_ic;
 	    regmatch.regprog = spp->sp_prog;
-	    if (syn_regexec(&regmatch, startpos->lnum, lc_col,
-						  IF_SYN_TIME(&spp->sp_time)))
+	    r = syn_regexec(&regmatch, startpos->lnum, lc_col,
+						  IF_SYN_TIME(&spp->sp_time));
+	    spp->sp_prog = regmatch.regprog;
+	    if (r)
 	    {
 		if (best_idx == -1 || regmatch.startpos[0].col
 					      < best_regmatch.startpos[0].col)
@@ -3000,14 +3010,16 @@ find_endpos(idx, startpos, m_endpos, hl_endpos, flagsp, end_endpos,
 	if (spp_skip != NULL)
 	{
 	    int lc_col = matchcol - spp_skip->sp_offsets[SPO_LC_OFF];
+	    int r;
 
 	    if (lc_col < 0)
 		lc_col = 0;
 	    regmatch.rmm_ic = spp_skip->sp_ic;
 	    regmatch.regprog = spp_skip->sp_prog;
-	    if (syn_regexec(&regmatch, startpos->lnum, lc_col,
-					      IF_SYN_TIME(&spp_skip->sp_time))
-		    && regmatch.startpos[0].col
+	    r = syn_regexec(&regmatch, startpos->lnum, lc_col,
+					      IF_SYN_TIME(&spp_skip->sp_time));
+	    spp_skip->sp_prog = regmatch.regprog;
+	    if (r && regmatch.startpos[0].col
 					     <= best_regmatch.startpos[0].col)
 	    {
 		/* Add offset to skip pattern match */
diff --git a/src/version.c b/src/version.c
index 910ffaab94..88a57b9d70 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    519,
 /**/
     518,
 /**/

From a470c515e2456826936cbcb45f45991e9d80b34c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 16:38:07 +0100
Subject: [PATCH 285/473] Added tag v7-4-519 for changeset 27a36d1013a6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9801f8cd91..7f119a7b28 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3241,3 +3241,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 81c9b19ee0fb867a8364f73bdcc865676220cb0b v7-4-516
 93560d4bca68e9086539c273c4e3f7e792fc1739 v7-4-517
 383cb9ddb56115f95933c5b994e0cec64ee578a5 v7-4-518
+27a36d1013a6dcf699ea9b2ade80d74329257dbd v7-4-519

From f22fcc2f678b6f05e815659fcff32cae7bd037f0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 17:05:55 +0100
Subject: [PATCH 286/473] updated for version 7.4.520 Problem:    Sun PCK
 locale is not recognzed. Solution:   Add PCK in the table. (Keiichi Oono)

---
 src/mbyte.c   | 1 +
 src/version.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/mbyte.c b/src/mbyte.c
index 44cbd5f82b..0531f18116 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -405,6 +405,7 @@ enc_alias_table[] =
     {"unix-jis",	IDX_EUC_JP},
     {"ujis",		IDX_EUC_JP},
     {"shift-jis",	IDX_SJIS},
+    {"pck",		IDX_SJIS},	/* Sun: PCK */
     {"euckr",		IDX_EUC_KR},
     {"5601",		IDX_EUC_KR},	/* Sun: KS C 5601 */
     {"euccn",		IDX_EUC_CN},
diff --git a/src/version.c b/src/version.c
index 88a57b9d70..20cafae107 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    520,
 /**/
     519,
 /**/

From e08d20f904d5adcfeacb2c2a0a7bca6025a511ab Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 17:05:55 +0100
Subject: [PATCH 287/473] Added tag v7-4-520 for changeset 392dad030b8d

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7f119a7b28..28452998d1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3242,3 +3242,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 93560d4bca68e9086539c273c4e3f7e792fc1739 v7-4-517
 383cb9ddb56115f95933c5b994e0cec64ee578a5 v7-4-518
 27a36d1013a6dcf699ea9b2ade80d74329257dbd v7-4-519
+392dad030b8dd123f95a2e3624727607f542b4ed v7-4-520

From 4f49591954c4e865f2e7c3d3e3d2d0e67d0d4954 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 17:35:39 +0100
Subject: [PATCH 288/473] updated for version 7.4.521 Problem:    When using
 "vep" a mark is moved to the next line. (Maxi Padulo, 	    Issue 283)
 Solution:   Decrement the line number. (Christian Brabandt)

---
 src/ops.c     | 3 +++
 src/version.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/ops.c b/src/ops.c
index 86408a4944..edc84a07aa 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3831,6 +3831,9 @@ do_put(regname, dir, count, flags)
 		    lnum++;
 	    } while (VIsual_active && lnum <= curbuf->b_visual.vi_end.lnum);
 
+	    if (VIsual_active) /* reset lnum to the last visual line */
+		lnum--;
+
 	    curbuf->b_op_end = curwin->w_cursor;
 	    /* For "CTRL-O p" in Insert mode, put cursor after last char */
 	    if (totlen && (restart_edit != 0 || (flags & PUT_CURSEND)))
diff --git a/src/version.c b/src/version.c
index 20cafae107..758c686355 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    521,
 /**/
     520,
 /**/

From d8859b29aa4787f7396a54fc0ceec6b835961e35 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 17:35:39 +0100
Subject: [PATCH 289/473] Added tag v7-4-521 for changeset 39274bfbfba5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 28452998d1..0fad0c7ce5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3243,3 +3243,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 383cb9ddb56115f95933c5b994e0cec64ee578a5 v7-4-518
 27a36d1013a6dcf699ea9b2ade80d74329257dbd v7-4-519
 392dad030b8dd123f95a2e3624727607f542b4ed v7-4-520
+39274bfbfba5ead4d25f5abc41c0692b27e60473 v7-4-521

From 73903e7d73535771d9c577c9aa3e85921cbb7c18 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 18:03:28 +0100
Subject: [PATCH 290/473] updated for version 7.4.522 Problem:    Specifying
 wrong buffer size for GetLongPathName(). Solution:   Use the actual size.
 (Ken Takata)

---
 src/eval.c    | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index 1b1072cd80..c7cc0089d3 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -24762,7 +24762,7 @@ modify_fname(src, usedlen, fnamep, bufp, fnamelen)
 	    p = alloc(_MAX_PATH + 1);
 	    if (p != NULL)
 	    {
-		if (GetLongPathName(*fnamep, p, MAXPATHL))
+		if (GetLongPathName(*fnamep, p, _MAX_PATH))
 		{
 		    vim_free(*bufp);
 		    *bufp = *fnamep = p;
diff --git a/src/version.c b/src/version.c
index 758c686355..7a86692d7c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    522,
 /**/
     521,
 /**/

From a2d20929ae4be3565f9a6ee4ca220a901a55bdb0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 18:03:28 +0100
Subject: [PATCH 291/473] Added tag v7-4-522 for changeset 870480df8275

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0fad0c7ce5..1156ec86d6 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3244,3 +3244,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 27a36d1013a6dcf699ea9b2ade80d74329257dbd v7-4-519
 392dad030b8dd123f95a2e3624727607f542b4ed v7-4-520
 39274bfbfba5ead4d25f5abc41c0692b27e60473 v7-4-521
+870480df8275c1647530a23cbf778d888e1dc824 v7-4-522

From 7b45b06cb2e174c6451a9573960ba37e1281a9df Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 18:48:46 +0100
Subject: [PATCH 292/473] updated for version 7.4.523 Problem:    When the X11
 server is stopped and restarted, while Vim is kept in 	    the background,
 copy/paste no longer works. (Issue 203) Solution:   Setup the clipboard
 again. (Christian Brabandt)

---
 src/os_unix.c | 21 +++++++++++++++++++++
 src/version.c |  2 ++
 2 files changed, 23 insertions(+)

diff --git a/src/os_unix.c b/src/os_unix.c
index 8cd6b14eb7..0813cae73c 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1586,12 +1586,15 @@ x_IOerror_check(dpy)
  * An X IO Error handler, used to catch terminal errors.
  */
 static int x_IOerror_handler __ARGS((Display *dpy));
+static void may_restore_clipboard __ARGS((void));
+static int xterm_dpy_was_reset = FALSE;
 
     static int
 x_IOerror_handler(dpy)
     Display *dpy UNUSED;
 {
     xterm_dpy = NULL;
+    xterm_dpy_was_reset = TRUE;
     x11_window = 0;
     x11_display = NULL;
     xterm_Shell = (Widget)0;
@@ -1602,6 +1605,22 @@ x_IOerror_handler(dpy)
     return 0;  /* avoid the compiler complains about missing return value */
 # endif
 }
+
+/*
+ * If the X11 connection was lost try to restore it.
+ * Helps when the X11 server was stopped and restarted while Vim was inactive
+ * (e.g. though tmux).
+ */
+    static void
+may_restore_clipboard()
+{
+    if (xterm_dpy_was_reset)
+    {
+	xterm_dpy_was_reset = FALSE;
+	setup_term_clip();
+	get_x11_title(FALSE);
+    }
+}
 #endif
 
 /*
@@ -5274,6 +5293,7 @@ RealWaitForChar(fd, msec, check_for_gpm)
 	}
 # endif
 # ifdef FEAT_XCLIPBOARD
+	may_restore_clipboard();
 	if (xterm_Shell != (Widget)0)
 	{
 	    xterm_idx = nfd;
@@ -5426,6 +5446,7 @@ RealWaitForChar(fd, msec, check_for_gpm)
 	}
 # endif
 # ifdef FEAT_XCLIPBOARD
+	may_restore_clipboard();
 	if (xterm_Shell != (Widget)0)
 	{
 	    FD_SET(ConnectionNumber(xterm_dpy), &rfds);
diff --git a/src/version.c b/src/version.c
index 7a86692d7c..cc3bb24356 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    523,
 /**/
     522,
 /**/

From 2569cce3350c00ce6dae35cfe1fea2b475af60df Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 18:48:46 +0100
Subject: [PATCH 293/473] Added tag v7-4-523 for changeset 9c9c70625444

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1156ec86d6..67d70e1b59 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3245,3 +3245,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 392dad030b8dd123f95a2e3624727607f542b4ed v7-4-520
 39274bfbfba5ead4d25f5abc41c0692b27e60473 v7-4-521
 870480df8275c1647530a23cbf778d888e1dc824 v7-4-522
+9c9c70625444b29324a1e446eb23bb0c73547cab v7-4-523

From a0cfe225debeb5fc9cff4f1dda77dbb72b0a83aa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 18:54:17 +0100
Subject: [PATCH 294/473] Update runtime files.

---
 runtime/doc/editing.txt  | 11 +++++++----
 runtime/doc/eval.txt     |  9 +++++----
 runtime/doc/quickref.txt |  3 ++-
 runtime/doc/todo.txt     | 42 +++++++++++++++++++++-------------------
 runtime/optwin.vim       |  8 +++++---
 runtime/syntax/c.vim     |  8 +++-----
 6 files changed, 44 insertions(+), 37 deletions(-)

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index b02f8faec2..a71cbc0047 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Nov 12
+*editing.txt*   For Vim version 7.4.  Last change: 2014 Nov 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1080,9 +1080,12 @@ The names can be in upper- or lowercase.
 			the last file in the argument list has not been
 			edited.  See |:confirm| and 'confirm'.  {not in Vi}
 
-:q[uit]!		Quit without writing, also when visible buffers have
-			changes.  Does not exit when there are changed hidden
-			buffers.  Use ":qall!" to exit always.
+:q[uit]!		Quit without writing, also when currently visible
+			buffers have changes.  Does not exit when this is the
+			last window and there are is a changed hidden buffer.
+			In this case, the first changed hidden buffer becomes
+			the current buffer.
+			Use ":qall!" to exit always.
 
 :cq[uit]		Quit always, without writing, and return an error
 			code.  See |:cq|.  Used for Manx's QuickFix mode (see
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index f21e051b6e..829d4eea8d 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 05
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 15
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1755,8 +1755,8 @@ count( {list}, {expr} [, {ic} [, {start}]])
 				Number	 count how many {expr} are in {list}
 cscope_connection( [{num} , {dbpath} [, {prepend}]])
 				Number	checks existence of cscope connection
-cursor( {lnum}, {col} [, {coladd}])
-				Number	move cursor to {lnum}, {col}, {coladd}
+cursor( {lnum}, {col} [, {off}])
+				Number	move cursor to {lnum}, {col}, {off}
 cursor( {list})			Number	move cursor to position in {list}
 deepcopy( {expr} [, {noref}])	any	make a full copy of {expr}
 delete( {fname})		Number	delete file {fname}
@@ -2623,6 +2623,7 @@ cursor({list})
 		If {col} is zero, the cursor will stay in the current column.
 		If {curswant} is given it is used to set the preferred column
 		for vertical movement.  Otherwise {col} is used.
+
 		When 'virtualedit' is used {off} specifies the offset in
 		screen columns from the start of the character.  E.g., a
 		position within a <Tab> or after the last character.
@@ -4851,7 +4852,7 @@ readfile({fname} [, {binary} [, {max}]])
 		separated with CR will result in a single long line (unless a
 		NL appears somewhere).
 		All NUL characters are replaced with a NL character.
-		When {binary/append} is contains "b" binary mode is used:
+		When {binary/append} contains "b" binary mode is used:
 		- When the last line ends in a NL an extra empty list item is
 		  added.
 		- No CR characters are removed.
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 727f6ac4b0..695d7ceb4f 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt*  For Vim version 7.4.  Last change: 2014 Oct 22
+*quickref.txt*  For Vim version 7.4.  Last change: 2014 Nov 19
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -764,6 +764,7 @@ Short explanation of each option:		*option-list*
 'keywordprg'	  'kp'	    program to use for the "K" command
 'langmap'	  'lmap'    alphabetic characters for other language mode
 'langmenu'	  'lm'	    language to be used for the menus
+'langnoremap'	  'lnr'	    do not apply 'langmap' to mapped characters
 'laststatus'	  'ls'	    tells when last window has status lines
 'lazyredraw'	  'lz'	    don't redraw while executing macros
 'linebreak'	  'lbr'     wrap long lines at a blank
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index aa44d481d9..2957b29491 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 13
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -34,8 +34,6 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Add langnoremap in quickref.txt and  optwin.vim.
-
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
@@ -77,8 +75,6 @@ Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
 Doesn't look right, asked for updates.
 Update 2014 Nov 8. Replied with suggestions.
 
-C macro with number highlighted wrong. (Dominique Pelle, 2014 Oct 23)
-
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
@@ -88,14 +84,19 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-Patch to fix issue 203. (Christian Brabandt, 2014 Oct 8)
-
 Patch to fix issue 78. (Christian Brabandt, 2014 Oct 8)
 
 Patch to fix leak in map() with error. (Christian Brabandt, 2014 Oct 11)
 
 Patch to fix incsearch for "2/pattern/e".
 
+Patch to fix memory leak in :hardcopy. (Christian Brabandt, 2014 Nov 16)
+
+Patch to fix warnings in if_ruby.c. (Ken Takata, 2014 Nov 17)
+
+Patch to make test 63 pass when in a B&W terminal. (Christian Brabandt, 2014
+Nov 15)  Other patch (better) on Nov 17.
+
 Change behavior of v:hlsearch?  Patch from Christian, 2014 Oct 22.
 
 MS-Windows: When editing a file with a leading space, writing it uses the
@@ -106,14 +107,16 @@ patch to remove FEAT_OSFILETYPE from fileio.c. (Christian, 2014 Nov 12)
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
-Fix for wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014 Nov
-12)
+Patch to fix relatie numbers. (Christian Brabandt, 2014 Nov 17)
+
+Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
+Nov 12)
 
 Patch to support hex values for setting option value.
 (Zyx, 2015 Nov 6)
 
-On MS-Windows running tests with Mercurial has problems when the input files
-are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
+On MS-Windows running tests with Mercurial has problems when the fileformat of
+the input files are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
 Update Nov 5.
 
 MS-Windows: Crash opening very long file name starting with "\\".
@@ -140,6 +143,10 @@ lines. (Marco Hinz, 2014 Nov 2)
 
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
+Plugins need to make a lot of effort, lots of mappings, to know what happened
+before pressing the key that triggers a plugin action.  How about keeping the
+last N pressed keys, so that they do not need to be mapped?
+
 Can assign to s:type when a function s:type has been defined.
 Also the other way around: define a function while a variable with that name
 was already defined.
@@ -152,6 +159,10 @@ Patch for building a 32bit Vim with 64bit MingW compiler.
 
 Delete old code in os_msdos.c, mch_FullName().
 
+Redo only remembers the last change.  Could use "{count}g." to redo an older
+change.  How does the user know which change?  At least have a way to list
+them: ":repeats".
+
 Using "." to repeat an Ex command puts that command in history.  Probably
 should not happen.  If the command is the result of a mapping it's not put in
 history either. (Jacob Niehus, 2014 Nov 2)
@@ -289,12 +300,8 @@ Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
 
 Patch to get MSVC version in a nicer way. (Ken Takata, 2014 Jul 24)
 
-Patch to make test 100 work on MS-Windows. (Taro Muraoka, 2013 Dec 12)
-
 Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
 
-Perl: support for Activestate perl 5.18: Issue 170.
-
 Several syntax file match "^\s*" which may get underlined if that's in the
 highlight group.  Add a "\zs" after it?
 
@@ -439,9 +446,6 @@ Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
 
 Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
 
-MS-Windows: Patch to make tests copy files to avoid changing the fileformat of
-the files under version control. (Taro Muraoka, 2013 Jul 5)
-
 Issue 54: document behavior of -complete, also expands arg.
 
 -   Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'.  Combine
@@ -1560,8 +1564,6 @@ Changes for Win32 makefile. (Mike Williams, 2007 Jan 22, Alexei Alexandrov,
 Win32: Can't complete shell command names.  Why is setting xp_context in
 set_one_cmd_context() inside #ifndef BACKSLASH_IN_FILENAME?
 
-Win32: Patch for convert_filterW(). (Taro Muraoka, 2007 Mar 2)
-
 Win32: Patch for cscope external command. (Mike Williams, 2007 Aug 7)
 
 Win32: XPM support only works with path without spaces.  Patch by Mathias
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 35f99c537c..55353ce669 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
 " These commands create the option window.
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Oct 09
+" Last Change:	2014 Nov 19
 
 " If there already is an option window, jump to that one.
 if bufwinnr("option-window") > 0
@@ -149,7 +149,7 @@ setlocal ts=15 tw=0 noro buftype=nofile
 call append(0, '" Each "set" line shows the current value of an option (on the left).')
 call append(1, '" Hit <CR> on a "set" line to execute it.')
 call append(2, '"            A boolean option will be toggled.')
-call append(3, '"            For other options you can edit the value.')
+call append(3, '"            For other options you can edit the value before hitting <CR>.')
 call append(4, '" Hit <CR> on a help line to open a help window on this option.')
 call append(5, '" Hit <CR> on an index line to jump there.')
 call append(6, '" Hit <Space> on a "set" line to refresh it.')
@@ -1194,8 +1194,10 @@ if has("keymap")
   call <SID>OptionL("kmp")
 endif
 if has("langmap")
-  call append("$", "langmap\ttranslate characters for Normal mode")
+  call append("$", "langmap\tlist of characters that are translated in Normal mode")
   call <SID>OptionG("lmap", &lmap)
+  call append("$", "langnoremap\tdon't apply 'langmap' to mapped characters")
+  call <SID>BinOptionG("lnr", &lnr)
 endif
 if has("xim")
   call append("$", "imdisable\twhen set never use IM; overrules following IM options")
diff --git a/runtime/syntax/c.vim b/runtime/syntax/c.vim
index 2e54b8c42a..128e1a2a4a 100644
--- a/runtime/syntax/c.vim
+++ b/runtime/syntax/c.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:	C
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Sep 23
+" Last Change:	2014 Nov 13
 
 " Quit when a (custom) syntax file was already loaded
 if exists("b:current_syntax")
@@ -61,10 +61,9 @@ else
   syn region	cCppString	start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat,@Spell
 endif
 
-syn region	cCppOut2	contained start="0" end="^\s*\(%:\|#\)\s*\(endif\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
 syn region	cCppSkip	contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppSkip
 
-syn cluster	cStringGroup	contains=cCppString,cCppOut2,cCppSkip
+syn cluster	cStringGroup	contains=cCppString,cCppSkip
 
 syn match	cCharacter	"L\='[^\\]'"
 syn match	cCharacter	"L'[^']*'" contains=cSpecial
@@ -462,8 +461,7 @@ hi def link cTodo		Todo
 hi def link cBadContinuation	Error
 hi def link cCppOutSkip		cCppOutIf2
 hi def link cCppInElse2		cCppOutIf2
-hi def link cCppOutIf2		cCppOut2  " Old syntax group for #if 0 body
-hi def link cCppOut2		cCppOut  " Old syntax group for #if of #if 0
+hi def link cCppOutIf2		cCppOut
 hi def link cCppOut		Comment
 
 let b:current_syntax = "c"

From 35a7a25e068be23409203e175426a7f87fbe40d6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 19:33:16 +0100
Subject: [PATCH 295/473] updated for version 7.4.524 Problem:    When using
 ":ownsyntax" spell checking is messed up. (Issue 78) Solution:   Use the
 window-local option values. (Christian Brabandt)

---
 src/option.c  | 9 +++++----
 src/syntax.c  | 3 +--
 src/version.c | 2 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/option.c b/src/option.c
index 6841d42d6c..a97dae6262 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6706,15 +6706,16 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
 #ifdef FEAT_SPELL
     /* When 'spelllang' or 'spellfile' is set and there is a window for this
      * buffer in which 'spell' is set load the wordlists. */
-    else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf))
+    else if (varp == &(curwin->w_s->b_p_spl)
+	    || varp == &(curwin->w_s->b_p_spf))
     {
 	win_T	    *wp;
 	int	    l;
 
-	if (varp == &(curbuf->b_s.b_p_spf))
+	if (varp == &(curwin->w_s->b_p_spf))
 	{
-	    l = (int)STRLEN(curbuf->b_s.b_p_spf);
-	    if (l > 0 && (l < 4 || STRCMP(curbuf->b_s.b_p_spf + l - 4,
+	    l = (int)STRLEN(curwin->w_s->b_p_spf);
+	    if (l > 0 && (l < 4 || STRCMP(curwin->w_s->b_p_spf + l - 4,
 								".add") != 0))
 		errmsg = e_invarg;
 	}
diff --git a/src/syntax.c b/src/syntax.c
index fcd20c8ace..4f6ef924b4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -6304,11 +6304,10 @@ ex_ownsyntax(eap)
 	curwin->w_s = (synblock_T *)alloc(sizeof(synblock_T));
 	memset(curwin->w_s, 0, sizeof(synblock_T));
 #ifdef FEAT_SPELL
+	/* TODO: keep the spell checking as it was. */
 	curwin->w_p_spell = FALSE;	/* No spell checking */
 	clear_string_option(&curwin->w_s->b_p_spc);
 	clear_string_option(&curwin->w_s->b_p_spf);
-	vim_regfree(curwin->w_s->b_cap_prog);
-	curwin->w_s->b_cap_prog = NULL;
 	clear_string_option(&curwin->w_s->b_p_spl);
 #endif
     }
diff --git a/src/version.c b/src/version.c
index cc3bb24356..890a49bf0b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    524,
 /**/
     523,
 /**/

From faa1cf86663f913034d9b376f2220ec006d73a60 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 19:33:17 +0100
Subject: [PATCH 296/473] Added tag v7-4-524 for changeset 762ab69c2d13

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 67d70e1b59..d67c2b1d32 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3246,3 +3246,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 39274bfbfba5ead4d25f5abc41c0692b27e60473 v7-4-521
 870480df8275c1647530a23cbf778d888e1dc824 v7-4-522
 9c9c70625444b29324a1e446eb23bb0c73547cab v7-4-523
+762ab69c2d138af49de407022cb7e363024f6a16 v7-4-524

From 7ec754b555ace262991280027e8893bceb87a9c0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 20:04:48 +0100
Subject: [PATCH 297/473] updated for version 7.4.525 Problem:    map() leaks
 memory when there is an error in the expression. Solution:   Call clear_tv().
 (Christian Brabandt)

---
 src/eval.c    | 9 ++++++---
 src/version.c | 2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index c7cc0089d3..840e1e8f82 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -10720,18 +10720,20 @@ filter_map(argvars, rettv, map)
 	    {
 		if (!HASHITEM_EMPTY(hi))
 		{
+		    int r;
+
 		    --todo;
 		    di = HI2DI(hi);
 		    if (tv_check_lock(di->di_tv.v_lock,
 						     (char_u *)_(arg_errmsg)))
 			break;
 		    vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
-		    if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
-								  || did_emsg)
+		    r = filter_map_one(&di->di_tv, expr, map, &rem);
+		    clear_tv(&vimvars[VV_KEY].vv_tv);
+		    if (r == FAIL || did_emsg)
 			break;
 		    if (!map && rem)
 			dictitem_remove(d, di);
-		    clear_tv(&vimvars[VV_KEY].vv_tv);
 		}
 	    }
 	    hash_unlock(ht);
@@ -10782,6 +10784,7 @@ filter_map_one(tv, expr, map, remp)
     if (*s != NUL)  /* check for trailing chars after expr */
     {
 	EMSG2(_(e_invexpr2), s);
+	clear_tv(&rettv);
 	goto theend;
     }
     if (map)
diff --git a/src/version.c b/src/version.c
index 890a49bf0b..f65867c43f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    525,
 /**/
     524,
 /**/

From cd3dc233dfe1fee5a3ede119b07cfe4033f63784 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 19 Nov 2014 20:04:48 +0100
Subject: [PATCH 298/473] Added tag v7-4-525 for changeset 2587209317b7

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d67c2b1d32..5e6defa2e0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3247,3 +3247,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 870480df8275c1647530a23cbf778d888e1dc824 v7-4-522
 9c9c70625444b29324a1e446eb23bb0c73547cab v7-4-523
 762ab69c2d138af49de407022cb7e363024f6a16 v7-4-524
+2587209317b75d073c352c61f1e6cd9f8c26d7f5 v7-4-525

From 34527861c74129ad9009ba1e3abb9a2732ae9289 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 20 Nov 2014 23:07:05 +0100
Subject: [PATCH 299/473] updated for version 7.4.526 Problem:    matchstr()
 fails on long text. Daniel Hahler) Solution:   Return NFA_TOO_EXPENSIVE from
 regexec_nl(). (Christian Brabandt)

---
 src/regexp.c  | 25 +++++++++++++------------
 src/version.c |  2 ++
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/regexp.c b/src/regexp.c
index fe28dc6845..d36ac49bb6 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -3739,7 +3739,7 @@ static int  bt_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col, in
  * Uses curbuf for line count and 'iskeyword'.
  * if "line_lbr" is TRUE  consider a "\n" in "line" to be a line break.
  *
- * Return TRUE if there is a match, FALSE if not.
+ * Returns 0 for failure, number of lines contained in the match otherwise.
  */
     static int
 bt_regexec_nl(rmp, line, col, line_lbr)
@@ -3759,7 +3759,8 @@ bt_regexec_nl(rmp, line, col, line_lbr)
     ireg_icombine = FALSE;
 #endif
     ireg_maxcol = 0;
-    return (bt_regexec_both(line, col, NULL) != 0);
+
+    return bt_regexec_both(line, col, NULL);
 }
 
 static long bt_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm));
@@ -3781,8 +3782,6 @@ bt_regexec_multi(rmp, win, buf, lnum, col, tm)
     colnr_T	col;		/* column to start looking for match */
     proftime_T	*tm;		/* timeout limit or NULL */
 {
-    long	r;
-
     reg_match = NULL;
     reg_mmatch = rmp;
     reg_buf = buf;
@@ -3796,14 +3795,13 @@ bt_regexec_multi(rmp, win, buf, lnum, col, tm)
 #endif
     ireg_maxcol = rmp->rmm_maxcol;
 
-    r = bt_regexec_both(NULL, col, tm);
-
-    return r;
+    return bt_regexec_both(NULL, col, tm);
 }
 
 /*
  * Match a regexp against a string ("line" points to the string) or multiple
  * lines ("line" is NULL, use reg_getline()).
+ * Returns 0 for failure, number of lines contained in the match otherwise.
  */
     static long
 bt_regexec_both(line, col, tm)
@@ -3811,9 +3809,9 @@ bt_regexec_both(line, col, tm)
     colnr_T	col;		/* column to start looking for match */
     proftime_T	*tm UNUSED;	/* timeout limit or NULL */
 {
-    bt_regprog_T	*prog;
-    char_u	*s;
-    long	retval = 0L;
+    bt_regprog_T    *prog;
+    char_u	    *s;
+    long	    retval = 0L;
 
     /* Create "regstack" and "backpos" if they are not allocated yet.
      * We allocate *_INITIAL amount of bytes first and then set the grow size
@@ -8201,11 +8199,12 @@ vim_regexec_both(rmp, line, col, nl)
 
 	p_re = save_p_re;
     }
-    return result;
+    return result > 0;
 }
 
 /*
  * Note: "*prog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
  */
     int
 vim_regexec_prog(prog, ignore_case, line, col)
@@ -8226,6 +8225,7 @@ vim_regexec_prog(prog, ignore_case, line, col)
 
 /*
  * Note: "rmp->regprog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
  */
     int
 vim_regexec(rmp, line, col)
@@ -8241,6 +8241,7 @@ vim_regexec(rmp, line, col)
 /*
  * Like vim_regexec(), but consider a "\n" in "line" to be a line break.
  * Note: "rmp->regprog" may be freed and changed.
+ * Return TRUE if there is a match, FALSE if not.
  */
     int
 vim_regexec_nl(rmp, line, col)
@@ -8297,5 +8298,5 @@ vim_regexec_multi(rmp, win, buf, lnum, col, tm)
 	p_re = save_p_re;
     }
 
-    return result;
+    return result <= 0 ? 0 : result;
 }
diff --git a/src/version.c b/src/version.c
index f65867c43f..80e2d35ac8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    526,
 /**/
     525,
 /**/

From 3c05b5f2f83fb9fccedf1775241f9ead7d78d9aa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 20 Nov 2014 23:07:05 +0100
Subject: [PATCH 300/473] Added tag v7-4-526 for changeset 230b52b9d35e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5e6defa2e0..edbc6518d5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3248,3 +3248,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 9c9c70625444b29324a1e446eb23bb0c73547cab v7-4-523
 762ab69c2d138af49de407022cb7e363024f6a16 v7-4-524
 2587209317b75d073c352c61f1e6cd9f8c26d7f5 v7-4-525
+230b52b9d35ec12f6a83368b3479dfb85158bcf9 v7-4-526

From 82d2f723c8b7e99d6e4a5630f92a298660d32ac5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 23 Nov 2014 15:57:49 +0100
Subject: [PATCH 301/473] updated for version 7.4.527 Problem:    Still
 confusing regexp failure and NFA_TOO_EXPENSIVE. Solution:   NFA changes
 equivalent of 7.4.526.

---
 src/regexp_nfa.c | 10 +++++-----
 src/version.c    |  2 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 91316094b5..8e069f3519 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -6767,7 +6767,7 @@ nfa_regmatch(prog, start, submatch, m)
 
 /*
  * Try match of "prog" with at regline["col"].
- * Returns 0 for failure, number of lines contained in the match otherwise.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
  */
     static long
 nfa_regtry(prog, col)
@@ -6897,7 +6897,7 @@ nfa_regtry(prog, col)
  * Match a regexp against a string ("line" points to the string) or multiple
  * lines ("line" is NULL, use reg_getline()).
  *
- * Returns 0 for failure, number of lines contained in the match otherwise.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
  */
     static long
 nfa_regexec_both(line, startcol)
@@ -7137,7 +7137,7 @@ nfa_regfree(prog)
  * Uses curbuf for line count and 'iskeyword'.
  * If "line_lbr" is TRUE consider a "\n" in "line" to be a line break.
  *
- * Return TRUE if there is a match, FALSE if not.
+ * Returns <= 0 for failure, number of lines contained in the match otherwise.
  */
     static int
 nfa_regexec_nl(rmp, line, col, line_lbr)
@@ -7157,7 +7157,7 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
     ireg_icombine = FALSE;
 #endif
     ireg_maxcol = 0;
-    return (nfa_regexec_both(line, col) != 0);
+    return nfa_regexec_both(line, col);
 }
 
 
@@ -7166,7 +7166,7 @@ nfa_regexec_nl(rmp, line, col, line_lbr)
  * "rmp->regprog" is a compiled regexp as returned by vim_regcomp().
  * Uses curbuf for line count and 'iskeyword'.
  *
- * Return zero if there is no match.  Return number of lines contained in the
+ * Return <= 0 if there is no match.  Return number of lines contained in the
  * match otherwise.
  *
  * Note: the body is the same as bt_regexec() except for nfa_regexec_both()
diff --git a/src/version.c b/src/version.c
index 80e2d35ac8..a3adca86a4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    527,
 /**/
     526,
 /**/

From 096829f65dcf635d23556af1d97bf79454ed10df Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 23 Nov 2014 15:57:49 +0100
Subject: [PATCH 302/473] Added tag v7-4-527 for changeset 2bb019eb60ca

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index edbc6518d5..00a010d754 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3249,3 +3249,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 762ab69c2d138af49de407022cb7e363024f6a16 v7-4-524
 2587209317b75d073c352c61f1e6cd9f8c26d7f5 v7-4-525
 230b52b9d35ec12f6a83368b3479dfb85158bcf9 v7-4-526
+2bb019eb60ca1d16e62e95bef16475756965022f v7-4-527

From ab352c71b50450798f508a4e814be63006f4fec5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 13:37:10 +0100
Subject: [PATCH 303/473] updated for version 7.4.528 Problem:    Crash when
 using matchadd() (Yasuhiro Matsumoto) Solution:   Copy the match regprog.

---
 src/screen.c  | 10 ++++++++++
 src/version.c |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/src/screen.c b/src/screen.c
index e11bdc3775..d395138628 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -7588,6 +7588,12 @@ next_search_hl(win, shl, lnum, mincol, cur)
 	shl->lnum = lnum;
 	if (shl->rm.regprog != NULL)
 	{
+	    /* Remember whether shl->rm is using a copy of the regprog in
+	     * cur->match. */
+	    int regprog_is_copy = (shl != &search_hl && cur != NULL
+				&& shl == &cur->hl
+				&& cur->match.regprog == cur->hl.rm.regprog);
+
 	    nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum,
 		    matchcol,
 #ifdef FEAT_RELTIME
@@ -7596,6 +7602,10 @@ next_search_hl(win, shl, lnum, mincol, cur)
 		    NULL
 #endif
 		    );
+	    /* Copy the regprog, in case it got freed and recompiled. */
+	    if (regprog_is_copy)
+		cur->match.regprog = cur->hl.rm.regprog;
+
 	    if (called_emsg || got_int)
 	    {
 		/* Error while handling regexp: stop using this regexp. */
diff --git a/src/version.c b/src/version.c
index a3adca86a4..c674ce1917 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    528,
 /**/
     527,
 /**/

From 8deac8e7214a78aa1bd4065c25d008b7156e7bbe Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 13:37:10 +0100
Subject: [PATCH 304/473] Added tag v7-4-528 for changeset 5f49ac8426df

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 00a010d754..665956bd16 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3250,3 +3250,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 2587209317b75d073c352c61f1e6cd9f8c26d7f5 v7-4-525
 230b52b9d35ec12f6a83368b3479dfb85158bcf9 v7-4-526
 2bb019eb60ca1d16e62e95bef16475756965022f v7-4-527
+5f49ac8426dfddcc6725fae872b642976e468c8a v7-4-528

From 468f11b0efa9b606da43333cdfdf47c4d82776fb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 14:09:13 +0100
Subject: [PATCH 305/473] updated for version 7.4.529 Problem:    No test for
 what 7.4.517 fixes. Solution:   Adjust the tests for breakindent. (Christian
 Brabandt)

---
 src/testdir/test_breakindent.in | 38 ++++++++++++++++++++-------------
 src/testdir/test_breakindent.ok |  8 ++++++-
 src/version.c                   |  2 ++
 3 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index 150c9430db..a255457b2e 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -6,18 +6,18 @@ STARTTEST
 :10new|:vsp|:vert resize 20
 :put =\"\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\"
 :set ts=4 sw=4 sts=4 breakindent
-:fu! ScreenChar(width)
+:fu! ScreenChar(line, width)
 :	let c=''
 :	for i in range(1,a:width)
-:		let c.=nr2char(screenchar(line('.'), i))
+:		let c.=nr2char(screenchar(a:line, i))
 :	endfor
 :       let c.="\n"
 :	for i in range(1,a:width)
-:		let c.=nr2char(screenchar(line('.')+1, i))
+:		let c.=nr2char(screenchar(a:line+1, i))
 :	endfor
 :       let c.="\n"
 :	for i in range(1,a:width)
-:		let c.=nr2char(screenchar(line('.')+2, i))
+:		let c.=nr2char(screenchar(a:line+2, i))
 :	endfor
 :	return c
 :endfu
@@ -29,43 +29,43 @@ STARTTEST
 :endfu
 :set briopt=min:0
 :let g:test="Test 1: Simple breakindent"
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test="Test 2: Simple breakindent + sbr=>>"
 :set sbr=>>
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test ="Test 3: Simple breakindent + briopt:sbr"
 :set briopt=sbr,min:0 sbr=++
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test ="Test 4: Simple breakindent + min width: 18"
 :set sbr= briopt=min:18
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test =" Test 5: Simple breakindent + shift by 2"
 :set briopt=shift:2,min:0
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test=" Test 6: Simple breakindent + shift by -1"
 :set briopt=shift:-1,min:0
-:let line1=ScreenChar(8)
+:let line1=ScreenChar(line('.'),8)
 :call DoRecordScreen()
 :let g:test=" Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr"
 :set briopt=shift:1,sbr,min:0 nu sbr=? nuw=4
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
 :call DoRecordScreen()
 :let g:test=" Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr"
 :set briopt=shift:1,sbr,min:0 nu sbr=# list
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
 :call DoRecordScreen()
 :let g:test=" Test 9: breakindent + shift by +1 + 'nu' + sbr=# list"
 :set briopt-=sbr
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
 :call DoRecordScreen()
 :let g:test=" Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n"
 :set cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0
-:let line1=ScreenChar(10)
+:let line1=ScreenChar(line('.'),10)
 :call DoRecordScreen()
 :wincmd p
 :let g:test="\n Test 11: strdisplaywidth when breakindent is on"
@@ -74,6 +74,14 @@ STARTTEST
 :let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3 " text wraps 3 times
 :$put =g:test
 :$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width)
+:let g:str="\t\t\t\t\t{"
+:let g:test=" Test 12: breakindent + long indent"
+:wincmd p
+:set all& breakindent linebreak briopt=min:10 nu numberwidth=3 ts=4
+:$put =g:str
+zt:let line1=ScreenChar(1,10)
+:wincmd p
+:call DoRecordScreen()
 :"
 :" Test, that the string "    a\tb\tc\td\te" is correctly
 :" displayed in a 20 column wide window (see bug report
@@ -87,7 +95,7 @@ fbgjyl:let line1 = @0
 :?^\s*z
 fygjyl:let line2 = @0
 :quit!
-:$put ='Test 12: breakindent with wrapping Tab'
+:$put ='Test 13: breakindent with wrapping Tab'
 :$put =line1
 :$put =line2
 :"
diff --git a/src/testdir/test_breakindent.ok b/src/testdir/test_breakindent.ok
index d89d424fb3..e50265ecdd 100644
--- a/src/testdir/test_breakindent.ok
+++ b/src/testdir/test_breakindent.ok
@@ -53,6 +53,12 @@ Test 4: Simple breakindent + min width: 18
 
  Test 11: strdisplaywidth when breakindent is on
 strdisplaywidth: 46 == calculated: 64
-Test 12: breakindent with wrapping Tab
+					{
+
+ Test 12: breakindent + long indent
+56        
+          
+~         
+Test 13: breakindent with wrapping Tab
 d
 w
diff --git a/src/version.c b/src/version.c
index c674ce1917..2496defc2a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    529,
 /**/
     528,
 /**/

From dece1ae29047df75b9f87273b8640ccbe0c15c9f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 14:09:13 +0100
Subject: [PATCH 306/473] Added tag v7-4-529 for changeset 72d5a533ec87

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 665956bd16..f1c54debb9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3251,3 +3251,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 230b52b9d35ec12f6a83368b3479dfb85158bcf9 v7-4-526
 2bb019eb60ca1d16e62e95bef16475756965022f v7-4-527
 5f49ac8426dfddcc6725fae872b642976e468c8a v7-4-528
+72d5a533ec87c13e87e80273a1817b5ba19d313b v7-4-529

From dc9ecaa8fb3391d0c9f28ea2814be166295587d0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 16:22:48 +0100
Subject: [PATCH 307/473] updated for version 7.4.530 Problem:    Many commands
 take a count or range that is not using line 	    numbers. Solution:   For
 each command specify what kind of count it uses.  For windows, 	   
 buffers and arguments have "$" and "." have a relevant meaning. 	   
 (Marcin Szamotulski)

---
 runtime/doc/tabpage.txt    |   49 +-
 runtime/doc/windows.txt    |   87 +-
 src/Makefile               |    5 +-
 src/ex_cmds.h              | 1583 ++++++++++++++++++++++++------------
 src/ex_docmd.c             |  604 ++++++++++----
 src/testdir/Make_amiga.mak |    4 +
 src/testdir/Make_dos.mak   |    2 +
 src/testdir/Make_ming.mak  |    2 +
 src/testdir/Make_os2.mak   |    2 +
 src/testdir/Make_vms.mms   |   10 +-
 src/testdir/Makefile       |    2 +
 src/version.c              |    2 +
 src/window.c               |   18 +-
 13 files changed, 1665 insertions(+), 705 deletions(-)

diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 3c7ad9fe28..b795dbe552 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -61,16 +61,25 @@ In the GUI tab pages line you can use the right mouse button to open menu.
 :[count]tabe[dit]				*:tabe* *:tabedit* *:tabnew*
 :[count]tabnew
 		Open a new tab page with an empty window, after the current
-		tab page.  For [count] see |:tab| below.
+		tab page.  If [count] is given the new tab page appears after
+		the tab page [count] otherwise the new tab page will appear
+		after the current one. >
+		    :tabnew	" opens tabpage after the current one
+		    :.tabnew	" as above
+		    :+tabnew	" opens tabpage after the next tab page
+				" note: it is one further than :tabnew
+		    :-tabnew	" opens tabpage before the current one
+		    :0tabnew	" opens tabpage before the first one
+		    :$tabnew	" opens tabpage after the last one
 
 :[count]tabe[dit] [++opt] [+cmd] {file}
 :[count]tabnew [++opt] [+cmd] {file}
 		Open a new tab page and edit {file}, like with |:edit|.
-		For [count] see |:tab| below.
+		For [count] see |:tabnew| above.
 
 :[count]tabf[ind] [++opt] [+cmd] {file}			*:tabf* *:tabfind*
 		Open a new tab page and edit {file} in 'path', like with
-		|:find|.  For [count] see |:tab| below.
+		|:find|.  For [count] see |:tabnew| above.
 		{not available when the |+file_in_path| feature was disabled
 		at compile time}
 
@@ -110,12 +119,18 @@ something else.
 		- When 'hidden' is not set, [!] is not used, a buffer has
 		  changes, and there is no other window on this buffer.
 		Changes to the buffer are not written and won't get lost, so
-		this is a "safe" command.
+		this is a "safe" command. >
+		    :tabclose	    " close the current tab page
 
+:{count}tabc[lose][!]
 :tabc[lose][!] {count}
 		Close tab page {count}.  Fails in the same way as `:tabclose`
-		above.
-
+		above. >
+		    :-tabclose	    " close the previous tab page
+		    :+tabclose	    " close the next tab page
+		    :1tabclose	    " close the first tab page
+		    :$tabclose	    " close the last tab page
+<
 							*:tabo* *:tabonly*
 :tabo[nly][!]	Close all other tab pages.
 		When the 'hidden' option is set, all buffers in closed windows
@@ -124,7 +139,17 @@ something else.
 		modified buffers are written.  Otherwise, windows that have
 		buffers that are modified are not removed, unless the [!] is
 		given, then they become hidden.  But modified buffers are
-		never abandoned, so changes cannot get lost.
+		never abandoned, so changes cannot get lost. >
+		    :tabonly	    " close all tab pages except the current
+
+:{count}tabo[nly][!]
+		Close all tab pages except the {count}th one. >
+		    :.tabonly	    " one
+		    :-tabonly	    " close all tab pages except the previous
+				    " one
+		    :+tabonly	    " close all tab pages except the next one
+		    :1tabonly	    " close all tab pages except the first one
+		    :$tabonly	    " close all tab pages except the last one
 
 
 SWITCHING TO ANOTHER TAB PAGE:
@@ -176,7 +201,15 @@ REORDERING TAB PAGES:
 :[N]tabm[ove]
 		Move the current tab page to after tab page N.  Use zero to
 		make the current tab page the first one.  Without N the tab
-		page is made the last one.
+		page is made the last one. >
+		    :-tabmove	" move the tab page to the left
+		    :tabmove	" move the tab page to the right
+		    :.tabmove	" as above
+		    :+tabmove	" as above
+		    :0tabmove	" move the tab page to the begining of the tab
+				" list
+		    :$tabmove	" move the tab page to the end of the tab list
+<
 
 :tabm[ove] +[N]
 :tabm[ove] -[N]
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 0098e3e521..d116c9f6c5 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -263,28 +263,56 @@ left of the Vim window.
 Closing a window
 ----------------
 
+:q[uit]
+:{count}q[uit]
 CTRL-W q						*CTRL-W_q*
 CTRL-W CTRL-Q						*CTRL-W_CTRL-Q*
-:q[uit]		Quit current window.  When quitting the last window (not
-		counting a help window), exit Vim.
-		When 'hidden' is set, and there is only one window for the
-		current buffer, it becomes hidden.
-		When 'hidden' is not set, and there is only one window for the
-		current buffer, and the buffer was changed, the command fails.
-		(Note: CTRL-Q does not work on all terminals)
-
-:q[uit]!	Quit current window.  If this was the last window for a buffer,
-		any changes to that buffer are lost.  When quitting the last
-		window (not counting help windows), exit Vim.  The contents of
-		the buffer are lost, even when 'hidden' is set.
+		Without {count}: Quit the current window.  If {count} is
+		given quit the {count} window.
 
+		When quitting the last window (not counting a help window),
+		exit Vim.
+		
+		When 'hidden' is set, and there is only one window for the
+		current buffer, it becomes hidden.  When 'hidden' is not set,
+		and there is only one window for the current buffer, and the
+		buffer was changed, the command fails.
+		
+		(Note: CTRL-Q does not
+		work on all terminals).  If [count] is greater than
+		the last window number the last window will be closed: >
+		    :1quit  " quit the first window
+		    :$quit  " quit the last window
+		    :9quit  " quit the last window
+			     " if there are less than 9 windows opened
+		    :-quit  " quit the previews window
+		    :+quit  " quit the next window
+		    :+2quit " will also work as expected
+<
+:q[uit]!
+:{count}q[uit]!
+		Without {count}: Quit the current window.  If {count} is
+		given quit the {count} window.
+
+		If this was the last window for a buffer, any changes to that
+		buffer are lost.  When quitting the last window (not counting
+		help windows), exit Vim.  The contents of the buffer are lost,
+		even when 'hidden' is set.
+
+:clo[se][!]
+:{count}clo[se][!]
 CTRL-W c					*CTRL-W_c* *:clo* *:close*
-:clo[se][!]	Close current window.  When the 'hidden' option is set, or
-		when the buffer was changed and the [!] is used, the buffer
-		becomes hidden (unless there is another window editing it).
+		Without {count}: Close the current window.  If {count} is
+		given close the {count} window.
+
+		When the 'hidden' option is set, or when the buffer was
+		changed and the [!] is used, the buffer becomes hidden (unless
+		there is another window editing it).
+		
 		When there is only one window in the current tab page and
 		there is another tab page, this closes the current tab page.
 		|tab-page|.
+
 		This command fails when:			*E444*
 		- There is only one window on the screen.
 		- When 'hidden' is not set, [!] is not used, the buffer has
@@ -298,14 +326,19 @@ CTRL-W CTRL-C						*CTRL-W_CTRL-C*
 		command.
 
 							*:hide*
-:hid[e]		Quit current window, unless it is the last window on the
-		screen.  The buffer becomes hidden (unless there is another
-		window editing it or 'bufhidden' is "unload" or "delete").
-		If the window is the last one in the current tab page the tab
-		page is closed. |tab-page|
-		The value of 'hidden' is irrelevant for this command.
-		Changes to the buffer are not written and won't get lost, so
-		this is a "safe" command.
+:hid[e]
+:{count}hid[e]
+		Quit the current window, unless it is the last window on the
+		screen.  For {count} see |:quit| command.
+		
+		The buffer becomes hidden (unless there is another window
+		editing it or 'bufhidden' is "unload" or "delete").  If the
+		window is the last one in the current tab page the tab page is
+		closed.  |tab-page| 
+		
+		The value of 'hidden' is irrelevant for this command.  Changes
+		to the buffer are not written and won't get lost, so this is a
+		"safe" command.
 
 :hid[e] {cmd}	Execute {cmd} with 'hidden' is set.  The previous value of
 		'hidden' is restored after {cmd} has been executed.
@@ -314,12 +347,16 @@ CTRL-W CTRL-C						*CTRL-W_CTRL-C*
 <		This will edit "Makefile", and hide the current buffer if it
 		has any changes.
 
+:on[ly][!]
+:{count}on[ly][!]
 CTRL-W o						*CTRL-W_o* *E445*
 CTRL-W CTRL-O					*CTRL-W_CTRL-O* *:on* *:only*
-:on[ly][!]	Make the current window the only one on the screen.  All other
-		windows are closed.
+		Make the current window the only one on the screen.  All other
+		windows are closed.  For {count} see |:quit| command.
+		
 		When the 'hidden' option is set, all buffers in closed windows
 		become hidden.
+		
 		When 'hidden' is not set, and the 'autowrite' option is set,
 		modified buffers are written.  Otherwise, windows that have
 		buffers that are modified are not removed, unless the [!] is
diff --git a/src/Makefile b/src/Makefile
index 6bf8c1737d..13fe70b1ad 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1890,10 +1890,12 @@ unittest unittests: $(UNITTEST_TARGETS)
 	done
 
 # Run individual test, assuming that Vim was already compiled.
-test1 test2 test3 test4 test5 test6 test7 test8 test9 \
+test1 \
+	test_argument_count \
 	test_autoformat_join \
 	test_breakindent \
 	test_changelist \
+	test_close_count \
 	test_eval \
 	test_insertcount \
 	test_listlbr \
@@ -1904,6 +1906,7 @@ test1 test2 test3 test4 test5 test6 test7 test8 test9 \
 	test_signs \
 	test_utf8 \
 	test_writefile \
+	test2 test3 test4 test5 test6 test7 test8 test9 \
 	test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
 	test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
 	test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 93c77764a0..5574ea7bc2 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -58,6 +58,14 @@
 #define WORD1	(EXTRA | NOSPC)	/* one extra word allowed */
 #define FILE1	(FILES | NOSPC)	/* 1 file allowed, defaults to current file */
 
+/* values for cmd_addr_type */
+#define ADDR_LINES		0
+#define ADDR_WINDOWS		1
+#define ADDR_ARGUMENTS		2
+#define ADDR_LOADED_BUFFERS	3
+#define ADDR_UNLOADED_BUFFERS	4
+#define ADDR_TABS		5
+
 #ifndef DO_DECLARE_EXCMD
 typedef struct exarg exarg_T;
 #endif
@@ -74,7 +82,7 @@ typedef struct exarg exarg_T;
 # undef EX	    /* just in case */
 #endif
 #ifdef DO_DECLARE_EXCMD
-# define EX(a, b, c, d)  {(char_u *)b, c, (long_u)(d)}
+# define EX(a, b, c, d, e)  {(char_u *)b, c, (long_u)(d), e}
 
 typedef void (*ex_func_T) __ARGS((exarg_T *eap));
 
@@ -83,1064 +91,1588 @@ static struct cmdname
     char_u	*cmd_name;	/* name of the command */
     ex_func_T   cmd_func;	/* function for this command */
     long_u	cmd_argt;	/* flags declared above */
+    int		cmd_addr_type;	/* flag for address type */
 }
 # if defined(FEAT_GUI_W16)
 _far
 # endif
 cmdnames[] =
 #else
-# define EX(a, b, c, d)  a
+# define EX(a, b, c, d, e)  a
 enum CMD_index
 #endif
 {
 EX(CMD_append,		"append",	ex_append,
-			BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY),
+			BANG|RANGE|ZEROR|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_abbreviate,	"abbreviate",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_abclear,		"abclear",	ex_abclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_aboveleft,	"aboveleft",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_all,		"all",		ex_all,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_amenu,		"amenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_anoremenu,	"anoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_args,		"args",		ex_args,
-			BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_argadd,		"argadd",	ex_argadd,
-			BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR),
+			BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILES|TRLBAR,
+			ADDR_ARGUMENTS),
 EX(CMD_argdelete,	"argdelete",	ex_argdelete,
-			BANG|RANGE|NOTADR|FILES|TRLBAR),
+			BANG|RANGE|NOTADR|FILES|TRLBAR,
+			ADDR_ARGUMENTS),
 EX(CMD_argdo,		"argdo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM),
+			BANG|NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_argedit,		"argedit",	ex_argedit,
-			BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_ARGUMENTS),
 EX(CMD_argglobal,	"argglobal",	ex_args,
-			BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_arglocal,	"arglocal",	ex_args,
-			BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_argument,	"argument",	ex_argument,
-			BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_ARGUMENTS),
 EX(CMD_ascii,		"ascii",	do_ascii,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_autocmd,		"autocmd",	ex_autocmd,
-			BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN),
+			BANG|EXTRA|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_augroup,		"augroup",	ex_autocmd,
-			BANG|WORD1|TRLBAR|CMDWIN),
+			BANG|WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_aunmenu,		"aunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_buffer,		"buffer",	ex_buffer,
-			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
+			ADDR_UNLOADED_BUFFERS),
 EX(CMD_bNext,		"bNext",	ex_bprevious,
-			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_ball,		"ball",		ex_buffer_all,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_badd,		"badd",		ex_edit,
-			NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN),
+			NEEDARG|FILE1|EDITCMD|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_bdelete,		"bdelete",	ex_bunload,
-			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+			ADDR_LOADED_BUFFERS),
 EX(CMD_behave,		"behave",	ex_behave,
-			NEEDARG|WORD1|TRLBAR|CMDWIN),
+			NEEDARG|WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_belowright,	"belowright",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_bfirst,		"bfirst",	ex_brewind,
-			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_blast,		"blast",	ex_blast,
-			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_bmodified,	"bmodified",	ex_bmodified,
-			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_bnext,		"bnext",	ex_bnext,
-			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_botright,	"botright",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_bprevious,	"bprevious",	ex_bprevious,
-			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_brewind,		"brewind",	ex_brewind,
-			BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_break,		"break",	ex_break,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_breakadd,	"breakadd",	ex_breakadd,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_breakdel,	"breakdel",	ex_breakdel,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_breaklist,	"breaklist",	ex_breaklist,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_browse,		"browse",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+			NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_buffers,		"buffers",	buflist_list,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_bufdo,		"bufdo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM),
+			BANG|NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_bunload,		"bunload",	ex_bunload,
-			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+			ADDR_LOADED_BUFFERS),
 EX(CMD_bwipeout,	"bwipeout",	ex_bunload,
-			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR,
+			ADDR_UNLOADED_BUFFERS),
 EX(CMD_change,		"change",	ex_change,
-			BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY),
+			BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_cNext,		"cNext",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cNfile,		"cNfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cabbrev,		"cabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cabclear,	"cabclear",	ex_abclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_caddbuffer,	"caddbuffer",	ex_cbuffer,
-			RANGE|NOTADR|WORD1|TRLBAR),
+			RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_caddexpr,	"caddexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+			ADDR_LINES),
 EX(CMD_caddfile,	"caddfile",	ex_cfile,
-			TRLBAR|FILE1),
+			TRLBAR|FILE1,
+			ADDR_LINES),
 EX(CMD_call,		"call",		ex_call,
-			RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			RANGE|NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_catch,		"catch",	ex_catch,
-			EXTRA|SBOXOK|CMDWIN),
+			EXTRA|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cbuffer,		"cbuffer",	ex_cbuffer,
-			BANG|RANGE|NOTADR|WORD1|TRLBAR),
+			BANG|RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_cc,		"cc",		ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cclose,		"cclose",	ex_cclose,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_cd,		"cd",		ex_cd,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_center,		"center",	ex_align,
-			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_cexpr,		"cexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cfile,		"cfile",	ex_cfile,
-			TRLBAR|FILE1|BANG),
+			TRLBAR|FILE1|BANG,
+			ADDR_LINES),
 EX(CMD_cfirst,		"cfirst",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cgetfile,	"cgetfile",	ex_cfile,
-			TRLBAR|FILE1),
+			TRLBAR|FILE1,
+			ADDR_LINES),
 EX(CMD_cgetbuffer,	"cgetbuffer",	ex_cbuffer,
-			RANGE|NOTADR|WORD1|TRLBAR),
+			RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_cgetexpr,	"cgetexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+			ADDR_LINES),
 EX(CMD_chdir,		"chdir",	ex_cd,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_changes,		"changes",	ex_changes,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_checkpath,	"checkpath",	ex_checkpath,
-			TRLBAR|BANG|CMDWIN),
+			TRLBAR|BANG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_checktime,	"checktime",	ex_checktime,
-			RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR),
+			RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_clist,		"clist",	qf_list,
-			BANG|EXTRA|TRLBAR|CMDWIN),
+			BANG|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_clast,		"clast",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_close,		"close",	ex_close,
-			BANG|TRLBAR|CMDWIN),
+			BANG|RANGE|NOTADR|COUNT|TRLBAR|CMDWIN,
+			ADDR_WINDOWS),
 EX(CMD_cmap,		"cmap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cmapclear,	"cmapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cmenu,		"cmenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cnext,		"cnext",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cnewer,		"cnewer",	qf_age,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_cnfile,		"cnfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cnoremap,	"cnoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cnoreabbrev,	"cnoreabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cnoremenu,	"cnoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_copy,		"copy",		ex_copymove,
-			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_colder,		"colder",	qf_age,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_colorscheme,	"colorscheme",	ex_colorscheme,
-			WORD1|TRLBAR|CMDWIN),
+			WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_command,		"command",	ex_command,
-			EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|BANG|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_comclear,	"comclear",	ex_comclear,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_compiler,	"compiler",	ex_compiler,
-			BANG|TRLBAR|WORD1|CMDWIN),
+			BANG|TRLBAR|WORD1|CMDWIN,
+			ADDR_LINES),
 EX(CMD_continue,	"continue",	ex_continue,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_confirm,		"confirm",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM|CMDWIN),
+			NEEDARG|EXTRA|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_copen,		"copen",	ex_copen,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_cprevious,	"cprevious",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cpfile,		"cpfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cquit,		"cquit",	ex_cquit,
-			TRLBAR|BANG),
+			TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_crewind,		"crewind",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_cscope,		"cscope",	do_cscope,
-			EXTRA|NOTRLCOM|XFILE),
+			EXTRA|NOTRLCOM|XFILE,
+			ADDR_LINES),
 EX(CMD_cstag,		"cstag",	do_cstag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_cunmap,		"cunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cunabbrev,	"cunabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cunmenu,		"cunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_cwindow,		"cwindow",	ex_cwindow,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_delete,		"delete",	ex_operators,
-			RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_delmarks,	"delmarks",	ex_delmarks,
-			BANG|EXTRA|TRLBAR|CMDWIN),
+			BANG|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_debug,		"debug",	ex_debug,
-			NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_debuggreedy,	"debuggreedy",	ex_debuggreedy,
-			RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN),
+			RANGE|NOTADR|ZEROR|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_delcommand,	"delcommand",	ex_delcommand,
-			NEEDARG|WORD1|TRLBAR|CMDWIN),
+			NEEDARG|WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_delfunction,	"delfunction",	ex_delfunction,
-			NEEDARG|WORD1|CMDWIN),
+			NEEDARG|WORD1|CMDWIN,
+			ADDR_LINES),
 EX(CMD_display,		"display",	ex_display,
-			EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_diffupdate,	"diffupdate",	ex_diffupdate,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_diffget,		"diffget",	ex_diffgetput,
-			RANGE|EXTRA|TRLBAR|MODIFY),
+			RANGE|EXTRA|TRLBAR|MODIFY,
+			ADDR_LINES),
 EX(CMD_diffoff,		"diffoff",	ex_diffoff,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_diffpatch,	"diffpatch",	ex_diffpatch,
-			EXTRA|FILE1|TRLBAR|MODIFY),
+			EXTRA|FILE1|TRLBAR|MODIFY,
+			ADDR_LINES),
 EX(CMD_diffput,		"diffput",	ex_diffgetput,
-			RANGE|EXTRA|TRLBAR),
+			RANGE|EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_diffsplit,	"diffsplit",	ex_diffsplit,
-			EXTRA|FILE1|TRLBAR),
+			EXTRA|FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_diffthis,	"diffthis",	ex_diffthis,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_digraphs,	"digraphs",	ex_digraphs,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_djump,		"djump",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+			ADDR_LINES),
 EX(CMD_dlist,		"dlist",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_doautocmd,	"doautocmd",	ex_doautocmd,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_doautoall,	"doautoall",	ex_doautoall,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_drop,		"drop",		ex_drop,
-			FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR),
+			FILES|EDITCMD|NEEDARG|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_dsearch,		"dsearch",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_dsplit,		"dsplit",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+			ADDR_LINES),
 EX(CMD_edit,		"edit",		ex_edit,
-			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_earlier,		"earlier",	ex_later,
-			TRLBAR|EXTRA|NOSPC|CMDWIN),
+			TRLBAR|EXTRA|NOSPC|CMDWIN,
+			ADDR_LINES),
 EX(CMD_echo,		"echo",		ex_echo,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_echoerr,		"echoerr",	ex_execute,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_echohl,		"echohl",	ex_echohl,
-			EXTRA|TRLBAR|SBOXOK|CMDWIN),
+			EXTRA|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_echomsg,		"echomsg",	ex_execute,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_echon,		"echon",	ex_echo,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_else,		"else",		ex_else,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_elseif,		"elseif",	ex_else,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_emenu,		"emenu",	ex_emenu,
-			NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN),
+			NEEDARG|EXTRA|TRLBAR|NOTRLCOM|RANGE|NOTADR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_endif,		"endif",	ex_endif,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_endfunction,	"endfunction",	ex_endfunction,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_endfor,		"endfor",	ex_endwhile,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_endtry,		"endtry",	ex_endtry,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_endwhile,	"endwhile",	ex_endwhile,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_enew,		"enew",		ex_edit,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_ex,		"ex",		ex_edit,
-			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_execute,		"execute",	ex_execute,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_exit,		"exit",		ex_exit,
-			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_exusage,		"exusage",	ex_exusage,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_file,		"file",		ex_file,
-			RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR),
+			RANGE|NOTADR|ZEROR|BANG|FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_files,		"files",	buflist_list,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_filetype,	"filetype",	ex_filetype,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_find,		"find",		ex_find,
-			RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			RANGE|NOTADR|BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_finally,		"finally",	ex_finally,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_finish,		"finish",	ex_finish,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_first,		"first",	ex_rewind,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_fixdel,		"fixdel",	do_fixdel,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_fold,		"fold",		ex_fold,
-			RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_foldclose,	"foldclose",	ex_foldopen,
-			RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_folddoopen,	"folddoopen",	ex_folddo,
-			RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+			RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_folddoclosed,	"folddoclosed",	ex_folddo,
-			RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM),
+			RANGE|DFLALL|NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_foldopen,	"foldopen",	ex_foldopen,
-			RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|BANG|WHOLEFOLD|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_for,		"for",		ex_while,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_function,	"function",	ex_function,
-			EXTRA|BANG|CMDWIN),
+			EXTRA|BANG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_global,		"global",	ex_global,
-			RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN),
+			RANGE|WHOLEFOLD|BANG|EXTRA|DFLALL|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_goto,		"goto",		ex_goto,
-			RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|NOTADR|COUNT|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_grep,		"grep",		ex_make,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_grepadd,		"grepadd",	ex_make,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_gui,		"gui",		ex_gui,
-			BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+			BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_gvim,		"gvim",		ex_gui,
-			BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
+			BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_help,		"help",		ex_help,
-			BANG|EXTRA|NOTRLCOM),
+			BANG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_helpclose,	"helpclose",	ex_helpclose,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_helpfind,	"helpfind",	ex_helpfind,
-			EXTRA|NOTRLCOM),
+			EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_helpgrep,	"helpgrep",	ex_helpgrep,
-			EXTRA|NOTRLCOM|NEEDARG),
+			EXTRA|NOTRLCOM|NEEDARG,
+			ADDR_LINES),
 EX(CMD_helptags,	"helptags",	ex_helptags,
-			NEEDARG|FILES|TRLBAR|CMDWIN),
+			NEEDARG|FILES|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_hardcopy,	"hardcopy",	ex_hardcopy,
-			RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG),
+			RANGE|COUNT|EXTRA|TRLBAR|DFLALL|BANG,
+			ADDR_LINES),
 EX(CMD_highlight,	"highlight",	ex_highlight,
-			BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN),
+			BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_hide,		"hide",		ex_hide,
-			BANG|EXTRA|NOTRLCOM),
+			BANG|RANGE|NOTADR|COUNT|EXTRA|NOTRLCOM,
+			ADDR_WINDOWS),
 EX(CMD_history,		"history",	ex_history,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_insert,		"insert",	ex_append,
-			BANG|RANGE|TRLBAR|CMDWIN|MODIFY),
+			BANG|RANGE|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_iabbrev,		"iabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_iabclear,	"iabclear",	ex_abclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_if,		"if",		ex_if,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_ijump,		"ijump",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+			ADDR_LINES),
 EX(CMD_ilist,		"ilist",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_imap,		"imap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_imapclear,	"imapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_imenu,		"imenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_inoremap,	"inoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_inoreabbrev,	"inoreabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_inoremenu,	"inoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_intro,		"intro",	ex_intro,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_isearch,		"isearch",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_isplit,		"isplit",	ex_findpat,
-			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA),
+			BANG|RANGE|DFLALL|WHOLEFOLD|EXTRA,
+			ADDR_LINES),
 EX(CMD_iunmap,		"iunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_iunabbrev,	"iunabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_iunmenu,		"iunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_join,		"join",		ex_join,
-			BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+			BANG|RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_jumps,		"jumps",	ex_jumps,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_k,		"k",		ex_mark,
-			RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_keepmarks,	"keepmarks",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_keepjumps,	"keepjumps",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_keeppatterns,	"keeppatterns",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_keepalt,		"keepalt",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_list,		"list",		ex_print,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lNext,		"lNext",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lNfile,		"lNfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_last,		"last",		ex_last,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_language,	"language",	ex_language,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_laddexpr,	"laddexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+			ADDR_LINES),
 EX(CMD_laddbuffer,	"laddbuffer",	ex_cbuffer,
-			RANGE|NOTADR|WORD1|TRLBAR),
+			RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_laddfile,	"laddfile",	ex_cfile,
-			TRLBAR|FILE1),
+			TRLBAR|FILE1,
+			ADDR_LINES),
 EX(CMD_later,		"later",	ex_later,
-			TRLBAR|EXTRA|NOSPC|CMDWIN),
+			TRLBAR|EXTRA|NOSPC|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lbuffer,		"lbuffer",	ex_cbuffer,
-			BANG|RANGE|NOTADR|WORD1|TRLBAR),
+			BANG|RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lcd,		"lcd",		ex_cd,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lchdir,		"lchdir",	ex_cd,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lclose,		"lclose",	ex_cclose,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lcscope,		"lcscope",	do_cscope,
-			EXTRA|NOTRLCOM|XFILE),
+			EXTRA|NOTRLCOM|XFILE,
+			ADDR_LINES),
 EX(CMD_left,		"left",		ex_align,
-			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_leftabove,	"leftabove",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_let,		"let",		ex_let,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lexpr,		"lexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lfile,		"lfile",	ex_cfile,
-			TRLBAR|FILE1|BANG),
+			TRLBAR|FILE1|BANG,
+			ADDR_LINES),
 EX(CMD_lfirst,		"lfirst",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lgetfile,	"lgetfile",	ex_cfile,
-			TRLBAR|FILE1),
+			TRLBAR|FILE1,
+			ADDR_LINES),
 EX(CMD_lgetbuffer,	"lgetbuffer",	ex_cbuffer,
-			RANGE|NOTADR|WORD1|TRLBAR),
+			RANGE|NOTADR|WORD1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lgetexpr,	"lgetexpr",	ex_cexpr,
-			NEEDARG|WORD1|NOTRLCOM|TRLBAR),
+			NEEDARG|WORD1|NOTRLCOM|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lgrep,		"lgrep",	ex_make,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_lgrepadd,	"lgrepadd",	ex_make,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_lhelpgrep,	"lhelpgrep",	ex_helpgrep,
-			EXTRA|NOTRLCOM|NEEDARG),
+			EXTRA|NOTRLCOM|NEEDARG,
+			ADDR_LINES),
 EX(CMD_ll,		"ll",		ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_llast,		"llast",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_llist,		"llist",	qf_list,
-			BANG|EXTRA|TRLBAR|CMDWIN),
+			BANG|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lmap,		"lmap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lmapclear,	"lmapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lmake,		"lmake",	ex_make,
-			BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_lnoremap,	"lnoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lnext,		"lnext",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lnewer,		"lnewer",	qf_age,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lnfile,		"lnfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_loadview,	"loadview",	ex_loadview,
-			FILE1|TRLBAR),
+			FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_loadkeymap,	"loadkeymap",	ex_loadkeymap,
-			CMDWIN),
+			CMDWIN,
+			ADDR_LINES),
 EX(CMD_lockmarks,	"lockmarks",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_lockvar,		"lockvar",	ex_lockvar,
-			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lolder,		"lolder",	qf_age,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lopen,		"lopen",	ex_copen,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_lprevious,	"lprevious",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lpfile,		"lpfile",	ex_cnext,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_lrewind,		"lrewind",	ex_cc,
-			RANGE|NOTADR|COUNT|TRLBAR|BANG),
+			RANGE|NOTADR|COUNT|TRLBAR|BANG,
+			ADDR_LINES),
 EX(CMD_ltag,		"ltag",	ex_tag,
-			NOTADR|TRLBAR|BANG|WORD1),
+			NOTADR|TRLBAR|BANG|WORD1,
+			ADDR_LINES),
 EX(CMD_lunmap,		"lunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lua,		"lua",		ex_lua,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_luado,		"luado",	ex_luado,
-			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_luafile,		"luafile",	ex_luafile,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lvimgrep,	"lvimgrep",	ex_vimgrep,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_lvimgrepadd,	"lvimgrepadd",	ex_vimgrep,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_lwindow,		"lwindow",	ex_cwindow,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_ls,		"ls",		buflist_list,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_move,		"move",		ex_copymove,
-			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_mark,		"mark",		ex_mark,
-			RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN),
+			RANGE|WORD1|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_make,		"make",		ex_make,
-			BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			BANG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_map,		"map",		ex_map,
-			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_mapclear,	"mapclear",	ex_mapclear,
-			EXTRA|BANG|TRLBAR|CMDWIN),
+			EXTRA|BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_marks,		"marks",	do_marks,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_match,		"match",	ex_match,
-			RANGE|NOTADR|EXTRA|CMDWIN),
+			RANGE|NOTADR|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_menu,		"menu",		ex_menu,
-			RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_menutranslate,	"menutranslate", ex_menutranslate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_messages,	"messages",	ex_messages,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_mkexrc,		"mkexrc",	ex_mkrc,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_mksession,	"mksession",	ex_mkrc,
-			BANG|FILE1|TRLBAR),
+			BANG|FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_mkspell,		"mkspell",	ex_mkspell,
-			BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_mkvimrc,		"mkvimrc",	ex_mkrc,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_mkview,		"mkview",	ex_mkrc,
-			BANG|FILE1|TRLBAR),
+			BANG|FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_mode,		"mode",		ex_mode,
-			WORD1|TRLBAR|CMDWIN),
+			WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_mzscheme,	"mzscheme",	ex_mzscheme,
-			RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK),
+			RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN|SBOXOK,
+			ADDR_LINES),
 EX(CMD_mzfile,		"mzfile",	ex_mzfile,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_next,		"next",		ex_next,
-			RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+			RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_nbkey,		"nbkey",	ex_nbkey,
-			EXTRA|NOTADR|NEEDARG),
+			EXTRA|NOTADR|NEEDARG,
+			ADDR_LINES),
 EX(CMD_nbclose,		"nbclose",	ex_nbclose,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nbstart,		"nbstart",	ex_nbstart,
-			WORD1|TRLBAR|CMDWIN),
+			WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_new,		"new",		ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_nmap,		"nmap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nmapclear,	"nmapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nmenu,		"nmenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nnoremap,	"nnoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nnoremenu,	"nnoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_noremap,		"noremap",	ex_map,
-			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_noautocmd,	"noautocmd",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_nohlsearch,	"nohlsearch",	ex_nohlsearch,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_noreabbrev,	"noreabbrev",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_noremenu,	"noremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_noswapfile,	"noswapfile",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_normal,		"normal",	ex_normal,
-			RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN),
+			RANGE|BANG|EXTRA|NEEDARG|NOTRLCOM|USECTRLV|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_number,		"number",	ex_print,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nunmap,		"nunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_nunmenu,		"nunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_open,		"open",		ex_open,
-			RANGE|BANG|EXTRA),
+			RANGE|BANG|EXTRA,
+			ADDR_LINES),
 EX(CMD_oldfiles,	"oldfiles",	ex_oldfiles,
-			BANG|TRLBAR|SBOXOK|CMDWIN),
+			BANG|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_omap,		"omap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_omapclear,	"omapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_omenu,		"omenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_only,		"only",		ex_only,
-			BANG|TRLBAR),
+			BANG|NOTADR|RANGE|COUNT|TRLBAR,
+			ADDR_WINDOWS),
 EX(CMD_onoremap,	"onoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_onoremenu,	"onoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_options,		"options",	ex_options,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_ounmap,		"ounmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_ounmenu,		"ounmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_ownsyntax,	"ownsyntax",	ex_ownsyntax,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_print,		"print",	ex_print,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK,
+			ADDR_LINES),
 EX(CMD_pclose,		"pclose",	ex_pclose,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_perl,		"perl",		ex_perl,
-			RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN),
+			RANGE|EXTRA|DFLALL|NEEDARG|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_perldo,		"perldo",	ex_perldo,
-			RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN),
+			RANGE|EXTRA|DFLALL|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_pedit,		"pedit",	ex_pedit,
-			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_pop,		"pop",		ex_tag,
-			RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_popup,		"popup",	ex_popup,
-			NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN),
+			NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_ppop,		"ppop",		ex_ptag,
-			RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|COUNT|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_preserve,	"preserve",	ex_preserve,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_previous,	"previous",	ex_previous,
-			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_promptfind,	"promptfind",	gui_mch_find_dialog,
-			EXTRA|NOTRLCOM|CMDWIN),
+			EXTRA|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_promptrepl,	"promptrepl",	gui_mch_replace_dialog,
-			EXTRA|NOTRLCOM|CMDWIN),
+			EXTRA|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_profile,		"profile",	ex_profile,
-			BANG|EXTRA|TRLBAR|CMDWIN),
+			BANG|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_profdel,		"profdel",	ex_breakdel,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_psearch,		"psearch",	ex_psearch,
-			BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA),
+			BANG|RANGE|WHOLEFOLD|DFLALL|EXTRA,
+			ADDR_LINES),
 EX(CMD_ptag,		"ptag",		ex_ptag,
-			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptNext,		"ptNext",	ex_ptag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptfirst,		"ptfirst",	ex_ptag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptjump,		"ptjump",	ex_ptag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_ptlast,		"ptlast",	ex_ptag,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_ptnext,		"ptnext",	ex_ptag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptprevious,	"ptprevious",	ex_ptag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptrewind,	"ptrewind",	ex_ptag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_ptselect,	"ptselect",	ex_ptag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_put,		"put",		ex_put,
-			RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|BANG|REGSTR|TRLBAR|ZEROR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_pwd,		"pwd",		ex_pwd,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_python,		"python",	ex_python,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_pydo,		"pydo",		ex_pydo,
-			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_pyfile,		"pyfile",	ex_pyfile,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_py3,		"py3",		ex_py3,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_py3do,		"py3do",	ex_py3do,
-			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_python3,		"python3",	ex_py3,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_py3file,		"py3file",	ex_py3file,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_quit,		"quit",		ex_quit,
-			BANG|TRLBAR|CMDWIN),
+			BANG|RANGE|COUNT|NOTADR|TRLBAR|CMDWIN,
+			ADDR_WINDOWS),
 EX(CMD_quitall,		"quitall",	ex_quit_all,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_qall,		"qall",		ex_quit_all,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_read,		"read",		ex_read,
-			BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY),
+			BANG|RANGE|WHOLEFOLD|FILE1|ARGOPT|TRLBAR|ZEROR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_recover,		"recover",	ex_recover,
-			BANG|FILE1|TRLBAR),
+			BANG|FILE1|TRLBAR,
+			ADDR_LINES),
 EX(CMD_redo,		"redo",		ex_redo,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_redir,		"redir",	ex_redir,
-			BANG|FILES|TRLBAR|CMDWIN),
+			BANG|FILES|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_redraw,		"redraw",	ex_redraw,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_redrawstatus,	"redrawstatus",	ex_redrawstatus,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_registers,	"registers",	ex_display,
-			EXTRA|NOTRLCOM|TRLBAR|CMDWIN),
+			EXTRA|NOTRLCOM|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_resize,		"resize",	ex_resize,
-			RANGE|NOTADR|TRLBAR|WORD1),
+			RANGE|NOTADR|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_retab,		"retab",	ex_retab,
-			TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY),
+			TRLBAR|RANGE|WHOLEFOLD|DFLALL|BANG|WORD1|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_return,		"return",	ex_return,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_rewind,		"rewind",	ex_rewind,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_right,		"right",	ex_align,
-			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+			TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_rightbelow,	"rightbelow",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_runtime,		"runtime",	ex_runtime,
-			BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN),
+			BANG|NEEDARG|FILES|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_ruby,		"ruby",		ex_ruby,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_rubydo,		"rubydo",	ex_rubydo,
-			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_rubyfile,	"rubyfile",	ex_rubyfile,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_rundo,		"rundo",	ex_rundo,
-			NEEDARG|FILE1),
+			NEEDARG|FILE1,
+			ADDR_LINES),
 EX(CMD_rviminfo,	"rviminfo",	ex_viminfo,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_substitute,	"substitute",	do_sub,
-			RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sNext,		"sNext",	ex_previous,
-			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sargument,	"sargument",	ex_argument,
-			BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|EXTRA|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_ARGUMENTS),
 EX(CMD_sall,		"sall",		ex_all,
-			BANG|RANGE|NOTADR|COUNT|TRLBAR),
+			BANG|RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sandbox,		"sandbox",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_saveas,		"saveas",	ex_write,
-			BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
+			BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbuffer,		"sbuffer",	ex_buffer,
-			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
+			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
+			ADDR_UNLOADED_BUFFERS),
 EX(CMD_sbNext,		"sbNext",	ex_bprevious,
-			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sball,		"sball",	ex_buffer_all,
-			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbfirst,		"sbfirst",	ex_brewind,
-			EDITCMD|TRLBAR),
+			EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sblast,		"sblast",	ex_blast,
-			EDITCMD|TRLBAR),
+			EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbmodified,	"sbmodified",	ex_bmodified,
-			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbnext,		"sbnext",	ex_bnext,
-			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbprevious,	"sbprevious",	ex_bprevious,
-			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
+			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sbrewind,	"sbrewind",	ex_brewind,
-			EDITCMD|TRLBAR),
+			EDITCMD|TRLBAR,
+			ADDR_LINES),
 EX(CMD_scriptnames,	"scriptnames",	ex_scriptnames,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_scriptencoding,	"scriptencoding", ex_scriptencoding,
-			WORD1|TRLBAR|CMDWIN),
+			WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_scscope,		"scscope",	do_scscope,
-			EXTRA|NOTRLCOM),
+			EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_set,		"set",		ex_set,
-			TRLBAR|EXTRA|CMDWIN|SBOXOK),
+			TRLBAR|EXTRA|CMDWIN|SBOXOK,
+			ADDR_LINES),
 EX(CMD_setfiletype,	"setfiletype",	ex_setfiletype,
-			TRLBAR|EXTRA|NEEDARG|CMDWIN),
+			TRLBAR|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_setglobal,	"setglobal",	ex_set,
-			TRLBAR|EXTRA|CMDWIN|SBOXOK),
+			TRLBAR|EXTRA|CMDWIN|SBOXOK,
+			ADDR_LINES),
 EX(CMD_setlocal,	"setlocal",	ex_set,
-			TRLBAR|EXTRA|CMDWIN|SBOXOK),
+			TRLBAR|EXTRA|CMDWIN|SBOXOK,
+			ADDR_LINES),
 EX(CMD_sfind,		"sfind",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sfirst,		"sfirst",	ex_rewind,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_shell,		"shell",	ex_shell,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_simalt,		"simalt",	ex_simalt,
-			NEEDARG|WORD1|TRLBAR|CMDWIN),
+			NEEDARG|WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sign,		"sign",		ex_sign,
-			NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN),
+			NEEDARG|RANGE|NOTADR|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_silent,		"silent",	ex_wrongmodifier,
-			NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN),
+			NEEDARG|EXTRA|BANG|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sleep,		"sleep",	ex_sleep,
-			RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN),
+			RANGE|NOTADR|COUNT|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_slast,		"slast",	ex_last,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_smagic,		"smagic",	ex_submagic,
-			RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_smap,		"smap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_smapclear,	"smapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_smenu,		"smenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_snext,		"snext",	ex_next,
-			RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR),
+			RANGE|NOTADR|BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sniff,		"sniff",	ex_sniff,
-			EXTRA|TRLBAR),
+			EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_snomagic,	"snomagic",	ex_submagic,
-			RANGE|WHOLEFOLD|EXTRA|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|CMDWIN,
+			ADDR_LINES),
 EX(CMD_snoremap,	"snoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_snoremenu,	"snoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_source,		"source",	ex_source,
-			BANG|FILE1|TRLBAR|SBOXOK|CMDWIN),
+			BANG|FILE1|TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sort,		"sort",		ex_sort,
-			RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY),
+			RANGE|DFLALL|WHOLEFOLD|BANG|EXTRA|NOTRLCOM|MODIFY,
+			ADDR_LINES),
 EX(CMD_split,		"split",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_spellgood,	"spellgood",	ex_spell,
-			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_spelldump,	"spelldump",	ex_spelldump,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_spellinfo,	"spellinfo",	ex_spellinfo,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_spellrepall,	"spellrepall",	ex_spellrepall,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_spellundo,	"spellundo",	ex_spell,
-			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_spellwrong,	"spellwrong",	ex_spell,
-			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR),
+			BANG|RANGE|NOTADR|NEEDARG|EXTRA|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sprevious,	"sprevious",	ex_previous,
-			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_srewind,		"srewind",	ex_rewind,
-			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_stop,		"stop",		ex_stop,
-			TRLBAR|BANG|CMDWIN),
+			TRLBAR|BANG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_stag,		"stag",		ex_stag,
-			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_startinsert,	"startinsert",	ex_startinsert,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_startgreplace,	"startgreplace", ex_startinsert,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_startreplace,	"startreplace",	ex_startinsert,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_stopinsert,	"stopinsert",	ex_stopinsert,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_stjump,		"stjump",	ex_stag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_stselect,	"stselect",	ex_stag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_sunhide,		"sunhide",	ex_buffer_all,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_sunmap,		"sunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sunmenu,		"sunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_suspend,		"suspend",	ex_stop,
-			TRLBAR|BANG|CMDWIN),
+			TRLBAR|BANG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_sview,		"sview",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_swapname,	"swapname",	ex_swapname,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_syntax,		"syntax",	ex_syntax,
-			EXTRA|NOTRLCOM|CMDWIN),
+			EXTRA|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_syntime,		"syntime",	ex_syntime,
-			NEEDARG|WORD1|TRLBAR|CMDWIN),
+			NEEDARG|WORD1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_syncbind,	"syncbind",	ex_syncbind,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_t,		"t",		ex_copymove,
-			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_tNext,		"tNext",	ex_tag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_tag,		"tag",		ex_tag,
-			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|WORD1|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_tags,		"tags",		do_tags,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tab,		"tab",		ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_tabclose,	"tabclose",	ex_tabclose,
-			RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN),
+			RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
+			ADDR_TABS),
 EX(CMD_tabdo,		"tabdo",	ex_listdo,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_tabedit,		"tabedit",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_TABS),
 EX(CMD_tabfind,		"tabfind",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|NEEDARG|TRLBAR,
+			ADDR_TABS),
 EX(CMD_tabfirst,	"tabfirst",	ex_tabnext,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabmove,		"tabmove",	ex_tabmove,
-			RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR),
+			RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
+			ADDR_TABS),
 EX(CMD_tablast,		"tablast",	ex_tabnext,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabnext,		"tabnext",	ex_tabnext,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabnew,		"tabnew",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_TABS),
 EX(CMD_tabonly,		"tabonly",	ex_tabonly,
-			BANG|TRLBAR|CMDWIN),
+			BANG|RANGE|NOTADR|TRLBAR|CMDWIN,
+			ADDR_TABS),
 EX(CMD_tabprevious,	"tabprevious",	ex_tabnext,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabNext,		"tabNext",	ex_tabnext,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabrewind,	"tabrewind",	ex_tabnext,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_tabs,		"tabs",		ex_tabs,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tcl,		"tcl",		ex_tcl,
-			RANGE|EXTRA|NEEDARG|CMDWIN),
+			RANGE|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tcldo,		"tcldo",	ex_tcldo,
-			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN),
+			RANGE|DFLALL|EXTRA|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tclfile,		"tclfile",	ex_tclfile,
-			RANGE|FILE1|NEEDARG|CMDWIN),
+			RANGE|FILE1|NEEDARG|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tearoff,		"tearoff",	ex_tearoff,
-			NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN),
+			NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tfirst,		"tfirst",	ex_tag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_throw,		"throw",	ex_throw,
-			EXTRA|NEEDARG|SBOXOK|CMDWIN),
+			EXTRA|NEEDARG|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tjump,		"tjump",	ex_tag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_tlast,		"tlast",	ex_tag,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_tmenu,		"tmenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tnext,		"tnext",	ex_tag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_topleft,		"topleft",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_tprevious,	"tprevious",	ex_tag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_trewind,		"trewind",	ex_tag,
-			RANGE|NOTADR|BANG|TRLBAR|ZEROR),
+			RANGE|NOTADR|BANG|TRLBAR|ZEROR,
+			ADDR_LINES),
 EX(CMD_try,		"try",		ex_try,
-			TRLBAR|SBOXOK|CMDWIN),
+			TRLBAR|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_tselect,		"tselect",	ex_tag,
-			BANG|TRLBAR|WORD1),
+			BANG|TRLBAR|WORD1,
+			ADDR_LINES),
 EX(CMD_tunmenu,		"tunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_undo,		"undo",		ex_undo,
-			RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN),
+			RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_undojoin,	"undojoin",	ex_undojoin,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_undolist,	"undolist",	ex_undolist,
-			TRLBAR|CMDWIN),
+			TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unabbreviate,	"unabbreviate",	ex_abbreviate,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unhide,		"unhide",	ex_buffer_all,
-			RANGE|NOTADR|COUNT|TRLBAR),
+			RANGE|NOTADR|COUNT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_unlet,		"unlet",	ex_unlet,
-			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unlockvar,	"unlockvar",	ex_lockvar,
-			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN),
+			BANG|EXTRA|NEEDARG|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unmap,		"unmap",	ex_unmap,
-			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unmenu,		"unmenu",	ex_menu,
-			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_unsilent,	"unsilent",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			NEEDARG|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_update,		"update",	ex_update,
-			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+			ADDR_LINES),
 EX(CMD_vglobal,		"vglobal",	ex_global,
-			RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|DFLALL|CMDWIN,
+			ADDR_LINES),
 EX(CMD_version,		"version",	ex_version,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_verbose,		"verbose",	ex_wrongmodifier,
-			NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			NEEDARG|RANGE|NOTADR|EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vertical,	"vertical",	ex_wrongmodifier,
-			NEEDARG|EXTRA|NOTRLCOM),
+			NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_visual,		"visual",	ex_edit,
-			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_view,		"view",		ex_edit,
-			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_vimgrep,		"vimgrep",	ex_vimgrep,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_vimgrepadd,	"vimgrepadd",	ex_vimgrep,
-			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE),
+			RANGE|NOTADR|BANG|NEEDARG|EXTRA|NOTRLCOM|TRLBAR|XFILE,
+			ADDR_LINES),
 EX(CMD_viusage,		"viusage",	ex_viusage,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_vmap,		"vmap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vmapclear,	"vmapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vmenu,		"vmenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vnoremap,	"vnoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vnew,		"vnew",		ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_vnoremenu,	"vnoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vsplit,		"vsplit",	ex_splitview,
-			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR),
+			BANG|FILE1|RANGE|NOTADR|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_vunmap,		"vunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_vunmenu,		"vunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_write,		"write",	ex_write,
-			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_wNext,		"wNext",	ex_wnext,
-			RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+			RANGE|WHOLEFOLD|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wall,		"wall",		do_wqall,
-			BANG|TRLBAR|CMDWIN),
+			BANG|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_while,		"while",	ex_while,
-			EXTRA|NOTRLCOM|SBOXOK|CMDWIN),
+			EXTRA|NOTRLCOM|SBOXOK|CMDWIN,
+			ADDR_LINES),
 EX(CMD_winsize,		"winsize",	ex_winsize,
-			EXTRA|NEEDARG|TRLBAR),
+			EXTRA|NEEDARG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wincmd,		"wincmd",	ex_wincmd,
-			NEEDARG|WORD1|RANGE|NOTADR),
+			NEEDARG|WORD1|RANGE|NOTADR,
+			ADDR_LINES),
 EX(CMD_windo,		"windo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM),
+			BANG|NEEDARG|EXTRA|NOTRLCOM,
+			ADDR_LINES),
 EX(CMD_winpos,		"winpos",	ex_winpos,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_wnext,		"wnext",	ex_wnext,
-			RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+			RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wprevious,	"wprevious",	ex_wnext,
-			RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR),
+			RANGE|NOTADR|BANG|FILE1|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wq,		"wq",		ex_exit,
-			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wqall,		"wqall",	do_wqall,
-			BANG|FILE1|ARGOPT|DFLALL|TRLBAR),
+			BANG|FILE1|ARGOPT|DFLALL|TRLBAR,
+			ADDR_LINES),
 EX(CMD_wsverb,		"wsverb",	ex_wsverb,
-			EXTRA|NOTADR|NEEDARG),
+			EXTRA|NOTADR|NEEDARG,
+			ADDR_LINES),
 EX(CMD_wundo,		"wundo",	ex_wundo,
-			BANG|NEEDARG|FILE1),
+			BANG|NEEDARG|FILE1,
+			ADDR_LINES),
 EX(CMD_wviminfo,	"wviminfo",	ex_viminfo,
-			BANG|FILE1|TRLBAR|CMDWIN),
+			BANG|FILE1|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xit,		"xit",		ex_exit,
-			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|BANG|FILE1|ARGOPT|DFLALL|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xall,		"xall",		do_wqall,
-			BANG|TRLBAR),
+			BANG|TRLBAR,
+			ADDR_LINES),
 EX(CMD_xmap,		"xmap",		ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xmapclear,	"xmapclear",	ex_mapclear,
-			EXTRA|TRLBAR|CMDWIN),
+			EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xmenu,		"xmenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xnoremap,	"xnoremap",	ex_map,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xnoremenu,	"xnoremenu",	ex_menu,
-			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xunmap,		"xunmap",	ex_unmap,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_xunmenu,		"xunmenu",	ex_menu,
-			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
+			EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
+			ADDR_LINES),
 EX(CMD_yank,		"yank",		ex_operators,
-			RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|REGSTR|COUNT|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_z,		"z",		ex_z,
-			RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|EXFLAGS|TRLBAR|CMDWIN,
+			ADDR_LINES),
 
 /* commands that don't start with a lowercase letter */
 EX(CMD_bang,		"!",		ex_bang,
-			RANGE|WHOLEFOLD|BANG|FILES|CMDWIN),
+			RANGE|WHOLEFOLD|BANG|FILES|CMDWIN,
+			ADDR_LINES),
 EX(CMD_pound,		"#",		ex_print,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_and,		"&",		do_sub,
-			RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_star,		"*",		ex_at,
-			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_lshift,		"<",		ex_operators,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_equal,		"=",		ex_equal,
-			RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN),
+			RANGE|TRLBAR|DFLALL|EXFLAGS|CMDWIN,
+			ADDR_LINES),
 EX(CMD_rshift,		">",		ex_operators,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|MODIFY,
+			ADDR_LINES),
 EX(CMD_at,		"@",		ex_at,
-			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_Next,		"Next",		ex_previous,
-			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR),
+			EXTRA|RANGE|NOTADR|COUNT|BANG|EDITCMD|ARGOPT|TRLBAR,
+			ADDR_LINES),
 EX(CMD_Print,		"Print",	ex_print,
-			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN),
+			RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN,
+			ADDR_LINES),
 EX(CMD_X,		"X",		ex_X,
-			TRLBAR),
+			TRLBAR,
+			ADDR_LINES),
 EX(CMD_tilde,		"~",		do_sub,
-			RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
+			RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY,
+			ADDR_LINES),
 
 #ifndef DO_DECLARE_EXCMD
 #ifdef FEAT_USR_CMDS
@@ -1172,6 +1704,7 @@ struct exarg
     int		addr_count;	/* the number of addresses given */
     linenr_T	line1;		/* the first line number */
     linenr_T	line2;		/* the second line number or count */
+    int		addr_type;	/* type of the count/range */
     int		flags;		/* extra flags after count: EXFLAG_ */
     char_u	*do_ecmd_cmd;	/* +command arg to be used in edited file */
     linenr_T	do_ecmd_lnum;	/* the line number in an edited file */
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index e90a36ecc6..7b25cdb8fe 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -60,6 +60,7 @@ static char_u *get_user_command_name __ARGS((int idx));
 # define IS_USER_CMDIDX(idx) (FALSE)
 #endif
 
+static int compute_buffer_local_count __ARGS((int addr_type, int lnum, int local));
 #ifdef FEAT_EVAL
 static char_u	*do_one_cmd __ARGS((char_u **, int, struct condstack *, char_u *(*fgetline)(int, void *, int), void *cookie));
 #else
@@ -133,7 +134,7 @@ static int	getargopt __ARGS((exarg_T *eap));
 #endif
 
 static int	check_more __ARGS((int, int));
-static linenr_T get_address __ARGS((char_u **, int skip, int to_other_file));
+static linenr_T get_address __ARGS((char_u **, int addr_type, int skip, int to_other_file));
 static void	get_flags __ARGS((exarg_T *eap));
 #if !defined(FEAT_PERL) \
 	|| !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \
@@ -1680,6 +1681,39 @@ getline_cookie(fgetline, cookie)
 }
 #endif
 
+
+/*
+ * Helper function to apply an offset for buffer commands, i.e. ":bdelete",
+ * ":bwipeout", etc.
+ * Returns the buffer number.
+ */
+    static int
+compute_buffer_local_count(addr_type, lnum, offset)
+    int	    addr_type;
+    int	    lnum;
+    int	    offset;
+{
+    buf_T   *buf;
+    int     count = offset;
+
+    buf = firstbuf;
+    while (buf->b_next != NULL && buf->b_fnum < lnum)
+	buf = buf->b_next;
+    while (count != 0)
+    {
+	count += (count < 0) ? 1 : -1;
+	if (buf->b_prev == NULL)
+	    break;
+	buf = (count < 0) ? buf->b_prev : buf->b_next;
+	if (addr_type == ADDR_LOADED_BUFFERS)
+	    /* skip over unloaded buffers */
+	    while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
+		buf = (count < 0) ? buf->b_prev : buf->b_next;
+    }
+    return buf->b_fnum;
+}
+
+
 /*
  * Execute one Ex command.
  *
@@ -1687,10 +1721,10 @@ getline_cookie(fgetline, cookie)
  *
  * 1. skip comment lines and leading space
  * 2. handle command modifiers
- * 3. parse range
- * 4. parse command
- * 5. parse arguments
- * 6. switch on command name
+ * 3. parse command
+ * 4. parse range
+ * 6. parse arguments
+ * 7. switch on command name
  *
  * Note: "fgetline" can be NULL.
  *
@@ -1730,6 +1764,9 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
     cmdmod_T		save_cmdmod;
     int			ni;			/* set when Not Implemented */
+    win_T		*wp;
+    tabpage_T		*tp;
+    char_u		*cmd;
 
     vim_memset(&ea, 0, sizeof(ea));
     ea.line1 = 1;
@@ -1769,7 +1806,7 @@ do_one_cmd(cmdlinep, sourcing,
     for (;;)
     {
 /*
- * 1. skip comment lines and leading white space and colons
+ * 1. Skip comment lines and leading white space and colons.
  */
 	while (*ea.cmd == ' ' || *ea.cmd == '\t' || *ea.cmd == ':')
 	    ++ea.cmd;
@@ -1794,7 +1831,7 @@ do_one_cmd(cmdlinep, sourcing,
 	}
 
 /*
- * 2. handle command modifiers.
+ * 2. Handle command modifiers.
  */
 	p = ea.cmd;
 	if (VIM_ISDIGIT(*ea.cmd))
@@ -2003,7 +2040,18 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
 
 /*
- * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ * 3. Skip over the range to find the command.  Let "p" point to after it.
+ *
+ * We need the command to know what kind of range it uses.
+ */
+    cmd = ea.cmd;
+    ea.cmd = skip_range(ea.cmd, NULL);
+    if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
+	ea.cmd = skipwhite(ea.cmd + 1);
+    p = find_command(&ea, NULL);
+
+/*
+ * 4. parse a range specifier of the form: addr [,addr] [;addr] ..
  *
  * where 'addr' is:
  *
@@ -2019,13 +2067,52 @@ do_one_cmd(cmdlinep, sourcing,
  * is equal to the lower.
  */
 
+    if (ea.cmdidx != CMD_SIZE)
+	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
+    else
+	ea.addr_type = ADDR_LINES;
+    ea.cmd = cmd;
+
     /* repeat for all ',' or ';' separated addresses */
     for (;;)
     {
 	ea.line1 = ea.line2;
-	ea.line2 = curwin->w_cursor.lnum;   /* default is current line number */
+	switch (ea.addr_type)
+	{
+	    case ADDR_LINES:
+		/* default is current line number */
+		ea.line2 = curwin->w_cursor.lnum;
+		break;
+	    case ADDR_WINDOWS:
+		lnum = 0;
+		for (wp = firstwin; wp != NULL; wp = wp->w_next)
+		{
+		    lnum++;
+		    if (wp == curwin)
+			break;
+		}
+		ea.line2 = lnum;
+		break;
+	    case ADDR_ARGUMENTS:
+		ea.line2 = curwin->w_arg_idx + 1;
+		break;
+	    case ADDR_LOADED_BUFFERS:
+	    case ADDR_UNLOADED_BUFFERS:
+		ea.line2 = curbuf->b_fnum;
+		break;
+	    case ADDR_TABS:
+		lnum = 0;
+		for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+		{
+		    lnum++;
+		    if (tp == curtab)
+			break;
+		}
+		ea.line2 = lnum;
+		break;
+	}
 	ea.cmd = skipwhite(ea.cmd);
-	lnum = get_address(&ea.cmd, ea.skip, ea.addr_count == 0);
+	lnum = get_address(&ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0);
 	if (ea.cmd == NULL)		    /* error detected */
 	    goto doend;
 	if (lnum == MAXLNUM)
@@ -2033,8 +2120,24 @@ do_one_cmd(cmdlinep, sourcing,
 	    if (*ea.cmd == '%')		    /* '%' - all lines */
 	    {
 		++ea.cmd;
-		ea.line1 = 1;
-		ea.line2 = curbuf->b_ml.ml_line_count;
+		switch (ea.addr_type)
+		{
+		    case ADDR_LINES:
+			ea.line1 = 1;
+			ea.line2 = curbuf->b_ml.ml_line_count;
+			break;
+		    case ADDR_WINDOWS:
+		    case ADDR_LOADED_BUFFERS:
+		    case ADDR_UNLOADED_BUFFERS:
+		    case ADDR_TABS:
+			errormsg = (char_u *)_(e_invrange);
+			goto doend;
+			break;
+		    case ADDR_ARGUMENTS:
+			ea.line1 = 1;
+			ea.line2 = ARGCOUNT;
+			break;
+		}
 		++ea.addr_count;
 	    }
 					    /* '*' - visual area */
@@ -2042,6 +2145,12 @@ do_one_cmd(cmdlinep, sourcing,
 	    {
 		pos_T	    *fp;
 
+		if (ea.addr_type != ADDR_LINES)
+		{
+		    errormsg = (char_u *)_(e_invrange);
+		    goto doend;
+		}
+
 		++ea.cmd;
 		if (!ea.skip)
 		{
@@ -2084,7 +2193,7 @@ do_one_cmd(cmdlinep, sourcing,
     check_cursor_lnum();
 
 /*
- * 4. parse command
+ * 5. Parse the command.
  */
 
     /*
@@ -2098,8 +2207,8 @@ do_one_cmd(cmdlinep, sourcing,
      * If we got a line, but no command, then go to the line.
      * If we find a '|' or '\n' we set ea.nextcmd.
      */
-    if (*ea.cmd == NUL || *ea.cmd == '"' ||
-			       (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
+    if (*ea.cmd == NUL || *ea.cmd == '"'
+			      || (ea.nextcmd = check_nextcmd(ea.cmd)) != NULL)
     {
 	/*
 	 * strange vi behaviour:
@@ -2145,9 +2254,6 @@ do_one_cmd(cmdlinep, sourcing,
 	goto doend;
     }
 
-    /* Find the command and let "p" point to after it. */
-    p = find_command(&ea, NULL);
-
 #ifdef FEAT_AUTOCMD
     /* If this looks like an undefined user command and there are CmdUndefined
      * autocommands defined, trigger the matching autocommands. */
@@ -2229,7 +2335,7 @@ do_one_cmd(cmdlinep, sourcing,
 	ea.forceit = FALSE;
 
 /*
- * 5. parse arguments
+ * 5. Parse arguments.
  */
     if (!IS_USER_CMDIDX(ea.cmdidx))
 	ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
@@ -2676,7 +2782,7 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
 
 /*
- * 6. switch on command name
+ * 6. Switch on command name.
  *
  * The "ea" structure holds the arguments that can be used.
  */
@@ -4082,8 +4188,9 @@ skip_range(cmd, ctx)
  * Return MAXLNUM when no Ex address was found.
  */
     static linenr_T
-get_address(ptr, skip, to_other_file)
+get_address(ptr, addr_type, skip, to_other_file)
     char_u	**ptr;
+    int		addr_type;  /* flag: one of ADDR_LINES, ... */
     int		skip;	    /* only skip the address, don't use it */
     int		to_other_file;  /* flag: may jump to other file */
 {
@@ -4094,6 +4201,8 @@ get_address(ptr, skip, to_other_file)
     pos_T	pos;
     pos_T	*fp;
     linenr_T	lnum;
+    win_T	*wp;
+    tabpage_T	*tp;
 
     cmd = skipwhite(*ptr);
     lnum = MAXLNUM;
@@ -4102,137 +4211,204 @@ get_address(ptr, skip, to_other_file)
 	switch (*cmd)
 	{
 	    case '.':			    /* '.' - Cursor position */
-			++cmd;
+		++cmd;
+		switch (addr_type)
+		{
+		    case ADDR_LINES:
 			lnum = curwin->w_cursor.lnum;
 			break;
+		    case ADDR_WINDOWS:
+			lnum = 0;
+			for (wp = firstwin; wp != NULL; wp = wp->w_next)
+			{
+			    lnum++;
+			    if (wp == curwin)
+				break;
+			}
+			break;
+		    case ADDR_ARGUMENTS:
+			lnum = curwin->w_arg_idx + 1;
+			break;
+		    case ADDR_LOADED_BUFFERS:
+		    case ADDR_UNLOADED_BUFFERS:
+			lnum = curbuf->b_fnum;
+			break;
+		    case ADDR_TABS:
+			lnum = 0;
+			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+			{
+			    lnum++;
+			    if (tp == curtab)
+				break;
+			}
+			break;
+		}
+		break;
 
 	    case '$':			    /* '$' - last line */
-			++cmd;
+		++cmd;
+		switch (addr_type)
+		{
+		    case ADDR_LINES:
 			lnum = curbuf->b_ml.ml_line_count;
 			break;
+		    case ADDR_WINDOWS:
+			lnum = 0;
+			for (wp = firstwin; wp != NULL; wp = wp->w_next)
+			    lnum++;
+			break;
+		    case ADDR_ARGUMENTS:
+			lnum = ARGCOUNT;
+			break;
+		    case ADDR_LOADED_BUFFERS:
+		    case ADDR_UNLOADED_BUFFERS:
+			lnum = lastbuf->b_fnum;
+			break;
+		    case ADDR_TABS:
+			lnum = 0;
+			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+			    lnum++;
+			break;
+		}
+		break;
 
 	    case '\'':			    /* ''' - mark */
-			if (*++cmd == NUL)
+		if (*++cmd == NUL)
+		{
+		    cmd = NULL;
+		    goto error;
+		}
+		if (addr_type != ADDR_LINES)
+		{
+		    EMSG(_(e_invaddr));
+		    goto error;
+		}
+		if (skip)
+		    ++cmd;
+		else
+		{
+		    /* Only accept a mark in another file when it is
+		     * used by itself: ":'M". */
+		    fp = getmark(*cmd, to_other_file && cmd[1] == NUL);
+		    ++cmd;
+		    if (fp == (pos_T *)-1)
+			/* Jumped to another file. */
+			lnum = curwin->w_cursor.lnum;
+		    else
+		    {
+			if (check_mark(fp) == FAIL)
 			{
 			    cmd = NULL;
 			    goto error;
 			}
-			if (skip)
-			    ++cmd;
-			else
-			{
-			    /* Only accept a mark in another file when it is
-			     * used by itself: ":'M". */
-			    fp = getmark(*cmd, to_other_file && cmd[1] == NUL);
-			    ++cmd;
-			    if (fp == (pos_T *)-1)
-				/* Jumped to another file. */
-				lnum = curwin->w_cursor.lnum;
-			    else
-			    {
-				if (check_mark(fp) == FAIL)
-				{
-				    cmd = NULL;
-				    goto error;
-				}
-				lnum = fp->lnum;
-			    }
-			}
-			break;
+			lnum = fp->lnum;
+		    }
+		}
+		break;
 
 	    case '/':
 	    case '?':			/* '/' or '?' - search */
-			c = *cmd++;
-			if (skip)	/* skip "/pat/" */
-			{
-			    cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
-			    if (*cmd == c)
-				++cmd;
-			}
-			else
-			{
-			    pos = curwin->w_cursor; /* save curwin->w_cursor */
-			    /*
-			     * When '/' or '?' follows another address, start
-			     * from there.
-			     */
-			    if (lnum != MAXLNUM)
-				curwin->w_cursor.lnum = lnum;
-			    /*
-			     * Start a forward search at the end of the line.
-			     * Start a backward search at the start of the line.
-			     * This makes sure we never match in the current
-			     * line, and can match anywhere in the
-			     * next/previous line.
-			     */
-			    if (c == '/')
-				curwin->w_cursor.col = MAXCOL;
-			    else
-				curwin->w_cursor.col = 0;
-			    searchcmdlen = 0;
-			    if (!do_search(NULL, c, cmd, 1L,
-					       SEARCH_HIS | SEARCH_MSG, NULL))
-			    {
-				curwin->w_cursor = pos;
-				cmd = NULL;
-				goto error;
-			    }
-			    lnum = curwin->w_cursor.lnum;
-			    curwin->w_cursor = pos;
-			    /* adjust command string pointer */
-			    cmd += searchcmdlen;
-			}
-			break;
+		c = *cmd++;
+		if (addr_type != ADDR_LINES)
+		{
+		    EMSG(_(e_invaddr));
+		    goto error;
+		}
+		if (skip)	/* skip "/pat/" */
+		{
+		    cmd = skip_regexp(cmd, c, (int)p_magic, NULL);
+		    if (*cmd == c)
+			++cmd;
+		}
+		else
+		{
+		    pos = curwin->w_cursor; /* save curwin->w_cursor */
+		    /*
+		     * When '/' or '?' follows another address, start
+		     * from there.
+		     */
+		    if (lnum != MAXLNUM)
+			curwin->w_cursor.lnum = lnum;
+		    /*
+		     * Start a forward search at the end of the line.
+		     * Start a backward search at the start of the line.
+		     * This makes sure we never match in the current
+		     * line, and can match anywhere in the
+		     * next/previous line.
+		     */
+		    if (c == '/')
+			curwin->w_cursor.col = MAXCOL;
+		    else
+			curwin->w_cursor.col = 0;
+		    searchcmdlen = 0;
+		    if (!do_search(NULL, c, cmd, 1L,
+				       SEARCH_HIS | SEARCH_MSG, NULL))
+		    {
+			curwin->w_cursor = pos;
+			cmd = NULL;
+			goto error;
+		    }
+		    lnum = curwin->w_cursor.lnum;
+		    curwin->w_cursor = pos;
+		    /* adjust command string pointer */
+		    cmd += searchcmdlen;
+		}
+		break;
 
 	    case '\\':		    /* "\?", "\/" or "\&", repeat search */
-			++cmd;
-			if (*cmd == '&')
-			    i = RE_SUBST;
-			else if (*cmd == '?' || *cmd == '/')
-			    i = RE_SEARCH;
-			else
-			{
-			    EMSG(_(e_backslash));
-			    cmd = NULL;
-			    goto error;
-			}
+		++cmd;
+		if (addr_type != ADDR_LINES)
+		{
+		    EMSG(_(e_invaddr));
+		    goto error;
+		}
+		if (*cmd == '&')
+		    i = RE_SUBST;
+		else if (*cmd == '?' || *cmd == '/')
+		    i = RE_SEARCH;
+		else
+		{
+		    EMSG(_(e_backslash));
+		    cmd = NULL;
+		    goto error;
+		}
 
-			if (!skip)
-			{
-			    /*
-			     * When search follows another address, start from
-			     * there.
-			     */
-			    if (lnum != MAXLNUM)
-				pos.lnum = lnum;
-			    else
-				pos.lnum = curwin->w_cursor.lnum;
-
-			    /*
-			     * Start the search just like for the above
-			     * do_search().
-			     */
-			    if (*cmd != '?')
-				pos.col = MAXCOL;
-			    else
-				pos.col = 0;
-			    if (searchit(curwin, curbuf, &pos,
-					*cmd == '?' ? BACKWARD : FORWARD,
-					(char_u *)"", 1L, SEARCH_MSG,
-						i, (linenr_T)0, NULL) != FAIL)
-				lnum = pos.lnum;
-			    else
-			    {
-				cmd = NULL;
-				goto error;
-			    }
-			}
-			++cmd;
-			break;
+		if (!skip)
+		{
+		    /*
+		     * When search follows another address, start from
+		     * there.
+		     */
+		    if (lnum != MAXLNUM)
+			pos.lnum = lnum;
+		    else
+			pos.lnum = curwin->w_cursor.lnum;
+
+		    /*
+		     * Start the search just like for the above
+		     * do_search().
+		     */
+		    if (*cmd != '?')
+			pos.col = MAXCOL;
+		    else
+			pos.col = 0;
+		    if (searchit(curwin, curbuf, &pos,
+				*cmd == '?' ? BACKWARD : FORWARD,
+				(char_u *)"", 1L, SEARCH_MSG,
+					i, (linenr_T)0, NULL) != FAIL)
+			lnum = pos.lnum;
+		    else
+		    {
+			cmd = NULL;
+			goto error;
+		    }
+		}
+		++cmd;
+		break;
 
 	    default:
-			if (VIM_ISDIGIT(*cmd))	/* absolute line number */
-			    lnum = getdigits(&cmd);
+		if (VIM_ISDIGIT(*cmd))	/* absolute line number */
+		    lnum = getdigits(&cmd);
 	}
 
 	for (;;)
@@ -4242,7 +4418,40 @@ get_address(ptr, skip, to_other_file)
 		break;
 
 	    if (lnum == MAXLNUM)
-		lnum = curwin->w_cursor.lnum;	/* "+1" is same as ".+1" */
+	    {
+		switch (addr_type)
+		{
+		    case ADDR_LINES:
+			lnum = curwin->w_cursor.lnum;	/* "+1" is same as ".+1" */
+			break;
+		    case ADDR_WINDOWS:
+			lnum = 0;
+			for (wp = firstwin; wp != NULL; wp = wp->w_next)
+			{
+			    lnum++;
+			    if (wp == curwin)
+				break;
+			}
+			break;
+		    case ADDR_ARGUMENTS:
+			lnum = curwin->w_arg_idx + 1;
+			break;
+		    case ADDR_LOADED_BUFFERS:
+		    case ADDR_UNLOADED_BUFFERS:
+			lnum = curbuf->b_fnum;
+			break;
+		    case ADDR_TABS:
+			lnum = 0;
+			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+			{
+			    lnum++;
+			    if (tp == curtab)
+				break;
+			}
+			break;
+		}
+	    }
+
 	    if (VIM_ISDIGIT(*cmd))
 		i = '+';		/* "number" is same as "+number" */
 	    else
@@ -4251,10 +4460,59 @@ get_address(ptr, skip, to_other_file)
 		n = 1;
 	    else
 		n = getdigits(&cmd);
-	    if (i == '-')
+	    if (addr_type == ADDR_LOADED_BUFFERS
+		    || addr_type == ADDR_UNLOADED_BUFFERS)
+		lnum = compute_buffer_local_count(addr_type, lnum, n);
+	    else if (i == '-')
 		lnum -= n;
 	    else
 		lnum += n;
+
+	    switch (addr_type)
+	    {
+		case ADDR_LINES:
+		    break;
+		case ADDR_ARGUMENTS:
+		    if (lnum < 0)
+			lnum = 0;
+		    else if (lnum >= ARGCOUNT)
+			lnum = ARGCOUNT;
+		    break;
+		case ADDR_TABS:
+		    if (lnum < 0)
+		    {
+			lnum = 0;
+			break;
+		    }
+		    c = 0;
+		    for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+			c++;
+		    if (lnum >= c)
+			lnum = c;
+		    break;
+		case ADDR_WINDOWS:
+		    if (lnum < 0)
+		    {
+			lnum = 0;
+			break;
+		    }
+		    c = 0;
+		    for (wp = firstwin; wp != NULL; wp = wp->w_next)
+			c++;
+		    if (lnum > c)
+			lnum = c;
+		    break;
+		case ADDR_LOADED_BUFFERS:
+		case ADDR_UNLOADED_BUFFERS:
+		    if (lnum < firstbuf->b_fnum)
+		    {
+			lnum = firstbuf->b_fnum;
+			break;
+		    }
+		    if (lnum > lastbuf->b_fnum)
+			lnum = lastbuf->b_fnum;
+		    break;
+	    }
 	}
     } while (*cmd == '/' || *cmd == '?');
 
@@ -6556,6 +6814,10 @@ not_exiting()
 ex_quit(eap)
     exarg_T	*eap;
 {
+    win_T	*wp;
+    buf_T	*buf;
+    int		wnr;
+
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
     {
@@ -6569,11 +6831,28 @@ ex_quit(eap)
 	text_locked_msg();
 	return;
     }
+    if (eap->addr_count > 0)
+    {
+	wnr = eap->line2;
+	for (wp = firstwin; --wnr > 0; )
+	{
+	    if (wp->w_next == NULL)
+		break;
+	    else
+		wp = wp->w_next;
+	}
+	buf = wp->w_buffer;
+    }
+    else
+    {
+	wp = curwin;
+	buf = curbuf;
+    }
 #ifdef FEAT_AUTOCMD
     apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
     /* Refuse to quit when locked or when the buffer in the last window is
      * being closed (can only happen in autocommands). */
-    if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
+    if (curbuf_locked() || (buf->b_nwindows == 1 && buf->b_closing))
 	return;
 #endif
 
@@ -6606,7 +6885,7 @@ ex_quit(eap)
 	need_mouse_correct = TRUE;
 # endif
 	/* close window; may free buffer */
-	win_close(curwin, !P_HID(curwin->w_buffer) || eap->forceit);
+	win_close(wp, !P_HID(wp->w_buffer) || eap->forceit);
 #endif
     }
 }
@@ -6668,6 +6947,8 @@ ex_quit_all(eap)
 ex_close(eap)
     exarg_T	*eap;
 {
+    win_T	*win;
+    int		winnr = 0;
 # ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
 	cmdwin_result = Ctrl_C;
@@ -6678,7 +6959,21 @@ ex_close(eap)
 		&& !curbuf_locked()
 #endif
 		)
-	    ex_win_close(eap->forceit, curwin, NULL);
+	{
+	    if (eap->addr_count == 0)
+		ex_win_close(eap->forceit, curwin, NULL);
+	    else {
+		for (win = firstwin; win != NULL; win = win->w_next)
+		{
+		    winnr++;
+		    if (winnr == eap->line2)
+			break;
+		}
+		if (win == NULL)
+		    win = lastwin;
+		ex_win_close(eap->forceit, win, NULL);
+	    }
+	}
 }
 
 # ifdef FEAT_QUICKFIX
@@ -6804,6 +7099,8 @@ ex_tabonly(eap)
 	    MSG(_("Already only one tab page"));
 	else
 	{
+	    if (eap->addr_count > 0)
+		goto_tabpage(eap->line2);
 	    /* Repeat this up to a 1000 times, because autocommands may mess
 	     * up the lists. */
 	    for (done = 0; done < 1000; ++done)
@@ -6882,9 +7179,23 @@ tabpage_close_other(tp, forceit)
 ex_only(eap)
     exarg_T	*eap;
 {
+    win_T   *wp;
+    int	    wnr;
 # ifdef FEAT_GUI
     need_mouse_correct = TRUE;
 # endif
+    if (eap->addr_count > 0)
+    {
+	wnr = eap->line2;
+	for (wp = firstwin; --wnr > 0; )
+	{
+	    if (wp->w_next == NULL)
+		break;
+	    else
+		wp = wp->w_next;
+	}
+	win_goto(wp);
+    }
     close_others(TRUE, eap->forceit);
 }
 
@@ -6906,6 +7217,9 @@ ex_all(eap)
 ex_hide(eap)
     exarg_T	*eap;
 {
+    win_T	*win;
+    int		winnr = 0;
+
     if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
 	eap->errmsg = e_invarg;
     else
@@ -6918,7 +7232,19 @@ ex_hide(eap)
 # ifdef FEAT_GUI
 	    need_mouse_correct = TRUE;
 # endif
-	    win_close(curwin, FALSE);	/* don't free buffer */
+	    if (eap->addr_count == 0)
+		win_close(curwin, FALSE);	/* don't free buffer */
+	    else {
+		for (win = firstwin; win != NULL; win = win->w_next)
+		{
+		    winnr++;
+		    if (winnr == eap->line2)
+			break;
+		}
+		if (win == NULL)
+		    win = lastwin;
+		win_close(win, FALSE);
+	    }
 	}
 #endif
     }
@@ -8652,7 +8978,7 @@ ex_copymove(eap)
 {
     long	n;
 
-    n = get_address(&eap->arg, FALSE, FALSE);
+    n = get_address(&eap->arg, eap->addr_type, FALSE, FALSE);
     if (eap->arg == NULL)	    /* error detected */
     {
 	eap->nextcmd = NULL;
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 58316fc7f2..a2e5db3b87 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -36,9 +36,11 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test97.out test98.out \
 		test99.out test100.out test101.out test102.out test103.out \
 		test104.out test105.out test106.out test107.out \
+		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_changelist.out \
+		test_close_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
@@ -171,9 +173,11 @@ test104.out: test104.in
 test105.out: test105.in
 test106.out: test106.in
 test107.out: test107.in
+test_argument_count.out: test_argument_count.in
 test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
 test_changelist.out: test_changelist.in
+test_close_count.out: test_close_count.in
 test_eval.out: test_eval.in
 test_insertcount.out: test_insertcount.in
 test_listlbr.out: test_listlbr.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 7fd2763605..d2e070ba0c 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -35,9 +35,11 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out  test107.out\
+		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_changelist.out \
+		test_close_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index d2995a50b6..4a99cb915d 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -57,9 +57,11 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
+		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_changelist.out \
+		test_close_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 3b6b4071d5..7a2571b499 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -37,9 +37,11 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
+		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_changelist.out \
+		test_close_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index e105376baf..93aa874019 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Aug 16
+# Last change:  2014 Nov 27
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -45,7 +45,7 @@
 # It fails because VMS does not support this feature yet.
 # WANT_MZSCH = YES
 
-# Comment out if you have ODS-5 file system                                                                                                                 
+# Comment out if you have ODS-5 file system
 # HAVE_ODS5 = YES
 
 # Comment out if you have gzip on your system
@@ -54,10 +54,10 @@
 # Comment out if you have GNU compatible diff on your system
 # HAVE_GDIFF = YES
 
-# Comment out if you have GNU compatible cksum on your system                                                                                                  
+# Comment out if you have GNU compatible cksum on your system
 # HAVE_CKSUM = YES
 
-# Comment out if you have ICONV support                                                                                                  
+# Comment out if you have ICONV support
 # HAVE_ICONV = YES
 
 # Comment out if you have LUA support
@@ -96,9 +96,11 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test95.out test96.out test98.out test99.out \
 	 test100.out test101.out test103.out test104.out \
 	 test105.out test106.out test107.out \
+	 test_argument_count.out \
 	 test_autoformat_join.out \
 	 test_breakindent.out \
 	 test_changelist.out \
+	 test_close_count.out \
 	 test_eval.out \
 	 test_insertcount.out \
 	 test_listlbr.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 1f5095e55b..aa0ef1ff1f 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -33,9 +33,11 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test97.out test98.out \
 		test99.out test100.out test101.out test102.out test103.out \
 		test104.out test105.out test106.out test107.out \
+		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
 		test_changelist.out \
+		test_close_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/version.c b/src/version.c
index 2496defc2a..d94dc3ca89 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    530,
 /**/
     529,
 /**/
diff --git a/src/window.c b/src/window.c
index 6490fd3868..92fcbbe710 100644
--- a/src/window.c
+++ b/src/window.c
@@ -199,14 +199,22 @@ do_window(nchar, Prenum, xchar)
     case Ctrl_Q:
     case 'q':
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		do_cmdline_cmd((char_u *)"quit");
+		STRCPY(cbuf, "quit");
+		if (Prenum)
+		    vim_snprintf((char *)cbuf + 4, sizeof(cbuf) - 5,
+							    "%ld", Prenum);
+		do_cmdline_cmd(cbuf);
 		break;
 
 /* close current window */
     case Ctrl_C:
     case 'c':
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		do_cmdline_cmd((char_u *)"close");
+		STRCPY(cbuf, "close");
+		if (Prenum)
+		    vim_snprintf((char *)cbuf + 5, sizeof(cbuf) - 5,
+							       "%ld", Prenum);
+		do_cmdline_cmd(cbuf);
 		break;
 
 #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
@@ -235,7 +243,11 @@ do_window(nchar, Prenum, xchar)
     case 'o':
 		CHECK_CMDWIN
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		do_cmdline_cmd((char_u *)"only");
+		STRCPY(cbuf, "only");
+		if (Prenum > 0)
+		    vim_snprintf((char *)cbuf + 4, sizeof(cbuf) - 4,
+								"%ld", Prenum);
+		do_cmdline_cmd(cbuf);
 		break;
 
 /* cursor to next window with wrap around */

From 455a23109414fd287234facb5b6343ba2e7ee9ba Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 16:22:48 +0100
Subject: [PATCH 308/473] Added tag v7-4-530 for changeset 5a76e36f07b1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f1c54debb9..b48a926e08 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3252,3 +3252,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 2bb019eb60ca1d16e62e95bef16475756965022f v7-4-527
 5f49ac8426dfddcc6725fae872b642976e468c8a v7-4-528
 72d5a533ec87c13e87e80273a1817b5ba19d313b v7-4-529
+5a76e36f07b160b44b4f4e637decbc914a243e6c v7-4-530

From 8bdee2e616e22dabe4965257eadb156d186b72b7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 16:38:11 +0100
Subject: [PATCH 309/473] updated for version 7.4.531 Problem:    Comments
 about parsing an Ex command are wrong. Solution:   Correct the steop numbers.

---
 src/ex_docmd.c | 19 ++++++++-----------
 src/version.c  |  2 ++
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 7b25cdb8fe..a0030281a4 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1721,8 +1721,9 @@ compute_buffer_local_count(addr_type, lnum, offset)
  *
  * 1. skip comment lines and leading space
  * 2. handle command modifiers
- * 3. parse command
+ * 3. find the command
  * 4. parse range
+ * 5. Parse the command.
  * 6. parse arguments
  * 7. switch on command name
  *
@@ -2335,7 +2336,7 @@ do_one_cmd(cmdlinep, sourcing,
 	ea.forceit = FALSE;
 
 /*
- * 5. Parse arguments.
+ * 6. Parse arguments.
  */
     if (!IS_USER_CMDIDX(ea.cmdidx))
 	ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
@@ -2782,7 +2783,7 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
 
 /*
- * 6. Switch on command name.
+ * 7. Switch on command name.
  *
  * The "ea" structure holds the arguments that can be used.
  */
@@ -3319,7 +3320,7 @@ set_one_cmd_context(xp, buff)
     ea.argt = 0;
 
 /*
- * 2. skip comment lines and leading space, colons or bars
+ * 1. skip comment lines and leading space, colons or bars
  */
     for (cmd = buff; vim_strchr((char_u *)" \t:|", *cmd) != NULL; cmd++)
 	;
@@ -3334,13 +3335,9 @@ set_one_cmd_context(xp, buff)
     }
 
 /*
- * 3. parse a range specifier of the form: addr [,addr] [;addr] ..
+ * 3. Skip over the range to find the command.
  */
     cmd = skip_range(cmd, &xp->xp_context);
-
-/*
- * 4. parse command
- */
     xp->xp_pattern = cmd;
     if (*cmd == NUL)
 	return NULL;
@@ -3446,7 +3443,7 @@ set_one_cmd_context(xp, buff)
     }
 
 /*
- * 5. parse arguments
+ * 6. parse arguments
  */
     if (!IS_USER_CMDIDX(ea.cmdidx))
 	ea.argt = (long)cmdnames[(int)ea.cmdidx].cmd_argt;
@@ -3682,7 +3679,7 @@ set_one_cmd_context(xp, buff)
     }
 
 /*
- * 6. switch on command name
+ * 6. Switch on command name.
  */
     switch (ea.cmdidx)
     {
diff --git a/src/version.c b/src/version.c
index d94dc3ca89..38acd5da2d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    531,
 /**/
     530,
 /**/

From eac1907ff1559146cc5a32c756c2e673feb06dca Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 16:38:11 +0100
Subject: [PATCH 310/473] Added tag v7-4-531 for changeset 2c0cddd0df8c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b48a926e08..35e86dcfa3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3253,3 +3253,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 5f49ac8426dfddcc6725fae872b642976e468c8a v7-4-528
 72d5a533ec87c13e87e80273a1817b5ba19d313b v7-4-529
 5a76e36f07b160b44b4f4e637decbc914a243e6c v7-4-530
+2c0cddd0df8c8ca0c08027e7866f697ffd20d6fb v7-4-531

From c70fe394063c56cf8db8dc2b985d29fcea13fd88 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:29:56 +0100
Subject: [PATCH 311/473] updated for version 7.4.532 Problem:    When using
 'incsearch' "2/pattern/e" highlights the first match. Solution:   Move the
 code to set extra_col inside the loop for count.  (Ozaki 	    Kiichi)

---
 src/search.c  | 46 ++++++++++++++++++++++++----------------------
 src/version.c |  2 ++
 2 files changed, 26 insertions(+), 22 deletions(-)

diff --git a/src/search.c b/src/search.c
index 283e77867e..047a733972 100644
--- a/src/search.c
+++ b/src/search.c
@@ -552,6 +552,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
     int		match_ok;
     long	nmatched;
     int		submatch = 0;
+    int		first_match = TRUE;
     int		save_called_emsg = called_emsg;
 #ifdef FEAT_SEARCH_EXTRA
     int		break_loop = FALSE;
@@ -565,33 +566,33 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
 	return FAIL;
     }
 
-    /* When not accepting a match at the start position set "extra_col" to a
-     * non-zero value.  Don't do that when starting at MAXCOL, since MAXCOL +
-     * 1 is zero. */
-    if ((options & SEARCH_START) || pos->col == MAXCOL)
-	extra_col = 0;
-#ifdef FEAT_MBYTE
-    /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
-    else if (dir != BACKWARD && has_mbyte
-		    && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
-						     && pos->col < MAXCOL - 2)
-    {
-	ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
-	if (*ptr == NUL)
-	    extra_col = 1;
-	else
-	    extra_col = (*mb_ptr2len)(ptr);
-    }
-#endif
-    else
-	extra_col = 1;
-
     /*
      * find the string
      */
     called_emsg = FALSE;
     do	/* loop for count */
     {
+	/* When not accepting a match at the start position set "extra_col" to
+	 * a non-zero value.  Don't do that when starting at MAXCOL, since
+	 * MAXCOL + 1 is zero. */
+	if ((options & SEARCH_START) || pos->col == MAXCOL)
+	    extra_col = 0;
+#ifdef FEAT_MBYTE
+	/* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
+	else if (dir != BACKWARD && has_mbyte
+		     && pos->lnum >= 1 && pos->lnum <= buf->b_ml.ml_line_count
+						     && pos->col < MAXCOL - 2)
+	{
+	    ptr = ml_get_buf(buf, pos->lnum, FALSE) + pos->col;
+	    if (*ptr == NUL)
+		extra_col = 1;
+	    else
+		extra_col = (*mb_ptr2len)(ptr);
+	}
+#endif
+	else
+	    extra_col = 1;
+
 	start_pos = *pos;	/* remember start pos for detecting no match */
 	found = 0;		/* default: not found */
 	at_first_line = TRUE;	/* default: start in first line */
@@ -677,7 +678,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
 			 * otherwise "/$" will get stuck on end of line.
 			 */
 			while (matchpos.lnum == 0
-				&& ((options & SEARCH_END)
+				&& ((options & SEARCH_END) && first_match
 				    ?  (nmatched == 1
 					&& (int)endpos.col - 1
 					     < (int)start_pos.col + extra_col)
@@ -908,6 +909,7 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, stop_lnum, tm)
 		    pos->coladd = 0;
 #endif
 		    found = 1;
+		    first_match = FALSE;
 
 		    /* Set variables used for 'incsearch' highlighting. */
 		    search_match_lines = endpos.lnum - matchpos.lnum;
diff --git a/src/version.c b/src/version.c
index 38acd5da2d..fd7c414692 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    532,
 /**/
     531,
 /**/

From 3e6f84d5093d78199cb1179cc14d4f8af8f0d57a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:29:56 +0100
Subject: [PATCH 312/473] Added tag v7-4-532 for changeset 7f48abe500e1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 35e86dcfa3..b8e43d5fc3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3254,3 +3254,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 72d5a533ec87c13e87e80273a1817b5ba19d313b v7-4-529
 5a76e36f07b160b44b4f4e637decbc914a243e6c v7-4-530
 2c0cddd0df8c8ca0c08027e7866f697ffd20d6fb v7-4-531
+7f48abe500e13554d14f5efae736da871a89ebae v7-4-532

From 85a94fc8cbfe0ff3bb5ecae4e477c31bcddf56a0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:37:57 +0100
Subject: [PATCH 313/473] updated for version 7.4.533 Problem:    ":hardcopy"
 leaks memory in case of errors. Solution:   Free memory in all code paths.
 (Christian Brabandt)

---
 src/hardcopy.c | 34 +++++++++++++++++-----------------
 src/version.c  |  2 ++
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/src/hardcopy.c b/src/hardcopy.c
index 1df2fda72a..1e795e6b57 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -2960,12 +2960,12 @@ mch_print_begin(psettings)
     if (!prt_find_resource("prolog", res_prolog))
     {
 	EMSG(_("E456: Can't find PostScript resource file \"prolog.ps\""));
-	return FALSE;
+	goto theend;
     }
     if (!prt_open_resource(res_prolog))
-	return FALSE;
+	goto theend;
     if (!prt_check_resource(res_prolog, PRT_PROLOG_VERSION))
-	return FALSE;
+	goto theend;
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
@@ -2973,12 +2973,12 @@ mch_print_begin(psettings)
 	if (!prt_find_resource("cidfont", res_cidfont))
 	{
 	    EMSG(_("E456: Can't find PostScript resource file \"cidfont.ps\""));
-	    return FALSE;
+	    goto theend;
 	}
 	if (!prt_open_resource(res_cidfont))
-	    return FALSE;
+	    goto theend;
 	if (!prt_check_resource(res_cidfont, PRT_CID_PROLOG_VERSION))
-	    return FALSE;
+	    goto theend;
     }
 #endif
 
@@ -3012,12 +3012,12 @@ mch_print_begin(psettings)
 		{
 		    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
 			    p_encoding);
-		    return FALSE;
+		    goto theend;
 		}
 	    }
 	}
 	if (!prt_open_resource(res_encoding))
-	    return FALSE;
+	    goto theend;
 	/* For the moment there are no checks on encoding resource files to
 	 * perform */
 #ifdef FEAT_MBYTE
@@ -3034,10 +3034,10 @@ mch_print_begin(psettings)
 	    {
 		EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
 							  prt_ascii_encoding);
-		return FALSE;
+		goto theend;
 	    }
 	    if (!prt_open_resource(res_encoding))
-		return FALSE;
+		goto theend;
 	    /* For the moment there are no checks on encoding resource files to
 	     * perform */
 	}
@@ -3050,7 +3050,7 @@ mch_print_begin(psettings)
 	{
 	    EMSG2(_("E620: Unable to convert to print encoding \"%s\""),
 		    p_encoding);
-	    return FALSE;
+	    goto theend;
 	}
 	prt_do_conv = TRUE;
     }
@@ -3063,10 +3063,10 @@ mch_print_begin(psettings)
 	{
 	    EMSG2(_("E456: Can't find PostScript resource file \"%s.ps\""),
 								    prt_cmap);
-	    return FALSE;
+	    goto theend;
 	}
 	if (!prt_open_resource(res_cmap))
-	    return FALSE;
+	    goto theend;
     }
 #endif
 
@@ -3140,15 +3140,15 @@ mch_print_begin(psettings)
 
     /* Add required procsets - NOTE: order is important! */
     if (!prt_add_resource(res_prolog))
-	return FALSE;
+	goto theend;
 #ifdef FEAT_MBYTE
     if (prt_out_mbyte)
     {
 	/* Add CID font procset, and any user supplied CMap */
 	if (!prt_add_resource(res_cidfont))
-	    return FALSE;
+	    goto theend;
 	if (prt_custom_cmap && !prt_add_resource(res_cmap))
-	    return FALSE;
+	    goto theend;
     }
 #endif
 
@@ -3158,7 +3158,7 @@ mch_print_begin(psettings)
 	/* There will be only one Roman font encoding to be included in the PS
 	 * file. */
 	if (!prt_add_resource(res_encoding))
-	    return FALSE;
+	    goto theend;
 
     prt_dsc_noarg("EndProlog");
 
diff --git a/src/version.c b/src/version.c
index fd7c414692..f9c2804ea4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    533,
 /**/
     532,
 /**/

From 1b1ffddce5f40e78f01fa1183147dde2fcb983f9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:37:58 +0100
Subject: [PATCH 314/473] Added tag v7-4-533 for changeset 18953e121be6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index b8e43d5fc3..0c428e7697 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3255,3 +3255,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 5a76e36f07b160b44b4f4e637decbc914a243e6c v7-4-530
 2c0cddd0df8c8ca0c08027e7866f697ffd20d6fb v7-4-531
 7f48abe500e13554d14f5efae736da871a89ebae v7-4-532
+18953e121be6993e8e87a7d6fd49321ecfc2dcab v7-4-533

From c9fa66bdb238e410a4e00c295fd91c35cb2a7dec Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:44:08 +0100
Subject: [PATCH 315/473] updated for version 7.4.534 Problem:    Warnings when
 compiling if_ruby.c. Solution:   Avoid the warnings. (Ken Takata)

---
 src/if_ruby.c | 11 ++++++-----
 src/version.c |  2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/if_ruby.c b/src/if_ruby.c
index 9301b72927..eb6141fbc3 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -96,11 +96,11 @@
 # define rb_num2int rb_num2int_stub
 #endif
 
-# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
 /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
  * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
-#  define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
-# endif
+# define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
+#endif
 
 #include <ruby.h>
 #ifdef RUBY19_OR_LATER
@@ -422,7 +422,7 @@ VALUE rb_num2ulong(VALUE x)
 # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
 {
-    return dll_rb_gc_writebarrier_unprotect_promoted(obj);
+    dll_rb_gc_writebarrier_unprotect_promoted(obj);
 }
 # endif
 
@@ -763,7 +763,8 @@ static int ensure_ruby_initialized(void)
 	    /* suggested by Ariya Mizutani */
 	    int argc = 1;
 	    char *argv[] = {"gvim.exe"};
-	    NtInitialize(&argc, &argv);
+	    char **argvp = argv;
+	    NtInitialize(&argc, &argvp);
 #endif
 	    {
 #if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK)
diff --git a/src/version.c b/src/version.c
index f9c2804ea4..5162178c05 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    534,
 /**/
     533,
 /**/

From 6d22de3c2899c2808543ae42d53d489a3ee271f0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:44:09 +0100
Subject: [PATCH 316/473] Added tag v7-4-534 for changeset ee28ddfc7b7c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0c428e7697..df8cb4ac8c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3256,3 +3256,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 2c0cddd0df8c8ca0c08027e7866f697ffd20d6fb v7-4-531
 7f48abe500e13554d14f5efae736da871a89ebae v7-4-532
 18953e121be6993e8e87a7d6fd49321ecfc2dcab v7-4-533
+ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534

From 3f502972fc212dd591f5f09389ff3cea0406a8e3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 17:46:22 +0100
Subject: [PATCH 317/473] Add files added by patch 7.4.530 to the repository.

---
 src/testdir/test_argument_count.in |  47 +++++++++
 src/testdir/test_argument_count.ok |  13 +++
 src/testdir/test_close_count.in    | 156 +++++++++++++++++++++++++++++
 src/testdir/test_close_count.ok    |  23 +++++
 4 files changed, 239 insertions(+)
 create mode 100644 src/testdir/test_argument_count.in
 create mode 100644 src/testdir/test_argument_count.ok
 create mode 100644 src/testdir/test_close_count.in
 create mode 100644 src/testdir/test_close_count.ok

diff --git a/src/testdir/test_argument_count.in b/src/testdir/test_argument_count.in
new file mode 100644
index 0000000000..f45e52a3e6
--- /dev/null
+++ b/src/testdir/test_argument_count.in
@@ -0,0 +1,47 @@
+Tests for :[count]argument! and :[count]argdelete     vim: set ft=vim :
+
+STARTTEST
+:%argd
+:argadd a b c d
+:set hidden
+:let buffers = []
+:augroup TEST
+:au BufEnter * call add(buffers, expand('%:t'))
+:augroup END
+:$argu
+:$-argu
+:-argu
+:1argu
+:+2argu
+:augroup TEST
+:au!
+:augroup END
+:let arglists = []
+:.argd
+:call add(arglists, argv())
+:-argd
+:call add(arglists, argv())
+:$argd
+:call add(arglists, argv())
+:1arga c
+:1arga b
+:$argu
+:+arga d
+:$arga x
+:call add(arglists, argv())
+:$-10arga Y
+:call add(arglists, argv())
+:%argd
+:call add(arglists, argv())
+:arga a b c d e f
+:2,$-argd
+:call add(arglists, argv())
+:e! test.out
+:call append(0, buffers)
+:let lnr = line('$')
+:call append(lnr, map(copy(arglists), 'join(v:val, " ")'))
+:w
+:qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_argument_count.ok b/src/testdir/test_argument_count.ok
new file mode 100644
index 0000000000..f591bf2614
--- /dev/null
+++ b/src/testdir/test_argument_count.ok
@@ -0,0 +1,13 @@
+d
+c
+b
+a
+c
+
+a b d
+a d
+a
+a b c d x
+Y a b c d x
+
+a f
diff --git a/src/testdir/test_close_count.in b/src/testdir/test_close_count.in
new file mode 100644
index 0000000000..288945c696
--- /dev/null
+++ b/src/testdir/test_close_count.in
@@ -0,0 +1,156 @@
+Tests for :[count]close! and :[count]hide     vim: set ft=vim :
+
+STARTTEST
+:let tests = []
+:so tiny.vim
+:for i in range(5)
+:new
+:endfor
+:4wincmd w
+:close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:$close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:2close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:new
+:new
+:2wincmd w
+:-2close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:2wincmd w
+:+1close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(0, map(copy(tests), 'join(v:val, " ")'))
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:so tiny.vim
+:for i in range(5)
+:new
+:endfor
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:4wincmd w
+:.hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:9hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:2hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:new
+:new
+:3wincmd w
+:-hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:2wincmd w
+:+hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+Go
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:so tiny.vim
+:set hidden
+:for i in range(5)
+:new
+:endfor
+:1wincmd w
+:$ hide
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:$-1 close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+:.+close!
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+Go
+:w
+:only!
+:b1
+ENDTEST
+
+STARTTEST
+:let tests = []
+:so tiny.vim
+:set hidden
+:for i in range(5)
+:new
+:endfor
+:4wincmd w
+c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+1c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+9c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:1wincmd w
+2c
+:let buffers = []
+:windo call add(buffers, bufnr('%'))
+:call add(tests, buffers)
+:only!
+:e! test.out
+:call append(line('$'), map(copy(tests), 'join(v:val, " ")'))
+:w
+:qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_close_count.ok b/src/testdir/test_close_count.ok
new file mode 100644
index 0000000000..1cee870487
--- /dev/null
+++ b/src/testdir/test_close_count.ok
@@ -0,0 +1,23 @@
+6 5 4 2 1
+5 4 2 1
+5 4 2
+5 2
+7 5 2
+7 5
+
+13 12 11 10 9 1
+13 12 11 9 1
+12 11 9 1
+12 11 9
+12 9
+15 12 9
+15 12
+
+20 19 18 17 16
+20 19 18 16
+20 18 16
+
+25 24 23 21 1
+24 23 21 1
+24 23 21
+24 21

From 9704dce797cb6c2177390b40cff895b69a052704 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 18:33:02 +0100
Subject: [PATCH 318/473] updated for version 7.4.535 Problem:    Can't build
 with tiny features. Solution:   Add #ifdefs and skip a test.

---
 src/ex_docmd.c                     | 156 ++++++++++++++---------------
 src/testdir/test_argument_count.in |   1 +
 src/version.c                      |   2 +
 3 files changed, 81 insertions(+), 78 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index a0030281a4..4ce9e926ab 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1713,6 +1713,53 @@ compute_buffer_local_count(addr_type, lnum, offset)
     return buf->b_fnum;
 }
 
+#ifdef FEAT_WINDOWS
+static int current_win_nr __ARGS((win_T *win));
+static int current_tab_nr __ARGS((tabpage_T *tab));
+
+    static int
+current_win_nr(win)
+    win_T	*win;
+{
+    win_T	*wp;
+    int		nr = 0;
+
+    for (wp = firstwin; wp != NULL; wp = wp->w_next)
+    {
+	++nr;
+	if (wp == win)
+	    break;
+    }
+    return nr;
+}
+
+    static int
+current_tab_nr(tab)
+    tabpage_T   *tab;
+{
+    tabpage_T	*tp;
+    int		nr = 0;
+
+    for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
+    {
+	++nr;
+	if (tp == tab)
+	    break;
+    }
+    return nr;
+}
+
+# define CURRENT_WIN_NR current_win_nr(curwin)
+# define LAST_WIN_NR current_win_nr(NULL)
+# define CURRENT_TAB_NR current_tab_nr(curtab)
+# define LAST_TAB_NR current_tab_nr(NULL)
+#else
+# define CURRENT_WIN_NR 1
+# define LAST_WIN_NR 1
+# define CURRENT_TAB_NR 1
+# define LAST_TAB_NR 1
+#endif
+
 
 /*
  * Execute one Ex command.
@@ -1765,8 +1812,6 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
     cmdmod_T		save_cmdmod;
     int			ni;			/* set when Not Implemented */
-    win_T		*wp;
-    tabpage_T		*tp;
     char_u		*cmd;
 
     vim_memset(&ea, 0, sizeof(ea));
@@ -2085,13 +2130,7 @@ do_one_cmd(cmdlinep, sourcing,
 		ea.line2 = curwin->w_cursor.lnum;
 		break;
 	    case ADDR_WINDOWS:
-		lnum = 0;
-		for (wp = firstwin; wp != NULL; wp = wp->w_next)
-		{
-		    lnum++;
-		    if (wp == curwin)
-			break;
-		}
+		lnum = CURRENT_WIN_NR;
 		ea.line2 = lnum;
 		break;
 	    case ADDR_ARGUMENTS:
@@ -2102,13 +2141,7 @@ do_one_cmd(cmdlinep, sourcing,
 		ea.line2 = curbuf->b_fnum;
 		break;
 	    case ADDR_TABS:
-		lnum = 0;
-		for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-		{
-		    lnum++;
-		    if (tp == curtab)
-			break;
-		}
+		lnum = CURRENT_TAB_NR;
 		ea.line2 = lnum;
 		break;
 	}
@@ -4198,8 +4231,6 @@ get_address(ptr, addr_type, skip, to_other_file)
     pos_T	pos;
     pos_T	*fp;
     linenr_T	lnum;
-    win_T	*wp;
-    tabpage_T	*tp;
 
     cmd = skipwhite(*ptr);
     lnum = MAXLNUM;
@@ -4215,13 +4246,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curwin->w_cursor.lnum;
 			break;
 		    case ADDR_WINDOWS:
-			lnum = 0;
-			for (wp = firstwin; wp != NULL; wp = wp->w_next)
-			{
-			    lnum++;
-			    if (wp == curwin)
-				break;
-			}
+			lnum = CURRENT_WIN_NR;
 			break;
 		    case ADDR_ARGUMENTS:
 			lnum = curwin->w_arg_idx + 1;
@@ -4231,13 +4256,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
-			lnum = 0;
-			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-			{
-			    lnum++;
-			    if (tp == curtab)
-				break;
-			}
+			lnum = CURRENT_TAB_NR;
 			break;
 		}
 		break;
@@ -4250,9 +4269,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curbuf->b_ml.ml_line_count;
 			break;
 		    case ADDR_WINDOWS:
-			lnum = 0;
-			for (wp = firstwin; wp != NULL; wp = wp->w_next)
-			    lnum++;
+			lnum = LAST_WIN_NR;
 			break;
 		    case ADDR_ARGUMENTS:
 			lnum = ARGCOUNT;
@@ -4262,9 +4279,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = lastbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
-			lnum = 0;
-			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-			    lnum++;
+			lnum = LAST_TAB_NR;
 			break;
 		}
 		break;
@@ -4419,16 +4434,11 @@ get_address(ptr, addr_type, skip, to_other_file)
 		switch (addr_type)
 		{
 		    case ADDR_LINES:
-			lnum = curwin->w_cursor.lnum;	/* "+1" is same as ".+1" */
+			/* "+1" is same as ".+1" */
+			lnum = curwin->w_cursor.lnum;
 			break;
 		    case ADDR_WINDOWS:
-			lnum = 0;
-			for (wp = firstwin; wp != NULL; wp = wp->w_next)
-			{
-			    lnum++;
-			    if (wp == curwin)
-				break;
-			}
+			lnum = CURRENT_WIN_NR;
 			break;
 		    case ADDR_ARGUMENTS:
 			lnum = curwin->w_arg_idx + 1;
@@ -4438,13 +4448,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
-			lnum = 0;
-			for(tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-			{
-			    lnum++;
-			    if (tp == curtab)
-				break;
-			}
+			lnum = CURRENT_TAB_NR;
 			break;
 		}
 	    }
@@ -4481,9 +4485,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = 0;
 			break;
 		    }
-		    c = 0;
-		    for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
-			c++;
+		    c = LAST_TAB_NR;
 		    if (lnum >= c)
 			lnum = c;
 		    break;
@@ -4493,9 +4495,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = 0;
 			break;
 		    }
-		    c = 0;
-		    for (wp = firstwin; wp != NULL; wp = wp->w_next)
-			c++;
+		    c = LAST_WIN_NR;
 		    if (lnum > c)
 			lnum = c;
 		    break;
@@ -6805,15 +6805,15 @@ not_exiting()
 }
 
 /*
- * ":quit": quit current window, quit Vim if closed the last window.
+ * ":quit": quit current window, quit Vim if the last window is closed.
  */
     static void
 ex_quit(eap)
     exarg_T	*eap;
 {
+#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
     win_T	*wp;
-    buf_T	*buf;
-    int		wnr;
+#endif
 
 #ifdef FEAT_CMDWIN
     if (cmdwin_type != 0)
@@ -6828,28 +6828,27 @@ ex_quit(eap)
 	text_locked_msg();
 	return;
     }
+#ifdef FEAT_WINDOWS
     if (eap->addr_count > 0)
     {
-	wnr = eap->line2;
-	for (wp = firstwin; --wnr > 0; )
-	{
-	    if (wp->w_next == NULL)
+	int	wnr = eap->line2;
+
+	for (wp = firstwin; wp->w_next != NULL; wp = wp->w_next)
+	    if (--wnr <= 0)
 		break;
-	    else
-		wp = wp->w_next;
-	}
-	buf = wp->w_buffer;
     }
     else
-    {
+#endif
+#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
 	wp = curwin;
-	buf = curbuf;
-    }
+#endif
+
 #ifdef FEAT_AUTOCMD
     apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
     /* Refuse to quit when locked or when the buffer in the last window is
      * being closed (can only happen in autocommands). */
-    if (curbuf_locked() || (buf->b_nwindows == 1 && buf->b_closing))
+    if (curbuf_locked() || (wp->w_buffer->b_nwindows == 1
+						  && wp->w_buffer->b_closing))
 	return;
 #endif
 
@@ -7214,9 +7213,6 @@ ex_all(eap)
 ex_hide(eap)
     exarg_T	*eap;
 {
-    win_T	*win;
-    int		winnr = 0;
-
     if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
 	eap->errmsg = e_invarg;
     else
@@ -7231,7 +7227,11 @@ ex_hide(eap)
 # endif
 	    if (eap->addr_count == 0)
 		win_close(curwin, FALSE);	/* don't free buffer */
-	    else {
+	    else
+	    {
+		int	winnr = 0;
+		win_T	*win;
+
 		for (win = firstwin; win != NULL; win = win->w_next)
 		{
 		    winnr++;
diff --git a/src/testdir/test_argument_count.in b/src/testdir/test_argument_count.in
index f45e52a3e6..cdac0308e7 100644
--- a/src/testdir/test_argument_count.in
+++ b/src/testdir/test_argument_count.in
@@ -1,6 +1,7 @@
 Tests for :[count]argument! and :[count]argdelete     vim: set ft=vim :
 
 STARTTEST
+:so small.vim
 :%argd
 :argadd a b c d
 :set hidden
diff --git a/src/version.c b/src/version.c
index 5162178c05..6ce2f04fb3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    535,
 /**/
     534,
 /**/

From 980c60e53491c76b773c2f4b5228c55fe9a28c7e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 18:33:03 +0100
Subject: [PATCH 319/473] Added tag v7-4-535 for changeset 83c5fd1b55bc

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index df8cb4ac8c..0a9c7e34c8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3257,3 +3257,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 7f48abe500e13554d14f5efae736da871a89ebae v7-4-532
 18953e121be6993e8e87a7d6fd49321ecfc2dcab v7-4-533
 ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534
+83c5fd1b55bc6b2b49b4653cc98985b8dd3fc728 v7-4-535

From 7bee86328b7434d1a87cf12824e7d519137b0d8c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 18:57:11 +0100
Subject: [PATCH 320/473] updated for version 7.4.536 Problem:    Test 63 fails
 when using a black&white terminal. Solution:   Add attributes for a non-color
 terminal. (Christian Brabandt)

---
 src/testdir/test63.in | 6 +++---
 src/version.c         | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/testdir/test63.in b/src/testdir/test63.in
index a161d6745c..1f073a78a6 100644
--- a/src/testdir/test63.in
+++ b/src/testdir/test63.in
@@ -7,9 +7,9 @@ STARTTEST
 :" --- Check that "matcharg()" returns the correct group and pattern if a match
 :" --- is defined.
 :let @r = "*** Test 1: "
-:highlight MyGroup1 ctermbg=red guibg=red
-:highlight MyGroup2 ctermbg=green guibg=green
-:highlight MyGroup3 ctermbg=blue guibg=blue
+:highlight MyGroup1 term=bold ctermbg=red guibg=red
+:highlight MyGroup2 term=italic ctermbg=green guibg=green
+:highlight MyGroup3 term=underline ctermbg=blue guibg=blue
 :match MyGroup1 /TODO/
 :2match MyGroup2 /FIXME/
 :3match MyGroup3 /XXX/
diff --git a/src/version.c b/src/version.c
index 6ce2f04fb3..5915f95eb8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    536,
 /**/
     535,
 /**/

From 5618f6c54e5a97ad8ed18dcca0fd00d0d96e41cd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 18:57:11 +0100
Subject: [PATCH 321/473] Added tag v7-4-536 for changeset d51d47bd77c2

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0a9c7e34c8..357d51ee4d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3258,3 +3258,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 18953e121be6993e8e87a7d6fd49321ecfc2dcab v7-4-533
 ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534
 83c5fd1b55bc6b2b49b4653cc98985b8dd3fc728 v7-4-535
+d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536

From 6e4e1f20e5df7d531578d310078ecef50b29e77d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 19:14:49 +0100
Subject: [PATCH 322/473] updated for version 7.4.537 Problem:    Value of
 v:hlsearch reflects an internal variable. Solution:   Make the value reflect
 whether search highlighting is actually 	    displayed. (Christian
 Brabandt)

---
 runtime/doc/eval.txt   | 8 ++++----
 src/testdir/test101.in | 3 +++
 src/testdir/test101.ok | 1 +
 src/version.c          | 2 ++
 src/vim.h              | 4 ++--
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 829d4eea8d..7b3b9589b8 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1457,10 +1457,10 @@ v:foldstart	Used for 'foldtext': first line of closed fold.
 		Read-only in the |sandbox|. |fold-foldtext|
 
 					*v:hlsearch* *hlsearch-variable*
-v:hlsearch	Variable that determines whether search highlighting is on. 
-		Makes sense only if 'hlsearch' is enabled which requires 
-		|+extra_search|. Setting this variable to zero acts the like 
-		|:nohlsearch| command, setting it to one acts like >
+v:hlsearch	Variable that indicates whether search highlighting is on. 
+		Setting it makes sense only if 'hlsearch' is enabled which
+		requires |+extra_search|. Setting this variable to zero acts
+		the like |:nohlsearch| command, setting it to one acts like >
 			let &hlsearch = &hlsearch
 <
 					*v:insertmode* *insertmode-variable*
diff --git a/src/testdir/test101.in b/src/testdir/test101.in
index 04c934f2c5..31fc334393 100644
--- a/src/testdir/test101.in
+++ b/src/testdir/test101.in
@@ -25,6 +25,9 @@ n:AddR
 :AddR
 /
 :AddR
+:set nohls
+/
+:AddR
 :let r1=r[0][0]
 :" I guess it is not guaranteed that screenattr outputs always the same character
 :call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
diff --git a/src/testdir/test101.ok b/src/testdir/test101.ok
index 3ed7436cf7..f063b85dea 100644
--- a/src/testdir/test101.ok
+++ b/src/testdir/test101.ok
@@ -8,4 +8,5 @@ start:
 1:highlighted
 0:not highlighted
 1:highlighted
+0:not highlighted
 Vim(let):E706:
diff --git a/src/version.c b/src/version.c
index 5915f95eb8..1f7000f019 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    537,
 /**/
     536,
 /**/
diff --git a/src/vim.h b/src/vim.h
index 2a6d9a0445..7f3e393d53 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1998,7 +1998,7 @@ typedef int VimClipboard;	/* This is required for the prototypes. */
 
 #ifndef FEAT_VIRTUALEDIT
 # define getvvcol(w, p, s, c, e) getvcol(w, p, s, c, e)
-# define virtual_active() 0
+# define virtual_active() FALSE
 # define virtual_op FALSE
 #endif
 
@@ -2277,7 +2277,7 @@ typedef int VimClipboard;	/* This is required for the prototypes. */
 #define AUTOLOAD_CHAR '#'
 
 #ifdef FEAT_EVAL
-# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch)
+# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch && p_hls)
 #else
 # define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
 #endif

From 298c21d4bc0fd47bc90dcec9dd8644b84d124438 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 27 Nov 2014 19:14:49 +0100
Subject: [PATCH 323/473] Added tag v7-4-537 for changeset 01c668384bcc

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 357d51ee4d..301245b726 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3259,3 +3259,4 @@ e6c5ff35500d907cad9bfa1f6babdc08a4a90aa0 v7-4-514
 ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534
 83c5fd1b55bc6b2b49b4653cc98985b8dd3fc728 v7-4-535
 d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
+01c668384bcc7fd0f8572a8de2dfc3b2ead7eff0 v7-4-537

From bbe9e5f97776ac7dc86dd7e277778f75b9525980 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 13:34:23 +0100
Subject: [PATCH 324/473] updated for version 7.4.538 Problem:    Tests fail
 with small features plus Python. Solution:   Disallow weird combination of
 options.  Do not set "fdm" when 	    folding is disabled.

---
 src/auto/configure | 12 ++++++++++++
 src/configure.in   | 12 ++++++++++++
 src/ex_cmds.c      |  2 ++
 src/feature.h      |  7 -------
 src/option.c       |  1 +
 src/version.c      |  2 ++
 6 files changed, 29 insertions(+), 7 deletions(-)

diff --git a/src/auto/configure b/src/auto/configure
index f5195b2462..ddc5c1e039 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -5728,6 +5728,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5
 $as_echo "$enable_pythoninterp" >&6; }
 if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
+  fi
+
     for ac_prog in python2 python
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6044,6 +6048,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5
 $as_echo "$enable_python3interp" >&6; }
 if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    as_fn_error $? "cannot use Python with tiny or small features" "$LINENO" 5
+  fi
+
     for ac_prog in python3 python
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -6929,6 +6937,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5
 $as_echo "$enable_rubyinterp" >&6; }
 if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    as_fn_error $? "cannot use Ruby with tiny or small features" "$LINENO" 5
+  fi
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-ruby-command argument" >&5
 $as_echo_n "checking --with-ruby-command argument... " >&6; }
 
diff --git a/src/configure.in b/src/configure.in
index ff1f4824b4..033138c115 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -1041,6 +1041,10 @@ AC_ARG_ENABLE(pythoninterp,
 	[enable_pythoninterp="no"])
 AC_MSG_RESULT($enable_pythoninterp)
 if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    AC_MSG_ERROR([cannot use Python with tiny or small features])
+  fi
+
   dnl -- find the python executable
   AC_PATH_PROGS(vi_cv_path_python, python2 python)
   if test "X$vi_cv_path_python" != "X"; then
@@ -1243,6 +1247,10 @@ AC_ARG_ENABLE(python3interp,
 	[enable_python3interp="no"])
 AC_MSG_RESULT($enable_python3interp)
 if test "$enable_python3interp" = "yes" -o "$enable_python3interp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    AC_MSG_ERROR([cannot use Python with tiny or small features])
+  fi
+
   dnl -- find the python3 executable
   AC_PATH_PROGS(vi_cv_path_python3, python3 python)
   if test "X$vi_cv_path_python3" != "X"; then
@@ -1720,6 +1728,10 @@ AC_ARG_ENABLE(rubyinterp,
 	[enable_rubyinterp="no"])
 AC_MSG_RESULT($enable_rubyinterp)
 if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
+  if test "x$features" = "xtiny" -o "x$features" = "xsmall"; then
+    AC_MSG_ERROR([cannot use Ruby with tiny or small features])
+  fi
+
   AC_MSG_CHECKING(--with-ruby-command argument)
   AC_SUBST(vi_cv_path_ruby)
   AC_ARG_WITH(ruby-command, [  --with-ruby-command=RUBY  name of the Ruby command (default: ruby)],
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 1114f85345..86dab4797d 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -6200,9 +6200,11 @@ prepare_help_buffer()
 	(void)buf_init_chartab(curbuf, FALSE);
     }
 
+#ifdef FEAT_FOLDING
     /* Don't use the global foldmethod.*/
     set_string_option_direct((char_u *)"fdm", -1, (char_u *)"manual",
 						       OPT_FREE|OPT_LOCAL, 0);
+#endif
 
     curbuf->b_p_ts = 8;		/* 'tabstop' is 8 */
     curwin->w_p_list = FALSE;	/* no list mode */
diff --git a/src/feature.h b/src/feature.h
index 917179401b..01f611e381 100644
--- a/src/feature.h
+++ b/src/feature.h
@@ -384,13 +384,6 @@
 # endif
 #endif
 
-/*
- * +python and +python3 require FEAT_EVAL.
- */
-#if !defined(FEAT_EVAL) && (defined(FEAT_PYTHON3) || defined(FEAT_PYTHON))
-# define FEAT_EVAL
-#endif
-
 /*
  * +profile		Profiling for functions and scripts.
  */
diff --git a/src/option.c b/src/option.c
index a97dae6262..3195fa8d90 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5575,6 +5575,7 @@ set_string_option_direct(name, opt_idx, val, opt_flags, set_sid)
 	if (idx < 0)	/* not found (should not happen) */
 	{
 	    EMSG2(_(e_intern2), "set_string_option_direct()");
+	    EMSG2(_("For option %s"), name);
 	    return;
 	}
     }
diff --git a/src/version.c b/src/version.c
index 1f7000f019..9545d00935 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    538,
 /**/
     537,
 /**/

From de2731f478e4a5c5e1ee13ca4beaba5f7d1f5c72 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 13:34:23 +0100
Subject: [PATCH 325/473] Added tag v7-4-538 for changeset 3421b24e419c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 301245b726..c2b1efdb61 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3260,3 +3260,4 @@ ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534
 83c5fd1b55bc6b2b49b4653cc98985b8dd3fc728 v7-4-535
 d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 01c668384bcc7fd0f8572a8de2dfc3b2ead7eff0 v7-4-537
+3421b24e419c935f3914a4bf7eb6d3b1de3d618f v7-4-538

From 9038b4ac051528cd2fed43cf2d4bd33e2e190bb9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 14:50:16 +0100
Subject: [PATCH 326/473] updated for version 7.4.539 Problem:    Crash when
 computing buffer count.  Problem with range for user 	    commands.  Line
 range wrong in Visual area. Solution:   Avoid segfault in
 compute_buffer_local_count().  Check for 	    CMD_USER when checking
 type of range. (Marcin Szamotulski)

---
 runtime/doc/windows.txt | 12 +++++++--
 src/ex_docmd.c          | 55 ++++++++++++++++++++++++++++++-----------
 src/version.c           |  2 ++
 3 files changed, 53 insertions(+), 16 deletions(-)

diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index d116c9f6c5..2830a04b84 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1029,7 +1029,11 @@ list of buffers. |unlisted-buffer|
 		Actually, the buffer isn't completely deleted, it is removed
 		from the buffer list |unlisted-buffer| and option values,
 		variables and mappings/abbreviations for the buffer are
-		cleared.
+		cleared. Examples: >
+		    :.,$-bdelete    " delete buffers from the current one to
+				    " last but one
+		    :%bdelete	    " delete all buffers
+<
 
 :bdelete[!] {bufname}						*E93* *E94*
 		Like ":bdelete[!] [N]", but buffer given by name.  Note that a
@@ -1053,7 +1057,11 @@ list of buffers. |unlisted-buffer|
 		Like |:bdelete|, but really delete the buffer.  Everything
 		related to the buffer is lost.  All marks in this buffer
 		become invalid, option settings are lost, etc.  Don't use this
-		unless you know what you are doing.
+		unless you know what you are doing. Examples: >
+		    :.+,$bwipeout   " wipe out all buffers after the current
+				    " one
+		    :%bwipeout	    " wipe out all buffers
+<
 
 :[N]bun[load][!]				*:bun* *:bunload* *E515*
 :bun[load][!] [N]
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 4ce9e926ab..b926027f26 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1694,6 +1694,7 @@ compute_buffer_local_count(addr_type, lnum, offset)
     int	    offset;
 {
     buf_T   *buf;
+    buf_T   *nextbuf;
     int     count = offset;
 
     buf = firstbuf;
@@ -1701,15 +1702,30 @@ compute_buffer_local_count(addr_type, lnum, offset)
 	buf = buf->b_next;
     while (count != 0)
     {
-	count += (count < 0) ? 1 : -1;
-	if (buf->b_prev == NULL)
+	count += (offset < 0) ? 1 : -1;
+	nextbuf = (offset < 0) ? buf->b_prev : buf->b_next;
+	if (nextbuf == NULL)
 	    break;
-	buf = (count < 0) ? buf->b_prev : buf->b_next;
+	buf = nextbuf;
 	if (addr_type == ADDR_LOADED_BUFFERS)
 	    /* skip over unloaded buffers */
-	    while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
-		buf = (count < 0) ? buf->b_prev : buf->b_next;
+	    while (buf->b_ml.ml_mfp == NULL)
+	    {
+		nextbuf = (offset < 0) ? buf->b_prev : buf->b_next;
+		if (nextbuf == NULL)
+		    break;
+		buf = nextbuf;
+	    }
     }
+    /* we might have gone too far, last buffer is not loadedd */
+    if (addr_type == ADDR_LOADED_BUFFERS)
+	while (buf->b_ml.ml_mfp == NULL)
+	{
+	    nextbuf = (offset >= 0) ? buf->b_prev : buf->b_next;
+	    if (nextbuf == NULL)
+		break;
+	    buf = nextbuf;
+	}
     return buf->b_fnum;
 }
 
@@ -2113,7 +2129,7 @@ do_one_cmd(cmdlinep, sourcing,
  * is equal to the lower.
  */
 
-    if (ea.cmdidx != CMD_SIZE)
+    if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_SIZE)
 	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
     else
 	ea.addr_type = ADDR_LINES;
@@ -2153,6 +2169,7 @@ do_one_cmd(cmdlinep, sourcing,
 	{
 	    if (*ea.cmd == '%')		    /* '%' - all lines */
 	    {
+		buf_T	*buf;
 		++ea.cmd;
 		switch (ea.addr_type)
 		{
@@ -2160,9 +2177,21 @@ do_one_cmd(cmdlinep, sourcing,
 			ea.line1 = 1;
 			ea.line2 = curbuf->b_ml.ml_line_count;
 			break;
-		    case ADDR_WINDOWS:
 		    case ADDR_LOADED_BUFFERS:
+			buf = firstbuf;
+			while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL)
+			    buf = buf->b_next;
+			ea.line1 = buf->b_fnum;
+			buf = lastbuf;
+			while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
+			    buf = buf->b_prev;
+			ea.line2 = buf->b_fnum;
+			break;
 		    case ADDR_UNLOADED_BUFFERS:
+			ea.line1 = firstbuf->b_fnum;
+			ea.line2 = lastbuf->b_fnum;
+			break;
+		    case ADDR_WINDOWS:
 		    case ADDR_TABS:
 			errormsg = (char_u *)_(e_invrange);
 			goto doend;
@@ -4463,7 +4492,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 		n = getdigits(&cmd);
 	    if (addr_type == ADDR_LOADED_BUFFERS
 		    || addr_type == ADDR_UNLOADED_BUFFERS)
-		lnum = compute_buffer_local_count(addr_type, lnum, n);
+		lnum = compute_buffer_local_count(addr_type, lnum, (i == '-') ? -1 * n : n);
 	    else if (i == '-')
 		lnum -= n;
 	    else
@@ -4485,9 +4514,8 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = 0;
 			break;
 		    }
-		    c = LAST_TAB_NR;
-		    if (lnum >= c)
-			lnum = c;
+		    if (lnum >= LAST_TAB_NR)
+			lnum = LAST_TAB_NR;
 		    break;
 		case ADDR_WINDOWS:
 		    if (lnum < 0)
@@ -4495,9 +4523,8 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = 0;
 			break;
 		    }
-		    c = LAST_WIN_NR;
-		    if (lnum > c)
-			lnum = c;
+		    if (lnum >= LAST_WIN_NR)
+			lnum = LAST_WIN_NR;
 		    break;
 		case ADDR_LOADED_BUFFERS:
 		case ADDR_UNLOADED_BUFFERS:
diff --git a/src/version.c b/src/version.c
index 9545d00935..9e9e80281f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    539,
 /**/
     538,
 /**/

From 3863016c0d9f7bba24249464fce4c5b31eace433 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 14:50:16 +0100
Subject: [PATCH 327/473] Added tag v7-4-539 for changeset 77fe94082f53

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c2b1efdb61..092dd16df9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3261,3 +3261,4 @@ ee28ddfc7b7c66b7c2a87ed95dd1d4cae7902a75 v7-4-534
 d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 01c668384bcc7fd0f8572a8de2dfc3b2ead7eff0 v7-4-537
 3421b24e419c935f3914a4bf7eb6d3b1de3d618f v7-4-538
+77fe94082f5396c2e40f732b30c9d76984969694 v7-4-539

From 1c109d03a66d4144587acb1046d061fa34993237 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 22:51:06 +0100
Subject: [PATCH 328/473] updated for version 7.4.540 Problem:    Cannot build
 with tiny and small features. (Taro Muraoka) Solution:   Add #ifdef around
 CMD_USER.

---
 src/ex_docmd.c | 6 +++++-
 src/version.c  | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index b926027f26..607dbd9eec 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2129,7 +2129,11 @@ do_one_cmd(cmdlinep, sourcing,
  * is equal to the lower.
  */
 
-    if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_SIZE)
+    if (ea.cmdidx != CMD_SIZE
+#ifdef FEAT_USR_CMDS
+	&& ea.cmdidx != CMD_USER
+#endif
+       )
 	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
     else
 	ea.addr_type = ADDR_LINES;
diff --git a/src/version.c b/src/version.c
index 9e9e80281f..57b5d76421 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    540,
 /**/
     539,
 /**/

From 6653d35464ac4ab8877ab73c560095ff07ee4c4e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 30 Nov 2014 22:51:06 +0100
Subject: [PATCH 329/473] Added tag v7-4-540 for changeset 93aca8cdd7b8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 092dd16df9..5134803d3d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3262,3 +3262,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 01c668384bcc7fd0f8572a8de2dfc3b2ead7eff0 v7-4-537
 3421b24e419c935f3914a4bf7eb6d3b1de3d618f v7-4-538
 77fe94082f5396c2e40f732b30c9d76984969694 v7-4-539
+93aca8cdd7b8cc1d9e921e243c7c2b6c7fd5f730 v7-4-540

From dc5d9fcffb86711540568b88cba0d414f6066b5e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 6 Dec 2014 23:33:00 +0100
Subject: [PATCH 330/473] Update runtime files.

---
 runtime/autoload/phpcomplete.vim | 74 ++++++++++++++++++++----
 runtime/doc/editing.txt          | 25 +++++---
 runtime/doc/eval.txt             | 15 ++++-
 runtime/doc/indent.txt           |  2 +-
 runtime/doc/syntax.txt           |  3 +-
 runtime/doc/tabpage.txt          |  2 +-
 runtime/doc/todo.txt             | 97 ++++++++++++++++++++++----------
 runtime/doc/windows.txt          | 17 +++---
 runtime/filetype.vim             |  6 +-
 runtime/indent/php.vim           | 87 +++++++++++++++++-----------
 runtime/macros/editexisting.vim  |  4 +-
 runtime/syntax/zimbu.vim         | 64 +++++++++++++++------
 12 files changed, 277 insertions(+), 119 deletions(-)

diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim
index b014b4cdcf..5ddad88873 100644
--- a/runtime/autoload/phpcomplete.vim
+++ b/runtime/autoload/phpcomplete.vim
@@ -3,7 +3,7 @@
 " Maintainer:	Dávid Szabó ( complex857 AT gmail DOT com )
 " Previous Maintainer:	Mikolaj Machowski ( mikmach AT wp DOT pl )
 " URL: https://github.com/shawncplus/phpcomplete.vim
-" Last Change:  2014 Oct 02
+" Last Change:  2014 Dec 01
 "
 "	OPTIONS:
 "
@@ -1172,11 +1172,11 @@ function! phpcomplete#GetCurrentInstruction(line_number, col_number, phpbegin) "
 			" break if we are on a "naked" stop_char (operators, colon, openparent...)
 			if index(stop_chars, current_char) != -1
 				let do_break = 1
-				" dont break does not look like a "->"
+				" dont break if it does look like a "->"
 				if (prev_char == '-' && current_char == '>') || (current_char == '-' && next_char == '>')
 					let do_break = 0
 				endif
-				" dont break if its looks like a "::"
+				" dont break if it does look like a "::"
 				if (prev_char == ':' && current_char == ':') || (current_char == ':' && next_char == ':')
 					let do_break = 0
 				endif
@@ -1356,8 +1356,12 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
 						endif
 						" make @return self, static, $this the same way
 						" (not exactly what php means by these)
-						if returnclass == 'self' || returnclass == 'static' || returnclass == '$this'
-							let classname_candidate = a:classname_candidate
+						if returnclass == 'self' || returnclass == 'static' || returnclass == '$this' || returnclass == 'self[]' || returnclass == 'static[]' || returnclass == '$this[]'
+							if returnclass =~ '\[\]$'
+								let classname_candidate = a:classname_candidate.'[]'
+							else
+								let classname_candidate = a:classname_candidate
+							endif
 							let class_candidate_namespace = a:class_candidate_namespace
 						else
 							let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(returnclass, fullnamespace, a:imports)
@@ -1527,7 +1531,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 		let function_boundary = phpcomplete#GetCurrentFunctionBoundaries()
 		let search_end_line = max([1, function_boundary[0][0]])
 		" -1 makes us ignore the current line (where the completion was invoked
-		let lines = reverse(getline(search_end_line, line('.') - 1))
+		let lines = reverse(getline(search_end_line, a:start_line - 1))
 
 		" check Constant lookup
 		let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
@@ -1638,9 +1642,32 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 
 			" assignment for the variable in question with a variable on the right hand side
 			if line =~# '^\s*'.object.'\s*=&\?\s*'.variable_name_pattern
-				let tailing_semicolon = match(line, ';\s*$')
-				let tailing_semicolon = tailing_semicolon != -1 ? tailing_semicolon : strlen(getline(a:start_line - i))
-				let prev_context = phpcomplete#GetCurrentInstruction(a:start_line - i, tailing_semicolon - 1, b:phpbegin)
+
+				" try to find the next non-comment or string ";" char
+				let start_col = match(line, '^\s*'.object.'\C\s*=\zs&\?\s*'.variable_name_pattern)
+				let filelines = reverse(lines)
+				let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
+				let chars_read = 1
+				" read while end of the file
+				while char != 'EOF' && chars_read < 1000
+					let last_pos = pos
+					let [pos, char] = s:getNextCharWithPos(filelines, pos)
+					let chars_read += 1
+					" we got a candidate
+					if char == ';'
+						let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
+						" it's not a comment or string, end search
+						if synIDName !~? 'comment\|string'
+							break
+						endif
+					endif
+				endwhile
+
+				let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
+				if prev_context == ''
+					" cannot get previous context give up
+					return
+				endif
 				let prev_class = phpcomplete#GetClassName(a:start_line - i, prev_context, a:current_namespace, a:imports)
 
 				if stridx(prev_class, '\') != -1
@@ -1656,9 +1683,32 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
 
 			" assignment for the variable in question with a function on the right hand side
 			if line =~# '^\s*'.object.'\s*=&\?\s*'.function_invocation_pattern
-				let tailing_semicolon = match(line, ';\s*$')
-				let tailing_semicolon = tailing_semicolon != -1 ? tailing_semicolon : strlen(getline(a:start_line - i))
-				let prev_context = phpcomplete#GetCurrentInstruction(a:start_line - i, tailing_semicolon - 1, b:phpbegin)
+
+				" try to find the next non-comment or string ";" char
+				let start_col = match(line, '\C^\s*'.object.'\s*=\zs&\?\s*'.function_invocation_pattern)
+				let filelines = reverse(lines)
+				let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
+				let chars_read = 1
+				" read while end of the file
+				while char != 'EOF' && chars_read < 1000
+					let last_pos = pos
+					let [pos, char] = s:getNextCharWithPos(filelines, pos)
+					let chars_read += 1
+					" we got a candidate
+					if char == ';'
+						let synIDName = synIDattr(synID(pos[0] + 1, pos[1] + 1, 0), 'name')
+						" it's not a comment or string, end search
+						if synIDName !~? 'comment\|string'
+							break
+						endif
+					endif
+				endwhile
+
+				let prev_context = phpcomplete#GetCurrentInstruction(last_pos[0] + 1, last_pos[1], b:phpbegin)
+				if prev_context == ''
+					" cannot get previous context give up
+					return
+				endif
 
 				let function_name = matchstr(prev_context, '^'.function_invocation_pattern.'\ze')
 				let function_name = matchstr(function_name, '^\zs.\+\ze\s*($') " strip the trailing (
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index a71cbc0047..71f2f8c25c 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Nov 19
+*editing.txt*   For Vim version 7.4.  Last change: 2014 Dec 05
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -611,7 +611,7 @@ list of the current window.
 :[count]arga[dd] {name} ..			*:arga* *:argadd* *E479*
 :[count]arga[dd]
 			Add the {name}s to the argument list.  When {name} is
-			omitted at the current buffer name to the argument
+			omitted add the current buffer name to the argument
 			list.
 			If [count] is omitted, the {name}s are added just
 			after the current entry in the argument list.
@@ -622,7 +622,8 @@ list of the current window.
 				:argadd x	a b x c
 				:0argadd x	x a b c
 				:1argadd x	a x b c
-				:99argadd x	a b c x
+				:$argadd x	a b c x
+				:+2argadd y	a b c x y
 			There is no check for duplicates, it is possible to
 			add a file to the argument list twice.
 			The currently edited file is not changed.
@@ -644,11 +645,19 @@ list of the current window.
 <			{not in Vi} {not available when compiled without the
 			|+listcmds| feature}
 
-:{range}argd[elete]	Delete the {range} files from the argument list.
+:[range]argd[elete]	Delete the {range} files from the argument list.
+			Example: >
+				:10,$argdel
+<			Deletes arguments 10 and further, keeping 1-9. >
+				:$argd
+<			Deletes just the last one. >
+				:argd
+				:.argd
+<			Deletes the current argument. >
+				:%argd
+<			Removes all the files from the arglist.
 			When the last number in the range is too high, up to
-			the last argument is deleted.  Example: >
-				:10,1000argdel
-<			Deletes arguments 10 and further, keeping 1-9.
+			the last argument is deleted.
 			{not in Vi} {not available when compiled without the
 			|+listcmds| feature}
 
@@ -1082,7 +1091,7 @@ The names can be in upper- or lowercase.
 
 :q[uit]!		Quit without writing, also when currently visible
 			buffers have changes.  Does not exit when this is the
-			last window and there are is a changed hidden buffer.
+			last window and there is a changed hidden buffer.
 			In this case, the first changed hidden buffer becomes
 			the current buffer.
 			Use ":qall!" to exit always.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 7b3b9589b8..21df37f301 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 15
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -3305,6 +3305,17 @@ getchar([expr])						*getchar()*
 			:    endif
 			:  endwhile
 			:endfunction
+<
+		You may also receive syntetic characters, such as
+		|<CursorHold>|. Often you will want to ignore this and get
+		another character: >
+			:function GetKey()
+			:  let c = getchar()
+			:  while c == "\<CursorHold>"
+			:    let c = getchar()
+			:  endwhile
+			:  return c
+			:endfunction
 
 getcharmod()						*getcharmod()*
 		The result is a Number which is the state of the modifiers for
@@ -3515,7 +3526,7 @@ getpos({expr})	Get the position for {expr}.  For possible values of {expr}
 		This can be used to save and restore the position of a mark: >
 			let save_a_mark = getpos("'a")
 			...
-			call setpos(''a', save_a_mark
+			call setpos("'a", save_a_mark)
 <		Also see |getcurpos()| and |setpos()|.
 
 
diff --git a/runtime/doc/indent.txt b/runtime/doc/indent.txt
index fc16b1a7e7..3f61e28651 100644
--- a/runtime/doc/indent.txt
+++ b/runtime/doc/indent.txt
@@ -1,4 +1,4 @@
-*indent.txt*    For Vim version 7.4.  Last change: 2014 Apr 23
+*indent.txt*    For Vim version 7.4.  Last change: 2014 Dec 06
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index ee91a91acb..efb7bda661 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.4.  Last change: 2014 Sep 27
+*syntax.txt*	For Vim version 7.4.  Last change: 2014 Nov 19
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -5065,6 +5065,7 @@ This will set the "w:current_syntax" variable to "foo".  The value of
 restoring "b:current_syntax", since the syntax files do set
 "b:current_syntax".  The value set by the syntax file is assigned to
 "w:current_syntax".
+Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options.
 
 Once a window has its own syntax, syntax commands executed from other windows
 on the same buffer (including :syntax clear) have no effect. Conversely,
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index b795dbe552..47e1a4b674 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt*   For Vim version 7.4.  Last change: 2012 Aug 08
+*tabpage.txt*   For Vim version 7.4.  Last change: 2014 Nov 27
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 2957b29491..04f9a44b95 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Nov 19
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Dec 06
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -34,9 +34,23 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+Patch to fix list range assign crash. (Yukihiro Nakadaira, 2014 Dec 1)
+
+Patch to fix range with user command. (Marcin Szamotulski, 2014 Dec 2)
+Update Dec 6, with support for user commands.
+
+When window number in Ex range is too high, give an error?
+Only when backwards compatible.
+
+:s/\n// doesn't change anything.  Since 7.4.232? (Eliseo Martínez, 2014 Nov
+28)  Patch on Issue 287
+
+Using vim_snprintf() in window.c can be in a function.
+
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
+- Very slow with a long line and Ruby highlighting. (John Whitley, 2014 Dec 4)
 - Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
   (Lech Lorens, 2014 Feb 3)
 - Issue 164: freeze on regexp search.
@@ -64,17 +78,11 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
+Patch to fix recognizing function name. (Ozaki Kiichi, 2014 Nov 28)
+
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
-Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
-14, Aug 30)
-    Make ":1close" close the first window.
-    Make ":+1close" close the next window.
-    Make ":-1close" close the previous window.
-Doesn't look right, asked for updates.
-Update 2014 Nov 8. Replied with suggestions.
-
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
@@ -84,34 +92,34 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-Patch to fix issue 78. (Christian Brabandt, 2014 Oct 8)
-
-Patch to fix leak in map() with error. (Christian Brabandt, 2014 Oct 11)
-
-Patch to fix incsearch for "2/pattern/e".
-
-Patch to fix memory leak in :hardcopy. (Christian Brabandt, 2014 Nov 16)
-
-Patch to fix warnings in if_ruby.c. (Ken Takata, 2014 Nov 17)
-
-Patch to make test 63 pass when in a B&W terminal. (Christian Brabandt, 2014
-Nov 15)  Other patch (better) on Nov 17.
-
 Change behavior of v:hlsearch?  Patch from Christian, 2014 Oct 22.
 
+Patch to recover from X server restart: hint on Issue 203 (2014 Nov 21 18:44)
+
 MS-Windows: When editing a file with a leading space, writing it uses the
 wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
 
+Add LessCss support. (Jenoma / Alessandro Vioni, 2014 Nov 24)
+Now with updated license, Nov 24.
+
 patch to remove FEAT_OSFILETYPE from fileio.c. (Christian, 2014 Nov 12)
 
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
-Patch to fix relatie numbers. (Christian Brabandt, 2014 Nov 17)
+Ukrainian vimtutor. (Issue 288)
+
+Regenerate the Unicode tables in mbyte.c.
+Diff from ZyX, 2014 Dec 6.
+
+Patch to fix relative numbers. (Christian Brabandt, 2014 Nov 17)
+Update Nov 26.
 
 Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
 Nov 12)
 
+Patch to avoid recognizing polkit as hog files. (Issue 292)
+
 Patch to support hex values for setting option value.
 (Zyx, 2015 Nov 6)
 
@@ -122,17 +130,29 @@ Update Nov 5.
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
 
+Cursorline background color not mixed with character highlight.
+Patch by Yasuhiro Matsumoto, 2014 Dec 3.
+
 Problem using diff syntax with cp932 encoding.  Idea from Yasuhiro Matsumoto,
 patch from Ken Takata (2014 Nov 6)
 
 ml_updatechunk() is slow when retrying for another encoding. (John Little,
 2014 Sep 11)
 
+Patch to add a different escape sequence for replace mode.
+(Omar Sandoval, 2014 Nov 30)
+
+Patch to allow values greater than 255 for ctermfg/ctermbg on Windows.
+(Yasuhiro Matsumoto, 2014 Dec 5)
+
 When 'balloonexpr' returns a list the result has a trailing newline.
 Just remove one trailing newline. (lcd, 2014 Oct 17)
 
 Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24)
 
+Result of systemlist() does not show whether text ended in line break.
+(Bjorn Linse, 2014 Nov 27)
+
 When in 'comments' "n:x" follows after three-part comment directly it repeats
 any one-character from the previous line. (Kartik Agaram, 2014 Sep 19)
 
@@ -147,6 +167,15 @@ Plugins need to make a lot of effort, lots of mappings, to know what happened
 before pressing the key that triggers a plugin action.  How about keeping the
 last N pressed keys, so that they do not need to be mapped?
 
+":q!" should reset modified flag for current buffer, if another buffer is
+modified no need to abandon it again.
+Patch from Yasuhiro Matsumoto, 2014 Nov 21.
+Update from Hirohito Higashi, 2014 Nov 21.
+With test, Nov 23.
+
+Wrong scrolling when using incsearch.  Patch by Christian Brabandt, 2014 Dec 4.
+Is this a good solution?
+
 Can assign to s:type when a function s:type has been defined.
 Also the other way around: define a function while a variable with that name
 was already defined.
@@ -175,6 +204,7 @@ Bug: Autocompleting ":tag/pat" replaces "/pat" with a match but does not
 insert a space. (Micha Mos, 2014 Nov 7)
 
 Patch to add the :bvimgrep command.  (Christian Brabandt, 2014 Nov 12)
+Update Dec 6.
 
 Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
 
@@ -287,6 +317,10 @@ Yasuhiro Matsumoto, 2013 May 31.
 Or should we add a more general mechanism, like a lambda() function?
 Patch by Yasuhiro Matsumoto, 2014 Sep 16.
 
+Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013)
+Update suggested by Yasuhiro Matsumoto, 2014 Nov 25:
+https://gist.github.com/presuku/d3d6b230b9b6dcfc0477
+
 VMS: Select() doesn't work properly, typing ESC may hang Vim.  Use sys$qiow
 instead. (Samuel Ferencik, 2013 Sep 28)
 
@@ -548,6 +582,14 @@ MS-Windows resizing problems:
   causes the window to move unnecessarily. (William E. Skeith III, 2012 Jan
   12) Patch: 2012 Jan 13  Needs more work (2012 Feb 2)
 
+Patch to use Modern UI 2.0 for the Nsis installer. (Guopeng Wen, 2010 Jul 30)
+Latest version: 2011 May 18 
+8   Windows install with NSIS: make it possible to do a silent install, see
+    http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
+    Version from Guopeng Wen that does this (2010 Dec 27)
+Alternative: MSI installer: https://github.com/petrkle/vim-msi/
+Or the one on Issue 279
+
 'iminsert' global value set when using ":setlocal iminsert"? (Wu, 2012 Jun 23)
 
 Patch to append regexp to tag commands to make it possible to select one out
@@ -874,7 +916,7 @@ Assume the system converts between the actual encoding of the filesystem to
 the system encoding (usually utf-8).
 
 Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
-26, update 2013 Dec 14)
+26, update 2013 Dec 14, another 2014 Nov 22)
 
 Problem producing tags file when hebrew.frx is present.  It has a BOM.
 Results in E670. (Tony Mechelynck, 2010 May 2)
@@ -1534,13 +1576,6 @@ with "gvim -nb:localhost:55555:foo".  From nc do: '1:editFile!0 "foo"'.  Then
 go to Insert mode and add a few lines.  Then backspacing every other time
 moves the cursor instead of deleting. (Chris Kaiser, 2007 Sep 25)
 
-Patch to use Modern UI 2.0 for the Nsis installer. (Guopeng Wen, 2010 Jul 30)
-Latest version: 2011 May 18
-8   Windows install with NSIS: make it possible to do a silent install, see
-    http://nsis.sourceforge.net/Docs/Chapter4.html#4.12
-    Version from Guopeng Wen that does this (2010 Dec 27)
-Alternative: MSI installer: https://github.com/petrkle/vim-msi/
-
 Windows installer should install 32-bit version of right-click handler also on
 64-bit systems. (Brian Cunningham, 2011 Dec 28)
 
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 2830a04b84..67925b864a 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -1,4 +1,4 @@
-*windows.txt*   For Vim version 7.4.  Last change: 2014 Sep 23
+*windows.txt*   For Vim version 7.4.  Last change: 2014 Dec 05
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -278,16 +278,17 @@ CTRL-W CTRL-Q						*CTRL-W_CTRL-Q*
 		and there is only one window for the current buffer, and the
 		buffer was changed, the command fails.
 		
-		(Note: CTRL-Q does not
-		work on all terminals).  If [count] is greater than
-		the last window number the last window will be closed: >
+		(Note: CTRL-Q does not work on all terminals).
+		
+		If [count] is greater than the last window number the last
+		window will be closed: >
 		    :1quit  " quit the first window
 		    :$quit  " quit the last window
 		    :9quit  " quit the last window
 			     " if there are less than 9 windows opened
 		    :-quit  " quit the previews window
 		    :+quit  " quit the next window
-		    :+2quit " will also work as expected
+		    :+2quit " quit the second next window
 <
 :q[uit]!
 :{count}q[uit]!
@@ -332,9 +333,9 @@ CTRL-W CTRL-C						*CTRL-W_CTRL-C*
 		screen.  For {count} see |:quit| command.
 		
 		The buffer becomes hidden (unless there is another window
-		editing it or 'bufhidden' is "unload" or "delete").  If the
-		window is the last one in the current tab page the tab page is
-		closed.  |tab-page| 
+		editing it or 'bufhidden' is "unload", "delete" or "wipe").
+		If the window is the last one in the current tab page the tab
+		page is closed.  |tab-page| 
 		
 		The value of 'hidden' is irrelevant for this command.  Changes
 		to the buffer are not written and won't get lost, so this is a
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 508f19820b..e55642d142 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Nov 05
+" Last Change:	2014 Dec 06
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1856,7 +1856,7 @@ au BufNewFile,BufRead sgml.catalog*		call s:StarSetf('catalog')
 
 " Shell scripts (sh, ksh, bash, bash2, csh); Allow .profile_foo etc.
 " Gentoo ebuilds are actually bash scripts
-au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,*.bash,*.ebuild call SetFileTypeSH("bash")
+au BufNewFile,BufRead .bashrc*,bashrc,bash.bashrc,.bash_profile*,.bash_logout*,.bash_aliases*,*.bash,*.ebuild call SetFileTypeSH("bash")
 au BufNewFile,BufRead .kshrc*,*.ksh call SetFileTypeSH("ksh")
 au BufNewFile,BufRead */etc/profile,.profile*,*.sh,*.env call SetFileTypeSH(getline(1))
 
@@ -2502,6 +2502,8 @@ au BufNewFile,BufRead */etc/yum.conf		setf dosini
 
 " Zimbu
 au BufNewFile,BufRead *.zu			setf zimbu
+" Zimbu Templates
+au BufNewFile,BufRead *.zut			setf zimbutempl
 
 " Zope
 "   dtml (zope dynamic template markup language), pt (zope page template),
diff --git a/runtime/indent/php.vim b/runtime/indent/php.vim
index b83a1923ed..1bffa7f195 100644
--- a/runtime/indent/php.vim
+++ b/runtime/indent/php.vim
@@ -3,8 +3,8 @@
 " Author:	John Wellesz <John.wellesz (AT) teaser (DOT) fr>
 " URL:		http://www.2072productions.com/vim/indent/php.vim
 " Home:		https://github.com/2072/PHP-Indenting-for-VIm
-" Last Change:	2014 April 3rd
-" Version:	1.49
+" Last Change:	2014 November 26th
+" Version:	1.57
 "
 "
 "	Type :help php-indent for available options
@@ -48,7 +48,7 @@ endif
 let b:did_indent = 1
 
 
-let php_sync_method = 0
+let g:php_sync_method = 0
 
 
 
@@ -112,7 +112,7 @@ setlocal nocindent
 setlocal nolisp
 
 setlocal indentexpr=GetPhpIndent()
-setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
+setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,*<Return>,=?>,=<?,=*/
 
 
 
@@ -128,11 +128,14 @@ if exists("*GetPhpIndent")
 endif
 
 
+let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
 let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
 let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
-let s:functionDecl = '\<function\>\%(\s\+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\)\=\s*(.*'
+let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
 let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
-let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
+
+
+let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
 let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
 
 
@@ -140,7 +143,7 @@ let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
 let s:escapeDebugStops = 0
 function! DebugPrintReturn(scriptLine)
 
-    if ! s:escapeDebugStops 
+    if ! s:escapeDebugStops
 	echo "debug:" . a:scriptLine
 	let c = getchar()
 	if c == "\<Del>"
@@ -158,8 +161,6 @@ function! GetLastRealCodeLNum(startline) " {{{
 	let lnum = b:GetLastRealCodeLNum_ADD
     endif
 
-    let old_lnum = lnum
-
     while lnum > 1
 	let lnum = prevnonblank(lnum)
 	let lastline = getline(lnum)
@@ -217,7 +218,7 @@ function! GetLastRealCodeLNum(startline) " {{{
 	let lnum=0
     endif
 
-    if b:InPHPcode_and_script && !b:InPHPcode
+    if b:InPHPcode_and_script && 1 > b:InPHPcode
 	let b:InPHPcode_and_script = 0
     endif
 
@@ -237,7 +238,7 @@ endfun
 
 function! Skippmatch()	" {{{
     let synname = synIDattr(synID(line("."), col("."), 0), "name")
-    if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# "^phpComment" && b:UserIsTypingComment
+    if synname == "Delimiter" || synname == "phpRegionDelimiter" || synname =~# "^phpParent" || synname == "phpArrayParens" || synname =~# '^php\%(Block\|Brace\)' || synname == "javaScriptBraces" || synname =~# '^php\%(Doc\)\?Comment' && b:UserIsTypingComment
 	return 0
     else
 	return 1
@@ -249,7 +250,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
     let line = searchpair('{', '', '}', 'bW', 'Skippmatch()')
 
     if a:blockStarter == 1
-	while line > 1 
+	while line > 1
 	    let linec = getline(line)
 
 	    if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
@@ -310,7 +311,6 @@ let s:defaultORcase = '^\s*\%(default\|case\).*:'
 
 function! FindTheSwitchIndent (lnum) " {{{
 
-
     let test = GetLastRealCodeLNum(a:lnum - 1)
 
     if test <= 1
@@ -353,7 +353,7 @@ function! IslinePHP (lnum, tofind) " {{{
 
     if synname == 'phpStringSingle' || synname == 'phpStringDouble' || synname == 'phpBacktick'
 	if cline !~ '^\s*[''"`]'
-	    return ""
+	    return "SpecStringEntrails"
 	else
 	    return synname
 	end
@@ -372,7 +372,7 @@ if ! s:autoresetoptions
 endif
 
 function! ResetPhpOptions()
-    if ! b:optionsset && &filetype == "php"
+    if ! b:optionsset && &filetype =~ "php"
 	if b:PHP_autoformatcomment
 
 	    setlocal comments=s1:/*,mb:*,ex:*/,://,:#
@@ -418,7 +418,7 @@ function! GetPhpIndent()
 	    let b:PHP_indentinghuge = 0
 	    let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
 	endif
-	let b:PHP_lastindented = v:lnum
+	let real_PHP_lastindented = v:lnum
 	let b:PHP_LastIndentedWasComment=0
 	let b:PHP_InsideMultilineComment=0
 	let b:PHP_indentbeforelast = 0
@@ -430,9 +430,12 @@ function! GetPhpIndent()
 
     elseif v:lnum > b:PHP_lastindented
 	let real_PHP_lastindented = b:PHP_lastindented
-	let b:PHP_lastindented = v:lnum
+    else
+	let real_PHP_lastindented = v:lnum
     endif
 
+    let b:PHP_lastindented = v:lnum
+
 
     if !b:InPHPcode_checked " {{{ One time check
 	let b:InPHPcode_checked = 1
@@ -443,11 +446,15 @@ function! GetPhpIndent()
 	endif
 
 	if synname!=""
-	    if synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
+	    if synname == "SpecStringEntrails"
+		let b:InPHPcode = -1 " thumb down
+		let b:UserIsTypingComment = 0
+		let b:InPHPcode_tofind = ""
+	    elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
 		let b:InPHPcode = 1
 		let b:InPHPcode_tofind = ""
 
-		if synname =~# "^phpComment"
+		if synname =~# '^php\%(Doc\)\?Comment'
 		    let b:UserIsTypingComment = 1
 		else
 		    let b:UserIsTypingComment = 0
@@ -483,9 +490,16 @@ function! GetPhpIndent()
 
     if b:InPHPcode_tofind!=""
 	if cline =~? b:InPHPcode_tofind
-	    let b:InPHPcode = 1
 	    let b:InPHPcode_tofind = ""
 	    let b:UserIsTypingComment = 0
+
+	    if b:InPHPcode == -1
+		let b:InPHPcode = 1
+		return -1
+	    end
+
+	    let b:InPHPcode = 1
+
 	    if cline =~ '\*/'
 		call cursor(v:lnum, 1)
 		if cline !~ '^\*/'
@@ -510,7 +524,7 @@ function! GetPhpIndent()
 	endif
     endif
 
-    if b:InPHPcode
+    if 1 == b:InPHPcode
 
 	if !b:InPHPcode_and_script && last_line =~ '\%(<?.*\)\@<!?>\%(.*<?\)\@!' && IslinePHP(lnum, '?>')=~"Delimiter"
 	    if cline !~? s:PHP_startindenttag
@@ -520,8 +534,8 @@ function! GetPhpIndent()
 		let b:InPHPcode_and_script = 1
 	    endif
 
-	elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
-	    let b:InPHPcode = 0
+	elseif last_line =~ '^[^''"`]\+[''"`]$'
+	    let b:InPHPcode = -1
 	    let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
 	elseif last_line =~? '<<<''\=\a\w*''\=$'
 	    let b:InPHPcode = 0
@@ -538,7 +552,7 @@ function! GetPhpIndent()
     endif " }}}
 
 
-    if !b:InPHPcode && !b:InPHPcode_and_script
+    if 1 > b:InPHPcode && !b:InPHPcode_and_script
 	return -1
     endif
 
@@ -568,7 +582,7 @@ function! GetPhpIndent()
 	endif
     endif
 
-    if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' && cline !~ '\*/\s*$'
+    if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*\%(.*\*/\)\@!'
 	if getline(v:lnum + 1) !~ '^\s*\*'
 	    return -1
 	endif
@@ -669,17 +683,17 @@ function! GetPhpIndent()
 	endwhile
 
     elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
-	let ind = ind + &sw " we indent one level further when the preceding line is not stated
+	let ind = ind + &sw
 	return ind + addSpecial
 
-    elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated " Added || last_line =~ '^)' on 2007-12-30 (array indenting problem broke other things)
+    elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
 	let previous_line = last_line
 	let last_line_num = lnum
 	let LastLineClosed = 1
 
 	let isSingleLineBlock = 0
 	while 1
-	    if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
+	    if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
 
 		call cursor(last_line_num, 1)
 		if previous_line !~ '^}'
@@ -740,14 +754,19 @@ function! GetPhpIndent()
 	endif
     endif
 
-    let plinnum = GetLastRealCodeLNum(lnum - 1)
+    if (last_line !~ '^\s*}\%(}}\)\@!')
+	let plinnum = GetLastRealCodeLNum(lnum - 1)
+    else
+	let plinnum = GetLastRealCodeLNum(FindOpenBracket(lnum, 1) - 1)
+    endif
+
     let AntepenultimateLine = getline(plinnum)
 
     let last_line = substitute(last_line,"\\(//\\|#\\)\\(\\(\\([^\"']*\\([\"']\\)[^\"']*\\5\\)\\+[^\"']*$\\)\\|\\([^\"']*$\\)\\)",'','')
 
 
     if ind == b:PHP_default_indenting
-	if last_line =~ terminated
+	if last_line =~ terminated && last_line !~# s:defaultORcase
 	    let LastLineClosed = 1
 	endif
     endif
@@ -755,10 +774,10 @@ function! GetPhpIndent()
     if !LastLineClosed
 
 
-	if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(]'.endline
+	if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
 
 	    let dontIndent = 0
-	    if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
+	    if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
 		let dontIndent = 1
 	    endif
 
@@ -774,7 +793,7 @@ function! GetPhpIndent()
 
 	elseif last_line =~ '\S\+\s*),'.endline
 	    call cursor(lnum, 1)
-	    call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
+	    call search('),'.endline, 'W')
 	    let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
 	    if openedparent != lnum
 		let ind = indent(openedparent)
@@ -784,7 +803,7 @@ function! GetPhpIndent()
 	    let ind = ind + &sw
 
 
-	elseif AntepenultimateLine =~ '\%(;\%(\s*\%(?>\|}\)\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . s:defaultORcase
+    elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
 	    let ind = ind + &sw
 	endif
 
diff --git a/runtime/macros/editexisting.vim b/runtime/macros/editexisting.vim
index c18f22569f..3530e29dc4 100644
--- a/runtime/macros/editexisting.vim
+++ b/runtime/macros/editexisting.vim
@@ -1,6 +1,6 @@
 " Vim Plugin:	Edit the file with an existing Vim if possible
 " Maintainer:	Bram Moolenaar
-" Last Change:	2013 Feb 24
+" Last Change:	2014 Dec 06
 
 " This is a plugin, drop it in your (Unix) ~/.vim/plugin or (Win32)
 " $VIM/vimfiles/plugin directory.  Or make a symbolic link, so that you
@@ -112,7 +112,7 @@ func! EditExisting(fname, command)
   endif
 
   if a:command != ''
-    exe "normal " . a:command
+    exe "normal! " . a:command
   endif
 
   redraw
diff --git a/runtime/syntax/zimbu.vim b/runtime/syntax/zimbu.vim
index c859a2f815..1a7a485e6f 100644
--- a/runtime/syntax/zimbu.vim
+++ b/runtime/syntax/zimbu.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:	Zimbu
 " Maintainer:	Bram Moolenaar
-" Last Change:	2012 Jun 01
+" Last Change:	2014 Nov 23
 
 if exists("b:current_syntax")
   finish
@@ -12,7 +12,10 @@ syn include @Ccode syntax/c.vim
 syn keyword zimbuTodo		TODO FIXME XXX contained
 syn match   zimbuNoBar          "|" contained
 syn match   zimbuParam  	"|[^| ]\+|" contained contains=zimbuNoBar
-syn match   zimbuComment	"#.*$" contains=zimbuTodo,zimbuParam,@Spell
+syn match   zimbuNoBacktick     "`" contained
+syn match   zimbuCode  		"`[^`]\+`" contained contains=zimbuNoBacktick
+syn match   zimbuComment	"#.*$" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell
+syn match   zimbuComment	"/\*.\{-}\*/" contains=zimbuTodo,zimbuParam,zimbuCode,@Spell
 
 syn match   zimbuChar	"'\\\=.'"
 
@@ -28,27 +31,32 @@ syn keyword zimbuBasicType	fixed1 fixed2 fixed3 fixed4 fixed5 fixed6
 syn keyword zimbuBasicType	fixed7 fixed8 fixed9 fixed10 fixed11 fixed12
 syn keyword zimbuBasicType	fixed13 fixed14 fixed15
 
-syn keyword zimbuCompType	string stringval cstring varstring
-syn keyword zimbuCompType	bytes varbytes
-syn keyword zimbuCompType	tuple array list dict multiDict set multiSet
+syn keyword zimbuCompType	string varString
+syn keyword zimbuCompType	byteString varByteString
+syn keyword zimbuCompType	tuple array list dict dictList set callback
+syn keyword zimbuCompType	sortedList multiDict multiDictList multiSet
 syn keyword zimbuCompType	complex complex32 complex64 complex80 complex128
 syn keyword zimbuCompType	proc func def thread evalThread lock cond pipe
 
-syn keyword zimbuType   VAR ANY USE GET
+syn keyword zimbuType   VAR dyn type USE GET
 syn match zimbuType	"IO.File"
 syn match zimbuType	"IO.Stat"
 
-syn keyword zimbuStatement IF ELSE ELSEIF WHILE REPEAT FOR IN TO STEP
+syn keyword zimbuStatement IF ELSE ELSEIF IFNIL WHILE REPEAT FOR IN TO STEP
 syn keyword zimbuStatement DO UNTIL SWITCH WITH
 syn keyword zimbuStatement TRY CATCH FINALLY
 syn keyword zimbuStatement GENERATE_IF GENERATE_ELSE GENERATE_ELSEIF
+syn keyword zimbuStatement GENERATE_ERROR
+syn keyword zimbuStatement BUILD_IF BUILD_ELSE BUILD_ELSEIF
 syn keyword zimbuStatement CASE DEFAULT FINAL ABSTRACT VIRTUAL DEFINE REPLACE
 syn keyword zimbuStatement IMPLEMENTS EXTENDS PARENT LOCAL
-syn keyword zimbuStatement PART ALIAS CONNECT WRAP
+syn keyword zimbuStatement PART ALIAS TYPE CONNECT WRAP
 syn keyword zimbuStatement BREAK CONTINUE PROCEED
-syn keyword zimbuStatement RETURN EXIT THROW
+syn keyword zimbuStatement RETURN EXIT THROW DEFER
 syn keyword zimbuStatement IMPORT AS OPTIONS MAIN
-syn keyword zimbuStatement INTERFACE MODULE ENUM BITS SHARED
+syn keyword zimbuStatement INTERFACE PIECE INCLUDE MODULE ENUM BITS
+syn keyword zimbuStatement SHARED STATIC
+syn keyword zimbuStatement LAMBDA
 syn match zimbuStatement "\<\(FUNC\|PROC\|DEF\)\>"
 syn match zimbuStatement "\<CLASS\>"
 syn match zimbuStatement "}"
@@ -61,10 +69,13 @@ syn match zimbuAttribute "@default\>"
 syn match zimbuAttribute "@define\>"
 syn match zimbuAttribute "@replace\>"
 syn match zimbuAttribute "@final\>"
+syn match zimbuAttribute "@primitive\>"
+syn match zimbuAttribute "@notOnExit\>"
 
 syn match zimbuAttribute "@private\>"
 syn match zimbuAttribute "@protected\>"
 syn match zimbuAttribute "@public\>"
+syn match zimbuAttribute "@local\>"
 syn match zimbuAttribute "@file\>"
 syn match zimbuAttribute "@directory\>"
 syn match zimbuAttribute "@read=private\>"
@@ -78,15 +89,22 @@ syn match zimbuAttribute "@items=public\>"
 syn match zimbuAttribute "@items=file\>"
 syn match zimbuAttribute "@items=directory\>"
 
-syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET
+syn keyword zimbuMethod NEW EQUAL COPY COMPARE SIZE GET SET INIT EARLYINIT
 
 syn keyword zimbuOperator IS ISNOT ISA ISNOTA
 
-syn keyword zimbuModule  ARG CHECK E IO PROTO SYS HTTP ZC ZWT TIME THREAD
+syn keyword zimbuModule  ARG CHECK E GC IO LOG PROTO SYS HTTP ZC ZWT T TIME THREAD
 
-syn match zimbuString  +"\([^"\\]\|\\.\)*\("\|$\)+
+syn match zimbuImport  "\.\zsPROTO"
+syn match zimbuImport  "\.\zsCHEADER"
+
+"syn match zimbuString  +"\([^"\\]\|\\.\)*\("\|$\)+ contains=zimbuStringExpr
+syn region zimbuString  start=+"+  skip=+[^"\\]\|\\.+ end=+"\|$+ contains=zimbuStringExpr
 syn match zimbuString  +R"\([^"]\|""\)*\("\|$\)+
-syn region zimbuString  start=+'''+ end=+'''+
+syn region zimbuLongString  start=+''"+ end=+"''+
+syn match zimbuStringExpr +\\([^)]*)+hs=s+2,he=e-1 contained contains=zimbuString,zimbuParenPairOuter
+syn region zimbuParenPairOuter  start=+(+ms=s+1  end=+)+me=e-1 contained contains=zimbuString,zimbuParenPair
+syn region zimbuParenPair  start=+(+  end=+)+ contained contains=zimbuString,zimbuParenPair
 
 syn keyword zimbuFixed  TRUE FALSE NIL THIS THISTYPE FAIL OK
 syn keyword zimbuError  NULL
@@ -97,12 +115,18 @@ syn match   zimbuSpaceError   display excludenl "\S\s\+$"ms=s+1
 syn match   zimbuSpaceError   display " \+\t"
 syn match   zimbuSpaceError   display "\t\+ "
 
-syn match zimbuUses contained "uses([a-zA-Z_ ,]*)"
+syn match zimbuUses contained "\<uses([a-zA-Z_ ,]*)"
+syn match zimbuBlockgc contained "blockgc"
 syn match zimbuBlockComment contained " #.*"
 
-syn region zimbuCregion matchgroup=zimbuCblock start="^>>>" end="^<<<.*" contains=@Ccode,zimbuUses,zimbuBlockComment keepend
+syn region zimbuCregion matchgroup=zimbuCblock start="^>>>" end="^<<<.*" contains=@Ccode,zimbuUses,zimbuBlockgc,zimbuBlockComment keepend
+
+" Assume long strings and C regions don't take more than 200 lines.
+syn sync minlines=200
 
-syn sync minlines=2000
+" When we find the start of a long string, without a # or " before it, we are
+" sure to be inside a long string.
+syn sync match zimbuLongStringSync grouphere zimbuLongString +^[^"#]*''\"+
 
 hi def link zimbuBasicType	Type
 hi def link zimbuCompType	Type
@@ -111,17 +135,23 @@ hi def link zimbuStatement	Statement
 hi def link zimbuOperator	Statement
 hi def link zimbuMethod		PreProc
 hi def link zimbuModule		PreProc
+hi def link zimbuImport		PreProc
 hi def link zimbuUses		PreProc
+hi def link zimbuBlockgc	PreProc
 hi def link zimbuAttribute	PreProc
 hi def link zimbuString		Constant
+hi def link zimbuLongString	Special
 hi def link zimbuChar		Constant
 hi def link zimbuFixed		Constant
 hi def link zimbuComment	Comment
+hi def link zimbuCommentStart	zimbuComment
 hi def link zimbuBlockComment	Comment
 hi def link zimbuCblock		Comment
 hi def link zimbuTodo		Todo
 hi def link zimbuParam		Constant
+hi def link zimbuCode		Statement
 hi def link zimbuNoBar		Ignore
+hi def link zimbuNoBacktick	Ignore
 hi def link zimbuSpaceError	Error
 hi def link zimbuError		Error
 

From 75c2f76608deb3a0d2fd1224e48a55e9d437156a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 7 Dec 2014 00:18:33 +0100
Subject: [PATCH 331/473] updated for version 7.4.541 Problem:    Crash when
 doing a range assign. Solution:   Check for NULL poiter. (Yukihiro Nakadaira)

---
 src/eval.c            | 2 +-
 src/testdir/test55.in | 5 +++++
 src/testdir/test55.ok | 1 +
 src/version.c         | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index 840e1e8f82..5c584dead5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2951,7 +2951,7 @@ set_var_lval(lp, endp, rettv, copy, op)
 	/*
 	 * Check whether any of the list items is locked
 	 */
-	for (ri = rettv->vval.v_list->lv_first; ri != NULL; )
+	for (ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; )
 	{
 	    if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
 		return;
diff --git a/src/testdir/test55.in b/src/testdir/test55.in
index 140cb7c0e5..c4e82d429c 100644
--- a/src/testdir/test55.in
+++ b/src/testdir/test55.in
@@ -401,6 +401,11 @@ let l = [0, 1, 2, 3]
 :  $put =v:exception[:15] . v:exception[-1:-1]
 :endtry
 :$put =string(d)
+:"
+:" test for range assign
+:let l = [0]
+:let l[:] = [1, 2]
+:$put =string(l)
 :endfun
 :"
 :call Test(1, 2, [3, 4], {5: 6})  " This may take a while
diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok
index e8560de401..ba029b2898 100644
--- a/src/testdir/test55.ok
+++ b/src/testdir/test55.ok
@@ -129,6 +129,7 @@ caught a:000[3]
 {'a': {'b': 'B'}}
 Vim(call):E737: a
 {'a': {'b': 'B'}}
+[1, 2]
 Vim(foldopen):E490:
 
 
diff --git a/src/version.c b/src/version.c
index 57b5d76421..451b837dc3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    541,
 /**/
     540,
 /**/

From b7c8de674b227c674c4ec9a3a174b0059b0dd6e9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 7 Dec 2014 00:18:33 +0100
Subject: [PATCH 332/473] Added tag v7-4-541 for changeset 9fbb9c60ab41

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5134803d3d..fb7636f90f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3263,3 +3263,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 3421b24e419c935f3914a4bf7eb6d3b1de3d618f v7-4-538
 77fe94082f5396c2e40f732b30c9d76984969694 v7-4-539
 93aca8cdd7b8cc1d9e921e243c7c2b6c7fd5f730 v7-4-540
+9fbb9c60ab41765a0d9f02b0b6d48cabe7270f0e v7-4-541

From 5c370dca090d5ac36cf988750235468abe420dec Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 8 Dec 2014 04:16:44 +0100
Subject: [PATCH 333/473] updated for version 7.4.542 Problem:    Using a range
 for window and buffer commands has a few problems. 	    Cannot specify the
 type of range for a user command. Solution:   Add the -addr argument for user
 commands.  Fix problems. (Marcin 	    Szamotulski)

---
 runtime/doc/map.txt               |  13 ++
 src/Makefile                      |   1 +
 src/ex_cmds.h                     |   8 +-
 src/ex_docmd.c                    | 214 ++++++++++++++++++++++++++----
 src/ex_getln.c                    |   1 +
 src/proto/ex_docmd.pro            |   4 +-
 src/testdir/Make_amiga.mak        |   2 +
 src/testdir/Make_dos.mak          |   1 +
 src/testdir/Make_ming.mak         |   1 +
 src/testdir/Make_os2.mak          |   1 +
 src/testdir/Make_vms.mms          |   3 +-
 src/testdir/Makefile              |   1 +
 src/testdir/test_command_count.in |  50 +++++++
 src/testdir/test_command_count.ok |  17 +++
 src/version.c                     |   2 +
 src/vim.h                         |   1 +
 16 files changed, 291 insertions(+), 29 deletions(-)
 create mode 100644 src/testdir/test_command_count.in
 create mode 100644 src/testdir/test_command_count.ok

diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 1be2827c2c..281aa8b142 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1358,6 +1358,19 @@ Possible attributes are:
 Note that -range=N and -count=N are mutually exclusive - only one should be
 specified.
 
+					*E889* *:command-addr*
+It is possible that the special characters in the range like ., $ or % which
+by default correspond to the current line, last line and the whole buffer,
+relate to arguments, (loaded) buffers, windows or tab pages.
+
+Possible values are:
+	-addr=lines		Range of lines (this is the default)
+	-addr=arguments		Range for arguments
+	-addr=buffers		Range for buffers (also not loaded buffers)
+	-addr=loaded_buffers	Range for loaded buffers
+	-addr=windows		Range for windows
+	-addr=tabs		Range for tab pages
+
 Special cases				*:command-bang* *:command-bar*
 					*:command-register* *:command-buffer*
 There are some special cases as well:
diff --git a/src/Makefile b/src/Makefile
index 13fe70b1ad..5a5518d435 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1896,6 +1896,7 @@ test1 \
 	test_breakindent \
 	test_changelist \
 	test_close_count \
+	test_command_count \
 	test_eval \
 	test_insertcount \
 	test_listlbr \
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 5574ea7bc2..fc6a8ac0fa 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -63,7 +63,7 @@
 #define ADDR_WINDOWS		1
 #define ADDR_ARGUMENTS		2
 #define ADDR_LOADED_BUFFERS	3
-#define ADDR_UNLOADED_BUFFERS	4
+#define ADDR_BUFFERS	4
 #define ADDR_TABS		5
 
 #ifndef DO_DECLARE_EXCMD
@@ -161,7 +161,7 @@ EX(CMD_aunmenu,		"aunmenu",	ex_menu,
 			ADDR_LINES),
 EX(CMD_buffer,		"buffer",	ex_buffer,
 			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
-			ADDR_UNLOADED_BUFFERS),
+			ADDR_BUFFERS),
 EX(CMD_bNext,		"bNext",	ex_bprevious,
 			BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
 			ADDR_LINES),
@@ -227,7 +227,7 @@ EX(CMD_bunload,		"bunload",	ex_bunload,
 			ADDR_LOADED_BUFFERS),
 EX(CMD_bwipeout,	"bwipeout",	ex_bunload,
 			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR,
-			ADDR_UNLOADED_BUFFERS),
+			ADDR_BUFFERS),
 EX(CMD_change,		"change",	ex_change,
 			BANG|WHOLEFOLD|RANGE|COUNT|TRLBAR|CMDWIN|MODIFY,
 			ADDR_LINES),
@@ -1184,7 +1184,7 @@ EX(CMD_saveas,		"saveas",	ex_write,
 			ADDR_LINES),
 EX(CMD_sbuffer,		"sbuffer",	ex_buffer,
 			BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR,
-			ADDR_UNLOADED_BUFFERS),
+			ADDR_BUFFERS),
 EX(CMD_sbNext,		"sbNext",	ex_bprevious,
 			RANGE|NOTADR|COUNT|EDITCMD|TRLBAR,
 			ADDR_LINES),
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 607dbd9eec..0c8123cbc0 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -27,6 +27,7 @@ typedef struct ucmd
     char_u	*uc_rep;	/* The command's replacement string */
     long	uc_def;		/* The default value for a range/count */
     int		uc_compl;	/* completion type */
+    int		uc_addr_type;	/* The command's address type */
 # ifdef FEAT_EVAL
     scid_T	uc_scriptID;	/* SID where the command was defined */
 #  ifdef FEAT_CMDL_COMPL
@@ -2136,7 +2137,11 @@ do_one_cmd(cmdlinep, sourcing,
        )
 	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
     else
+#ifdef FEAT_USR_CMDS
+	if (ea.cmdidx != CMD_USER)
+#endif
 	ea.addr_type = ADDR_LINES;
+    /* ea.addr_type for user commands is set by find_ucmd */
     ea.cmd = cmd;
 
     /* repeat for all ',' or ';' separated addresses */
@@ -2157,7 +2162,7 @@ do_one_cmd(cmdlinep, sourcing,
 		ea.line2 = curwin->w_arg_idx + 1;
 		break;
 	    case ADDR_LOADED_BUFFERS:
-	    case ADDR_UNLOADED_BUFFERS:
+	    case ADDR_BUFFERS:
 		ea.line2 = curbuf->b_fnum;
 		break;
 	    case ADDR_TABS:
@@ -2191,18 +2196,34 @@ do_one_cmd(cmdlinep, sourcing,
 			    buf = buf->b_prev;
 			ea.line2 = buf->b_fnum;
 			break;
-		    case ADDR_UNLOADED_BUFFERS:
+		    case ADDR_BUFFERS:
 			ea.line1 = firstbuf->b_fnum;
 			ea.line2 = lastbuf->b_fnum;
 			break;
 		    case ADDR_WINDOWS:
 		    case ADDR_TABS:
-			errormsg = (char_u *)_(e_invrange);
-			goto doend;
+			if (IS_USER_CMDIDX(ea.cmdidx))
+			{
+			    ea.line1 = 1;
+			    ea.line2 = ea.addr_type == ADDR_WINDOWS
+						  ? LAST_WIN_NR : LAST_TAB_NR;
+			}
+			else
+			{
+			    /* there is no Vim command which uses '%' and
+			     * ADDR_WINDOWS or ADDR_TABS */
+			    errormsg = (char_u *)_(e_invrange);
+			    goto doend;
+			}
 			break;
 		    case ADDR_ARGUMENTS:
-			ea.line1 = 1;
-			ea.line2 = ARGCOUNT;
+			if (ARGCOUNT == 0)
+			    ea.line1 = ea.line2 = 0;
+			else
+			{
+			    ea.line1 = 1;
+			    ea.line2 = ARGCOUNT;
+			}
 			break;
 		}
 		++ea.addr_count;
@@ -2629,8 +2650,41 @@ do_one_cmd(cmdlinep, sourcing,
 
     if ((ea.argt & DFLALL) && ea.addr_count == 0)
     {
+	buf_T	    *buf;
+
 	ea.line1 = 1;
-	ea.line2 = curbuf->b_ml.ml_line_count;
+	switch (ea.addr_type)
+	{
+	    case ADDR_LINES:
+		ea.line2 = curbuf->b_ml.ml_line_count;
+		break;
+	    case ADDR_LOADED_BUFFERS:
+		buf = firstbuf;
+		while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL)
+		    buf = buf->b_next;
+		ea.line1 = buf->b_fnum;
+		buf = lastbuf;
+		while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
+		    buf = buf->b_prev;
+		ea.line2 = buf->b_fnum;
+		break;
+	    case ADDR_BUFFERS:
+		ea.line1 = firstbuf->b_fnum;
+		ea.line2 = lastbuf->b_fnum;
+		break;
+	    case ADDR_WINDOWS:
+		ea.line2 = LAST_WIN_NR;
+		break;
+	    case ADDR_TABS:
+		ea.line2 = LAST_TAB_NR;
+		break;
+	    case ADDR_ARGUMENTS:
+		if (ARGCOUNT == 0)
+		    ea.line1 = ea.line2 = 0;
+		else
+		    ea.line2 = ARGCOUNT;
+		break;
+	}
     }
 
     /* accept numbered register only when no count allowed (:put) */
@@ -3211,6 +3265,7 @@ find_ucmd(eap, p, full, xp, compl)
 			eap->cmdidx = CMD_USER_BUF;
 		    eap->argt = (long)uc->uc_argt;
 		    eap->useridx = j;
+		    eap->addr_type = uc->uc_addr_type;
 
 # ifdef FEAT_CMDL_COMPL
 		    if (compl != NULL)
@@ -3839,7 +3894,7 @@ set_one_cmd_context(xp, buff)
 			return NULL;
 		    }
 
-		    /* For the -complete and -nargs attributes, we complete
+		    /* For the -complete, -nargs and -addr attributes, we complete
 		     * their arguments as well.
 		     */
 		    if (STRNICMP(arg, "complete", p - arg) == 0)
@@ -3854,6 +3909,12 @@ set_one_cmd_context(xp, buff)
 			xp->xp_pattern = p + 1;
 			return NULL;
 		    }
+		    else if (STRNICMP(arg, "addr", p - arg) == 0)
+		    {
+			xp->xp_context = EXPAND_USER_ADDR_TYPE;
+			xp->xp_pattern = p + 1;
+			return NULL;
+		    }
 		    return NULL;
 		}
 		arg = skipwhite(p);
@@ -4264,6 +4325,7 @@ get_address(ptr, addr_type, skip, to_other_file)
     pos_T	pos;
     pos_T	*fp;
     linenr_T	lnum;
+    buf_T	*buf;
 
     cmd = skipwhite(*ptr);
     lnum = MAXLNUM;
@@ -4285,7 +4347,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curwin->w_arg_idx + 1;
 			break;
 		    case ADDR_LOADED_BUFFERS:
-		    case ADDR_UNLOADED_BUFFERS:
+		    case ADDR_BUFFERS:
 			lnum = curbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
@@ -4308,7 +4370,16 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = ARGCOUNT;
 			break;
 		    case ADDR_LOADED_BUFFERS:
-		    case ADDR_UNLOADED_BUFFERS:
+			buf = lastbuf;
+			while (buf->b_ml.ml_mfp == NULL)
+			{
+			    if (buf->b_prev == NULL)
+				break;
+			    buf = buf->b_prev;
+			}
+			lnum = buf->b_fnum;
+			break;
+		    case ADDR_BUFFERS:
 			lnum = lastbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
@@ -4477,7 +4548,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = curwin->w_arg_idx + 1;
 			break;
 		    case ADDR_LOADED_BUFFERS:
-		    case ADDR_UNLOADED_BUFFERS:
+		    case ADDR_BUFFERS:
 			lnum = curbuf->b_fnum;
 			break;
 		    case ADDR_TABS:
@@ -4495,7 +4566,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 	    else
 		n = getdigits(&cmd);
 	    if (addr_type == ADDR_LOADED_BUFFERS
-		    || addr_type == ADDR_UNLOADED_BUFFERS)
+		    || addr_type == ADDR_BUFFERS)
 		lnum = compute_buffer_local_count(addr_type, lnum, (i == '-') ? -1 * n : n);
 	    else if (i == '-')
 		lnum -= n;
@@ -4531,7 +4602,7 @@ get_address(ptr, addr_type, skip, to_other_file)
 			lnum = LAST_WIN_NR;
 		    break;
 		case ADDR_LOADED_BUFFERS:
-		case ADDR_UNLOADED_BUFFERS:
+		case ADDR_BUFFERS:
 		    if (lnum < firstbuf->b_fnum)
 		    {
 			lnum = firstbuf->b_fnum;
@@ -5585,14 +5656,14 @@ get_command_name(xp, idx)
 #endif
 
 #if defined(FEAT_USR_CMDS) || defined(PROTO)
-static int	uc_add_command __ARGS((char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int force));
+static int	uc_add_command __ARGS((char_u *name, size_t name_len, char_u *rep, long argt, long def, int flags, int compl, char_u *compl_arg, int addr_type, int force));
 static void	uc_list __ARGS((char_u *name, size_t name_len));
-static int	uc_scan_attr __ARGS((char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg));
+static int	uc_scan_attr __ARGS((char_u *attr, size_t len, long *argt, long *def, int *flags, int *compl, char_u **compl_arg, int* attr_type_arg));
 static char_u	*uc_split_args __ARGS((char_u *arg, size_t *lenp));
 static size_t	uc_check_code __ARGS((char_u *code, size_t len, char_u *buf, ucmd_T *cmd, exarg_T *eap, char_u **split_buf, size_t *split_len));
 
     static int
-uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
+uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, addr_type, force)
     char_u	*name;
     size_t	name_len;
     char_u	*rep;
@@ -5601,6 +5672,7 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
     int		flags;
     int		compl;
     char_u	*compl_arg;
+    int		addr_type;
     int		force;
 {
     ucmd_T	*cmd = NULL;
@@ -5695,6 +5767,7 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
     cmd->uc_compl_arg = compl_arg;
 # endif
 #endif
+    cmd->uc_addr_type = addr_type;
 
     return OK;
 
@@ -5707,6 +5780,23 @@ uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, force)
 }
 #endif
 
+#if defined(FEAT_USR_CMDS)
+static struct
+{
+    int	    expand;
+    char    *name;
+} addr_type_complete[] =
+{
+    {ADDR_ARGUMENTS, "arguments"},
+    {ADDR_LINES, "lines"},
+    {ADDR_LOADED_BUFFERS, "loaded_buffers"},
+    {ADDR_TABS, "tabs"},
+    {ADDR_BUFFERS, "buffers"},
+    {ADDR_WINDOWS, "windows"},
+    {-1, NULL}
+};
+#endif
+
 #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO)
 /*
  * List of names for completion for ":command" with the EXPAND_ flag.
@@ -5794,7 +5884,7 @@ uc_list(name, name_len)
 
 	    /* Put out the title first time */
 	    if (!found)
-		MSG_PUTS_TITLE(_("\n    Name        Args Range Complete  Definition"));
+		MSG_PUTS_TITLE(_("\n    Name        Args       Address   Complete  Definition"));
 	    found = TRUE;
 	    msg_putchar('\n');
 	    if (got_int)
@@ -5855,6 +5945,20 @@ uc_list(name, name_len)
 		IObuff[len++] = ' ';
 	    } while (len < 11);
 
+	    /* Address Type */
+	    for (j = 0; addr_type_complete[j].expand != -1; ++j)
+		if (addr_type_complete[j].expand != ADDR_LINES
+			&& addr_type_complete[j].expand == cmd->uc_addr_type)
+		{
+		    STRCPY(IObuff + len, addr_type_complete[j].name);
+		    len += (int)STRLEN(IObuff + len);
+		    break;
+		}
+
+	    do {
+		IObuff[len++] = ' ';
+	    } while (len < 21);
+
 	    /* Completion */
 	    for (j = 0; command_complete[j].expand != 0; ++j)
 		if (command_complete[j].expand == cmd->uc_compl)
@@ -5866,7 +5970,7 @@ uc_list(name, name_len)
 
 	    do {
 		IObuff[len++] = ' ';
-	    } while (len < 21);
+	    } while (len < 35);
 
 	    IObuff[len] = '\0';
 	    msg_outtrans(IObuff);
@@ -5906,7 +6010,7 @@ uc_fun_cmd()
 }
 
     static int
-uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
+uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg, addr_type_arg)
     char_u	*attr;
     size_t	len;
     long	*argt;
@@ -5914,6 +6018,7 @@ uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
     int		*flags;
     int		*compl;
     char_u	**compl_arg;
+    int		*addr_type_arg;
 {
     char_u	*p;
 
@@ -6032,6 +6137,20 @@ uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg)
 								      == FAIL)
 		return FAIL;
 	}
+	else if (STRNICMP(attr, "addr", attrlen) == 0)
+	{
+	    *argt |= RANGE;
+	    if (val == NULL)
+	    {
+		EMSG(_("E179: argument required for -addr"));
+		return FAIL;
+	    }
+	    if (parse_addr_type_arg(val, (int)vallen, argt, addr_type_arg)
+								      == FAIL)
+		return FAIL;
+	    if (addr_type_arg != ADDR_LINES)
+		*argt |= (ZEROR | NOTADR) ;
+	}
 	else
 	{
 	    char_u ch = attr[len];
@@ -6060,6 +6179,7 @@ ex_command(eap)
     int	    flags = 0;
     int	    compl = EXPAND_NOTHING;
     char_u  *compl_arg = NULL;
+    int	    addr_type_arg = ADDR_LINES;
     int	    has_attr = (eap->arg[0] == '-');
     int	    name_len;
 
@@ -6070,7 +6190,7 @@ ex_command(eap)
     {
 	++p;
 	end = skiptowhite(p);
-	if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg)
+	if (uc_scan_attr(p, end - p, &argt, &def, &flags, &compl, &compl_arg, &addr_type_arg)
 		== FAIL)
 	    return;
 	p = skipwhite(end);
@@ -6111,7 +6231,7 @@ ex_command(eap)
     }
     else
 	uc_add_command(name, end - name, p, argt, def, flags, compl, compl_arg,
-								eap->forceit);
+								addr_type_arg, eap->forceit);
 }
 
 /*
@@ -6651,6 +6771,17 @@ get_user_commands(xp, idx)
     return NULL;
 }
 
+/*
+ * Function given to ExpandGeneric() to obtain the list of user address type names.
+ */
+    char_u *
+get_user_cmd_addr_type(xp, idx)
+    expand_T	*xp UNUSED;
+    int		idx;
+{
+    return (char_u *)addr_type_complete[idx].name;
+}
+
 /*
  * Function given to ExpandGeneric() to obtain the list of user command
  * attributes.
@@ -6661,8 +6792,8 @@ get_user_cmd_flags(xp, idx)
     int		idx;
 {
     static char *user_cmd_flags[] =
-	{"bang", "bar", "buffer", "complete", "count",
-	    "nargs", "range", "register"};
+	{"addr", "bang", "bar", "buffer", "complete",
+	    "count", "nargs", "range", "register"};
 
     if (idx >= (int)(sizeof(user_cmd_flags) / sizeof(user_cmd_flags[0])))
 	return NULL;
@@ -6696,6 +6827,43 @@ get_user_cmd_complete(xp, idx)
 }
 # endif /* FEAT_CMDL_COMPL */
 
+/*
+ * Parse address type argument
+ */
+    int
+parse_addr_type_arg(value, vallen, argt, addr_type_arg)
+    char_u	*value;
+    int		vallen;
+    long	*argt;
+    int		*addr_type_arg;
+{
+    int	    i, a, b;
+    for (i = 0; addr_type_complete[i].expand != -1; ++i)
+    {
+	a = (int)STRLEN(addr_type_complete[i].name) == vallen;
+	b = STRNCMP(value, addr_type_complete[i].name, vallen) == 0;
+	if (a && b)
+	{
+	    *addr_type_arg = addr_type_complete[i].expand;
+	    break;
+	}
+    }
+
+    if (addr_type_complete[i].expand == -1)
+    {
+	char_u	*err = value;
+	for (i=0; err[i] == NUL || !vim_iswhite(err[i]); i++);
+	err[i] = NUL;
+	EMSG2(_("E180: Invalid address type value: %s"), err);
+	return FAIL;
+    }
+
+    if (*addr_type_arg != ADDR_LINES)
+	*argt |= NOTADR;
+
+    return OK;
+}
+
 #endif	/* FEAT_USR_CMDS */
 
 #if defined(FEAT_USR_CMDS) || defined(FEAT_EVAL) || defined(PROTO)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 8ebcc889c3..d8db15abf6 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4697,6 +4697,7 @@ ExpandFromContext(xp, pat, num_file, file, options)
 #endif
 #ifdef FEAT_USR_CMDS
 	    {EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE},
+	    {EXPAND_USER_ADDR_TYPE, get_user_cmd_addr_type, FALSE, TRUE},
 	    {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE},
 	    {EXPAND_USER_NARGS, get_user_cmd_nargs, FALSE, TRUE},
 	    {EXPAND_USER_COMPLETE, get_user_cmd_complete, FALSE, TRUE},
diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro
index ebc54c9deb..a998480eaf 100644
--- a/src/proto/ex_docmd.pro
+++ b/src/proto/ex_docmd.pro
@@ -19,9 +19,11 @@ char_u *get_command_name __ARGS((expand_T *xp, int idx));
 void ex_comclear __ARGS((exarg_T *eap));
 void uc_clear __ARGS((garray_T *gap));
 char_u *get_user_commands __ARGS((expand_T *xp, int idx));
+char_u *get_user_cmd_addr_type __ARGS((expand_T *xp, int idx));
 char_u *get_user_cmd_flags __ARGS((expand_T *xp, int idx));
 char_u *get_user_cmd_nargs __ARGS((expand_T *xp, int idx));
 char_u *get_user_cmd_complete __ARGS((expand_T *xp, int idx));
+int parse_addr_type_arg __ARGS((char_u *value, int vallen, long *argt, int *addr_type_arg));
 int parse_compl_arg __ARGS((char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg));
 void not_exiting __ARGS((void));
 void tabpage_close __ARGS((int forceit));
@@ -43,6 +45,7 @@ void free_cd_dir __ARGS((void));
 void post_chdir __ARGS((int local));
 void ex_cd __ARGS((exarg_T *eap));
 void do_sleep __ARGS((long msec));
+void ex_may_print __ARGS((exarg_T *eap));
 int vim_mkdir_emsg __ARGS((char_u *name, int prot));
 FILE *open_exfile __ARGS((char_u *fname, int forceit, char *mode));
 void update_topline_cursor __ARGS((void));
@@ -54,5 +57,4 @@ int put_eol __ARGS((FILE *fd));
 int put_line __ARGS((FILE *fd, char *s));
 void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
 char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
-void ex_may_print __ARGS((exarg_T *eap));
 /* vim: set ft=c : */
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index a2e5db3b87..9ce3578588 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -41,6 +41,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_breakindent.out \
 		test_changelist.out \
 		test_close_count.out \
+		test_command_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
@@ -178,6 +179,7 @@ test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
 test_changelist.out: test_changelist.in
 test_close_count.out: test_close_count.in
+test_command_count.out: test_command_count.in
 test_eval.out: test_eval.in
 test_insertcount.out: test_insertcount.in
 test_listlbr.out: test_listlbr.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index d2e070ba0c..b1b5b19dbd 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -40,6 +40,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_breakindent.out \
 		test_changelist.out \
 		test_close_count.out \
+		test_command_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 4a99cb915d..28a3640c56 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -62,6 +62,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_breakindent.out \
 		test_changelist.out \
 		test_close_count.out \
+		test_command_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 7a2571b499..a01dedf834 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -42,6 +42,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_breakindent.out \
 		test_changelist.out \
 		test_close_count.out \
+		test_command_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 93aa874019..8eecd51a2a 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Nov 27
+# Last change:  2014 Dec 08
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -101,6 +101,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_breakindent.out \
 	 test_changelist.out \
 	 test_close_count.out \
+	 test_command_count.out \
 	 test_eval.out \
 	 test_insertcount.out \
 	 test_listlbr.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index aa0ef1ff1f..8f9e33c6ee 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -38,6 +38,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_breakindent.out \
 		test_changelist.out \
 		test_close_count.out \
+		test_command_count.out \
 		test_eval.out \
 		test_insertcount.out \
 		test_listlbr.out \
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
new file mode 100644
index 0000000000..cca178e5cf
--- /dev/null
+++ b/src/testdir/test_command_count.in
@@ -0,0 +1,50 @@
+Test for user command counts	    vim: set ft=vim :
+
+STARTTEST
+:let g:lines = []
+:so tiny.vim
+:com -range RangeLines :call add(g:lines, 'Rangeg:Lines '.<line1>.' '.<line2>)
+:com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
+:com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
+:com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>)
+:com -range=% -addr=loaded_buffers RangeLoadedBuffersAll :call add(g:lines, 'RangeLoadedBuffersAll '.<line1>.' '.<line2>)
+:com -range -addr=buffers RangeBuffers :call add(g:lines, 'RangeBuffers '.<line1>.' '.<line2>)
+:com -range=% -addr=buffers RangeBuffersAll :call add(g:lines, 'RangeBuffersAll '.<line1>.' '.<line2>)
+:com -range -addr=windows RangeWindows :call add(g:lines, 'RangeWindows '.<line1>.' '.<line2>)
+:com -range=% -addr=windows RangeWindowsAll :call add(g:lines, 'RangeWindowsAll '.<line1>.' '.<line2>)
+:com -range -addr=tabs RangeTabs :call add(g:lines, 'RangeTabs '.<line1>.' '.<line2>)
+:com -range=% -addr=tabs RangeTabsAll :call add(g:lines, 'RangeTabsAll '.<line1>.' '.<line2>)
+:set hidden
+:arga a b c d
+:argdo echo "loading buffers"
+:argu 3
+:.-,$-RangeArguments
+:%RangeArguments
+:RangeArgumentsAll
+:N
+:.RangeArguments
+:split|split|split|split
+:3wincmd w
+:.,$RangeWindows
+:%RangeWindows
+:RangeWindowsAll
+:only
+:blast|bd
+:.,$RangeLoadedBuffers
+:%RangeLoadedBuffers
+:RangeLoadedBuffersAll
+:.,$RangeBuffers
+:%RangeBuffers
+:RangeBuffersAll
+:tabe|tabe|tabe|tabe
+:normal 2gt
+:.,$RangeTabs
+:%RangeTabs
+:RangeTabsAll
+:1tabonly
+:e! test.out
+:call append(0, g:lines)
+:w|qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
new file mode 100644
index 0000000000..11e88b3903
--- /dev/null
+++ b/src/testdir/test_command_count.ok
@@ -0,0 +1,17 @@
+RangeArguments 2 4
+RangeArguments 1 5
+RangeArgumentsAll 1 5
+RangeArguments 2 2
+RangeWindows 3 5
+RangeWindows 1 5
+RangeWindowsAll 1 5
+RangeLoadedBuffers 2 4
+RangeLoadedBuffers 1 4
+RangeLoadedBuffersAll 1 4
+RangeBuffers 2 5
+RangeBuffers 1 5
+RangeBuffersAll 1 5
+RangeTabs 2 5
+RangeTabs 1 5
+RangeTabsAll 1 5
+
diff --git a/src/version.c b/src/version.c
index 451b837dc3..3f439802cc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    542,
 /**/
     541,
 /**/
diff --git a/src/vim.h b/src/vim.h
index 7f3e393d53..ea53e00cd5 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -798,6 +798,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define EXPAND_HISTORY		41
 #define EXPAND_USER		42
 #define EXPAND_SYNTIME		43
+#define EXPAND_USER_ADDR_TYPE	44
 
 /* Values for exmode_active (0 is no exmode) */
 #define EXMODE_NORMAL		1

From f4bab89e3be1be0caa375025f9942e4901e2c900 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Mon, 8 Dec 2014 04:16:45 +0100
Subject: [PATCH 334/473] Added tag v7-4-542 for changeset de877dab1c31

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index fb7636f90f..e54387da7a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3264,3 +3264,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 77fe94082f5396c2e40f732b30c9d76984969694 v7-4-539
 93aca8cdd7b8cc1d9e921e243c7c2b6c7fd5f730 v7-4-540
 9fbb9c60ab41765a0d9f02b0b6d48cabe7270f0e v7-4-541
+de877dab1c3163a95ac8e7d3d6c3083a64e3c093 v7-4-542

From 85aef53db8c5229a3ed851f25bb876c59da22be5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:17:11 +0100
Subject: [PATCH 335/473] =?UTF-8?q?updated=20for=20version=207.4.543=20Pro?=
 =?UTF-8?q?blem:=20=20=20=20Since=20patch=207.4.232=20"1,3s/\n//"=20joins?=
 =?UTF-8?q?=20two=20lines=20instead=20of=20three.=20=09=20=20=20=20(Eliseo?=
 =?UTF-8?q?=20Mart=C3=ADnez)=20=20Issue=20287=20Solution:=20=20=20Correct?=
 =?UTF-8?q?=20the=20line=20count.=20(Christian=20Brabandt)=20=09=20=20=20?=
 =?UTF-8?q?=20Also=20set=20the=20last=20used=20search=20pattern.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/ex_cmds.c        | 27 +++++++++++++++++++++++----
 src/proto/search.pro |  1 +
 src/search.c         |  3 +--
 src/version.c        |  2 ++
 4 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 86dab4797d..8195eb71b8 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -4408,6 +4408,8 @@ do_sub(eap)
 	    && (*cmd == NUL || (cmd[1] == NUL && (*cmd == 'g' || *cmd == 'l'
 					     || *cmd == 'p' || *cmd == '#'))))
     {
+	linenr_T    joined_lines_count;
+
 	curwin->w_cursor.lnum = eap->line1;
 	if (*cmd == 'l')
 	    eap->flags = EXFLAG_LIST;
@@ -4416,10 +4418,27 @@ do_sub(eap)
 	else if (*cmd == 'p')
 	    eap->flags = EXFLAG_PRINT;
 
-	(void)do_join(eap->line2 - eap->line1 + 1, FALSE, TRUE, FALSE, TRUE);
-	sub_nlines = sub_nsubs = eap->line2 - eap->line1 + 1;
-	(void)do_sub_msg(FALSE);
-	ex_may_print(eap);
+	/* The number of lines joined is the number of lines in the range plus
+	 * one.  One less when the last line is included. */
+	joined_lines_count = eap->line2 - eap->line1 + 1;
+	if (eap->line2 < curbuf->b_ml.ml_line_count)
+	    ++joined_lines_count;
+	if (joined_lines_count > 1)
+	{
+	    (void)do_join(joined_lines_count, FALSE, TRUE, FALSE, TRUE);
+	    sub_nsubs = joined_lines_count - 1;
+	    sub_nlines = 1;
+	    (void)do_sub_msg(FALSE);
+	    ex_may_print(eap);
+	}
+
+	if (!cmdmod.keeppatterns)
+	    save_re_pat(RE_SUBST, pat, p_magic);
+#ifdef FEAT_CMDHIST
+	/* put pattern in history */
+	add_to_history(HIST_SEARCH, pat, TRUE, NUL);
+#endif
+
 	return;
     }
 
diff --git a/src/proto/search.pro b/src/proto/search.pro
index f94fb69ab2..07f608789d 100644
--- a/src/proto/search.pro
+++ b/src/proto/search.pro
@@ -2,6 +2,7 @@
 int search_regcomp __ARGS((char_u *pat, int pat_save, int pat_use, int options, regmmatch_T *regmatch));
 char_u *get_search_pat __ARGS((void));
 char_u *reverse_text __ARGS((char_u *s));
+void save_re_pat __ARGS((int idx, char_u *pat, int magic));
 void save_search_patterns __ARGS((void));
 void restore_search_patterns __ARGS((void));
 void free_search_patterns __ARGS((void));
diff --git a/src/search.c b/src/search.c
index 047a733972..b64b8f6ce7 100644
--- a/src/search.c
+++ b/src/search.c
@@ -12,7 +12,6 @@
 
 #include "vim.h"
 
-static void save_re_pat __ARGS((int idx, char_u *pat, int magic));
 #ifdef FEAT_EVAL
 static void set_vv_searchforward __ARGS((void));
 static int first_submatch __ARGS((regmmatch_T *rp));
@@ -272,7 +271,7 @@ reverse_text(s)
 }
 #endif
 
-    static void
+    void
 save_re_pat(idx, pat, magic)
     int		idx;
     char_u	*pat;
diff --git a/src/version.c b/src/version.c
index 3f439802cc..fe317d0532 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    543,
 /**/
     542,
 /**/

From 773611bdb8ad1ce9af370ac1bda440602d8c09cc Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:17:11 +0100
Subject: [PATCH 336/473] Added tag v7-4-543 for changeset f673842874b6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e54387da7a..9771e5141f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3265,3 +3265,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 93aca8cdd7b8cc1d9e921e243c7c2b6c7fd5f730 v7-4-540
 9fbb9c60ab41765a0d9f02b0b6d48cabe7270f0e v7-4-541
 de877dab1c3163a95ac8e7d3d6c3083a64e3c093 v7-4-542
+f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543

From fc6cbcba0a77cfc34ce99c26aee63caacf485f3b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:20:14 +0100
Subject: [PATCH 337/473] updated for version 7.4.544 Problem:    Warnings for
 unused arguments when compiling with a combination of 	    features.
 Solution:   Add "UNUSED".

---
 src/if_cscope.c | 4 ++--
 src/version.c   | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/if_cscope.c b/src/if_cscope.c
index 09982e6477..ab31a03519 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1131,8 +1131,8 @@ cs_find_common(opt, pat, forceit, verbose, use_ll, cmdline)
     char *pat;
     int forceit;
     int verbose;
-    int	use_ll;
-    char_u *cmdline;
+    int	use_ll UNUSED;
+    char_u *cmdline UNUSED;
 {
     int i;
     char *cmd;
diff --git a/src/version.c b/src/version.c
index fe317d0532..ba5f6b3bf0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    544,
 /**/
     543,
 /**/

From 3217c2a55f98a3cba4cd029e9e2810d4c34807bd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:20:14 +0100
Subject: [PATCH 338/473] Added tag v7-4-544 for changeset 89143424f604

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9771e5141f..6a18338763 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3266,3 +3266,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 9fbb9c60ab41765a0d9f02b0b6d48cabe7270f0e v7-4-541
 de877dab1c3163a95ac8e7d3d6c3083a64e3c093 v7-4-542
 f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543
+89143424f604cd610f7e709ac683dc28a473e078 v7-4-544

From ce8d288b81631ac147632d639222a1ce3085a19c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:36:39 +0100
Subject: [PATCH 339/473] updated for version 7.4.545 Problem:    Highlighting
 for multi-line matches is not correct. Solution:   Stop highlight at the end
 of the match. (Hirohito Higashi)

---
 src/screen.c  | 8 +++++++-
 src/version.c | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/screen.c b/src/screen.c
index d395138628..e7b8e78d78 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3864,9 +3864,15 @@ win_line(wp, lnum, startrow, endrow, nochange)
 				&& v >= (long)shl->startcol
 				&& v < (long)shl->endcol)
 			{
+#ifdef FEAT_MBYTE
+			    int tmp_col = v + MB_PTR2LEN(ptr);
+
+			    if (shl->endcol < tmp_col)
+				shl->endcol = tmp_col;
+#endif
 			    shl->attr_cur = shl->attr;
 			}
-			else if (v >= (long)shl->endcol && shl->lnum == lnum)
+			else if (v == (long)shl->endcol)
 			{
 			    shl->attr_cur = 0;
 			    next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
diff --git a/src/version.c b/src/version.c
index ba5f6b3bf0..1d63121acd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    545,
 /**/
     544,
 /**/

From 83e72a80ead212568f1b55cc0a54e6d8eecbfeef Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:36:39 +0100
Subject: [PATCH 340/473] Added tag v7-4-545 for changeset d2239abd3edb

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6a18338763..de43f61fd0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3267,3 +3267,4 @@ d51d47bd77c2f042f9893d9c528a5f2fe75eb872 v7-4-536
 de877dab1c3163a95ac8e7d3d6c3083a64e3c093 v7-4-542
 f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543
 89143424f604cd610f7e709ac683dc28a473e078 v7-4-544
+d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545

From baecc1e0305c8f57ef11d0827c0efe219cd74149 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:58:09 +0100
Subject: [PATCH 341/473] updated for version 7.4.546 Problem:    Repeated use
 of vim_snprintf() with a number. Solution:   Move these vim_snprintf() calls
 into a function.

---
 src/version.c |  2 ++
 src/window.c  | 35 +++++++++++++++++++----------------
 2 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/version.c b/src/version.c
index 1d63121acd..94ba992cb5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    546,
 /**/
     545,
 /**/
diff --git a/src/window.c b/src/window.c
index 92fcbbe710..79c97d8a9e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -11,6 +11,7 @@
 
 static int path_is_url __ARGS((char_u *p));
 #if defined(FEAT_WINDOWS) || defined(PROTO)
+static void cmd_with_count __ARGS((char *cmd, char_u *bufp, size_t bufsize, long Prenum));
 static void win_init __ARGS((win_T *newp, win_T *oldp, int flags));
 static void win_init_some __ARGS((win_T *newp, win_T *oldp));
 static void frame_comp_pos __ARGS((frame_T *topfrp, int *row, int *col));
@@ -167,10 +168,7 @@ do_window(nchar, Prenum, xchar)
     case '^':
 		CHECK_CMDWIN
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		STRCPY(cbuf, "split #");
-		if (Prenum)
-		    vim_snprintf((char *)cbuf + 7, sizeof(cbuf) - 7,
-							       "%ld", Prenum);
+		cmd_with_count("split #", cbuf, sizeof(cbuf), Prenum);
 		do_cmdline_cmd(cbuf);
 		break;
 
@@ -199,10 +197,7 @@ do_window(nchar, Prenum, xchar)
     case Ctrl_Q:
     case 'q':
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		STRCPY(cbuf, "quit");
-		if (Prenum)
-		    vim_snprintf((char *)cbuf + 4, sizeof(cbuf) - 5,
-							    "%ld", Prenum);
+		cmd_with_count("quit", cbuf, sizeof(cbuf), Prenum);
 		do_cmdline_cmd(cbuf);
 		break;
 
@@ -210,10 +205,7 @@ do_window(nchar, Prenum, xchar)
     case Ctrl_C:
     case 'c':
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		STRCPY(cbuf, "close");
-		if (Prenum)
-		    vim_snprintf((char *)cbuf + 5, sizeof(cbuf) - 5,
-							       "%ld", Prenum);
+		cmd_with_count("close", cbuf, sizeof(cbuf), Prenum);
 		do_cmdline_cmd(cbuf);
 		break;
 
@@ -243,10 +235,7 @@ do_window(nchar, Prenum, xchar)
     case 'o':
 		CHECK_CMDWIN
 		reset_VIsual_and_resel();	/* stop Visual mode */
-		STRCPY(cbuf, "only");
-		if (Prenum > 0)
-		    vim_snprintf((char *)cbuf + 4, sizeof(cbuf) - 4,
-								"%ld", Prenum);
+		cmd_with_count("only", cbuf, sizeof(cbuf), Prenum);
 		do_cmdline_cmd(cbuf);
 		break;
 
@@ -635,6 +624,20 @@ do_window(nchar, Prenum, xchar)
     }
 }
 
+    static void
+cmd_with_count(cmd, bufp, bufsize, Prenum)
+    char	*cmd;
+    char_u	*bufp;
+    size_t	bufsize;
+    long	Prenum;
+{
+    size_t	len = STRLEN(cmd);
+
+    STRCPY(bufp, cmd);
+    if (Prenum > 0)
+	vim_snprintf((char *)bufp + len, bufsize - len, "%ld", Prenum);
+}
+
 /*
  * split the current window, implements CTRL-W s and :split
  *

From dab52bbe45bef6e6075161bfd8a269735869dfb7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 03:58:10 +0100
Subject: [PATCH 342/473] Added tag v7-4-546 for changeset 84190359b979

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index de43f61fd0..69a3afa6c2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3268,3 +3268,4 @@ de877dab1c3163a95ac8e7d3d6c3083a64e3c093 v7-4-542
 f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543
 89143424f604cd610f7e709ac683dc28a473e078 v7-4-544
 d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
+84190359b9799b0ecb4d9e8e421471e14f659616 v7-4-546

From 1047621ab4820ac085ee826bcf9e5b523790646a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 20:11:33 +0100
Subject: [PATCH 343/473] updated for version 7.4.547 Problem:    Using "vit"
 does not select a multi-byte character at the end 	    correctly.
 Solution:   Advance the cursor over the multi-byte character. (Christian 
     Brabandt)

---
 src/search.c  | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/search.c b/src/search.c
index b64b8f6ce7..e22109817d 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3932,7 +3932,7 @@ current_tagblock(oap, count_arg, include)
 	if (lt(end_pos, start_pos))
 	    curwin->w_cursor = start_pos;
 	else if (*p_sel == 'e')
-	    ++curwin->w_cursor.col;
+	    inc_cursor();
 	VIsual = start_pos;
 	VIsual_mode = 'v';
 	redraw_curbuf_later(INVERTED);	/* update the inversion */
diff --git a/src/version.c b/src/version.c
index 94ba992cb5..7abbfb5915 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    547,
 /**/
     546,
 /**/

From 67ae82d1761e285949b1b75a6a2f146da1e7c86d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 20:11:33 +0100
Subject: [PATCH 344/473] Added tag v7-4-547 for changeset 19726451aabe

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 69a3afa6c2..ed15bbefcb 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3269,3 +3269,4 @@ f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543
 89143424f604cd610f7e709ac683dc28a473e078 v7-4-544
 d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 84190359b9799b0ecb4d9e8e421471e14f659616 v7-4-546
+19726451aabea7e3640c56703846991c35e59e98 v7-4-547

From 1aee7874c61a40972b8ab63838e3f6cef59e6465 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 20:50:09 +0100
Subject: [PATCH 345/473] updated for version 7.4.548 Problem:    Function name
 not recognized correctly when inside a function. Solution:   Don't check for
 an alpha character.

---
 src/Make_cyg_ming.mak | 4 ++++
 src/version.c         | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak
index 455750e33b..1f55a9e6ab 100644
--- a/src/Make_cyg_ming.mak
+++ b/src/Make_cyg_ming.mak
@@ -366,7 +366,11 @@ endif
 endif
 CC := $(CROSS_COMPILE)gcc
 CXX := $(CROSS_COMPILE)g++
+ifeq ($(UNDER_CYGWIN),yes)
 WINDRES := $(CROSS_COMPILE)windres
+else
+WINDRES := windres
+endif
 WINDRES_CC = $(CC)
 
 #>>>>> end of choices
diff --git a/src/version.c b/src/version.c
index 7abbfb5915..05a9875534 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    548,
 /**/
     547,
 /**/

From ad4cd40820e3630337c7855cef096b46126bb567 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 20:50:09 +0100
Subject: [PATCH 346/473] Added tag v7-4-548 for changeset 26a20ce3532c

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ed15bbefcb..5712fefdba 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3270,3 +3270,4 @@ f673842874b6aa9fdbf3f3d9fafc67fe4debcbf6 v7-4-543
 d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 84190359b9799b0ecb4d9e8e421471e14f659616 v7-4-546
 19726451aabea7e3640c56703846991c35e59e98 v7-4-547
+26a20ce3532c5e3f47f12facc28a5477fedc9e31 v7-4-548

From 6a8a4f95a1e69e8dd704b3e759400e0c0606681f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 21:00:55 +0100
Subject: [PATCH 347/473] updated for version 7.4.549 Problem:    Function name
 not recognized correctly when inside a function. Solution:   Don't check for
 an alpha character.

---
 src/eval.c                 | 11 ++++-------
 src/testdir/Make_amiga.mak |  3 +++
 src/testdir/Make_dos.mak   |  1 +
 src/testdir/Make_ming.mak  |  1 +
 src/testdir/Make_os2.mak   |  1 +
 src/testdir/Make_vms.mms   |  3 ++-
 src/testdir/Makefile       |  1 +
 src/version.c              |  2 ++
 8 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index 5c584dead5..fbe824eec1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -22283,14 +22283,11 @@ ex_function(eap)
 		if (*p == '!')
 		    p = skipwhite(p + 1);
 		p += eval_fname_script(p);
-		if (ASCII_ISALPHA(*p))
+		vim_free(trans_function_name(&p, TRUE, 0, NULL));
+		if (*skipwhite(p) == '(')
 		{
-		    vim_free(trans_function_name(&p, TRUE, 0, NULL));
-		    if (*skipwhite(p) == '(')
-		    {
-			++nesting;
-			indent += 2;
-		    }
+		    ++nesting;
+		    indent += 2;
 		}
 	    }
 
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index 9ce3578588..c8becc7a7d 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -47,6 +47,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_mapping.out \
+		test_nested_function.out \
 		test_options.out \
 		test_qf_title.out \
 		test_signs.out \
@@ -184,6 +185,8 @@ test_eval.out: test_eval.in
 test_insertcount.out: test_insertcount.in
 test_listlbr.out: test_listlbr.in
 test_listlbr_utf8.out: test_listlbr_utf8.in
+test_mapping.out: test_mapping.in
+test_nested_function.out: test_nested_function.in
 test_options.out: test_options.in
 test_qf_title.out: test_qf_title.in
 test_signs.out: test_signs.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index b1b5b19dbd..57f85ea67b 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -46,6 +46,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_mapping.out \
+		test_nested_function.out \
 		test_options.out \
 		test_qf_title.out \
 		test_signs.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 28a3640c56..5718d46018 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -68,6 +68,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_mapping.out \
+		test_nested_function.out \
 		test_options.out \
 		test_qf_title.out \
 		test_signs.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index a01dedf834..1ba2dfe946 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -48,6 +48,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_mapping.out \
+		test_nested_function.out \
 		test_options.out \
 		test_qf_title.out \
 		test_signs.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 8eecd51a2a..9fecf9fa63 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -4,7 +4,7 @@
 # Authors:	Zoltan Arpadffy, <arpadffy@polarhome.com>
 #		Sandor Kopanyi,  <sandor.kopanyi@mailbox.hu>
 #
-# Last change:  2014 Dec 08
+# Last change:  2014 Dec 13
 #
 # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
 # Edit the lines in the Configuration section below to select.
@@ -107,6 +107,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test_listlbr.out \
 	 test_listlbr_utf8.out \
 	 test_mapping.out \
+	 test_nested_function.out \
 	 test_options.out \
 	 test_qf_title.out \
 	 test_signs.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 8f9e33c6ee..e76a72b009 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -44,6 +44,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test_listlbr.out \
 		test_listlbr_utf8.out \
 		test_mapping.out \
+		test_nested_function.out \
 		test_options.out \
 		test_qf_title.out \
 		test_signs.out \
diff --git a/src/version.c b/src/version.c
index 05a9875534..1c6bbbda66 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    549,
 /**/
     548,
 /**/

From 3d047e507606b162346a8576b0354ff45a0d1446 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 21:00:56 +0100
Subject: [PATCH 348/473] Added tag v7-4-549 for changeset 1fd9f1d43660

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5712fefdba..eb89be4994 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3271,3 +3271,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 84190359b9799b0ecb4d9e8e421471e14f659616 v7-4-546
 19726451aabea7e3640c56703846991c35e59e98 v7-4-547
 26a20ce3532c5e3f47f12facc28a5477fedc9e31 v7-4-548
+1fd9f1d43660f9645d8dabfd14131371aa2f529f v7-4-549

From ad90354236aff69c7674bef435154227aff37079 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 21:03:10 +0100
Subject: [PATCH 349/473] Add new files for 7.4.549.

---
 src/testdir/test_nested_function.in | 34 +++++++++++++++++++++++++++++
 src/testdir/test_nested_function.ok |  6 +++++
 2 files changed, 40 insertions(+)
 create mode 100644 src/testdir/test_nested_function.in
 create mode 100644 src/testdir/test_nested_function.ok

diff --git a/src/testdir/test_nested_function.in b/src/testdir/test_nested_function.in
new file mode 100644
index 0000000000..534164a50b
--- /dev/null
+++ b/src/testdir/test_nested_function.in
@@ -0,0 +1,34 @@
+Tests for Nested function                vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:fu! NestedFunc()
+:  fu! Func1()
+:    $put ='Func1'
+:  endfunction
+:  call Func1()
+:  fu! s:func2()
+:    $put ='s:func2'
+:  endfunction
+:  call s:func2()
+:  fu! s:_func3()
+:    $put ='s:_func3'
+:  endfunction
+:  call s:_func3()
+:  let fn = 'Func4'
+:  fu! {fn}()
+:    $put ='Func4'
+:  endfunction
+:  call {fn}()
+:  let fn = 'func5'
+:  fu! s:{fn}()
+:    $put ='s:func5'
+:  endfunction
+:  call s:{fn}()
+:endfunction
+:call NestedFunc()
+:/^result:/,$w! test.out
+:qa!
+ENDTEST
+
+result:
diff --git a/src/testdir/test_nested_function.ok b/src/testdir/test_nested_function.ok
new file mode 100644
index 0000000000..c1fd19afe8
--- /dev/null
+++ b/src/testdir/test_nested_function.ok
@@ -0,0 +1,6 @@
+result:
+Func1
+s:func2
+s:_func3
+Func4
+s:func5

From 40037f1eee309dce6b52a715b51016b082b8fcd4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 21:09:57 +0100
Subject: [PATCH 350/473] updated for version 7.4.550 Problem:    curs_rows()
 function is always called with the second argument 	    false. Solution:  
 Remove the argument. (Christian Brabandt) 	    validate_botline_win() can
 then also be removed.

---
 src/move.c    | 26 ++++----------------------
 src/version.c |  2 ++
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/src/move.c b/src/move.c
index 2e0efeca3c..e84f3d57e6 100644
--- a/src/move.c
+++ b/src/move.c
@@ -23,8 +23,7 @@ static void comp_botline __ARGS((win_T *wp));
 static void redraw_for_cursorline __ARGS((win_T *wp));
 static int scrolljump_value __ARGS((void));
 static int check_top_offset __ARGS((void));
-static void curs_rows __ARGS((win_T *wp, int do_botline));
-static void validate_botline_win __ARGS((win_T *wp));
+static void curs_rows __ARGS((win_T *wp));
 static void validate_cheight __ARGS((void));
 
 typedef struct
@@ -608,17 +607,6 @@ validate_botline()
 	comp_botline(curwin);
 }
 
-/*
- * Make sure the value of wp->w_botline is valid.
- */
-    static void
-validate_botline_win(wp)
-    win_T	*wp;
-{
-    if (!(wp->w_valid & VALID_BOTLINE))
-	comp_botline(wp);
-}
-
 /*
  * Mark curwin->w_botline as invalid (because of some change in the buffer).
  */
@@ -678,20 +666,17 @@ validate_cline_row()
     update_topline();
     check_cursor_moved(curwin);
     if (!(curwin->w_valid & VALID_CROW))
-	curs_rows(curwin, FALSE);
+	curs_rows(curwin);
 }
 #endif
 
 /*
  * Compute wp->w_cline_row and wp->w_cline_height, based on the current value
  * of wp->w_topline.
- *
- * Returns OK when cursor is in the window, FAIL when it isn't.
  */
     static void
-curs_rows(wp, do_botline)
+curs_rows(wp)
     win_T	*wp;
-    int		do_botline;		/* also compute w_botline */
 {
     linenr_T	lnum;
     int		i;
@@ -810,9 +795,6 @@ curs_rows(wp, do_botline)
     redraw_for_cursorline(curwin);
     wp->w_valid |= VALID_CROW|VALID_CHEIGHT;
 
-    /* validate botline too, if update_screen doesn't do it */
-    if (do_botline && all_invalid)
-	validate_botline_win(wp);
 }
 
 /*
@@ -986,7 +968,7 @@ curs_columns(may_scroll)
      * Next make sure that w_cline_row is valid.
      */
     if (!(curwin->w_valid & VALID_CROW))
-	curs_rows(curwin, FALSE);
+	curs_rows(curwin);
 
     /*
      * Compute the number of virtual columns.
diff --git a/src/version.c b/src/version.c
index 1c6bbbda66..32fb731575 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    550,
 /**/
     549,
 /**/

From 0d73713627703d58b0bcc2bbce799170aaad34fe Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 21:09:57 +0100
Subject: [PATCH 351/473] Added tag v7-4-550 for changeset 7cda721eadb0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index eb89be4994..94ba2483e9 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3272,3 +3272,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 19726451aabea7e3640c56703846991c35e59e98 v7-4-547
 26a20ce3532c5e3f47f12facc28a5477fedc9e31 v7-4-548
 1fd9f1d43660f9645d8dabfd14131371aa2f529f v7-4-549
+7cda721eadb04f555a912b220c9047f504480bc6 v7-4-550

From 7615df77aa61db4704984bcb23aa07976391b45f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 22:00:22 +0100
Subject: [PATCH 352/473] updated for version 7.4.551 Problem:    "ygn" may
 yank too much. (Fritzophrenic)  Issue 295. Solution:   Check the width of the
 next match. (Christian Brabandt)

---
 src/search.c          | 27 +++++++++++++++++++++------
 src/testdir/test53.in |  7 +++++++
 src/testdir/test53.ok |  6 ++++++
 src/version.c         |  2 ++
 4 files changed, 36 insertions(+), 6 deletions(-)

diff --git a/src/search.c b/src/search.c
index e22109817d..3276a77b7a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4441,12 +4441,11 @@ current_quote(oap, count, include, quotechar)
 
 #endif /* FEAT_TEXTOBJ */
 
-static int is_one_char __ARGS((char_u *pattern));
+static int is_one_char __ARGS((char_u *pattern, int move));
 
 /*
  * Find next search match under cursor, cursor at end.
  * Used while an operator is pending, and in Visual mode.
- * TODO: redo only works when used in operator pending mode
  */
     int
 current_search(count, forward)
@@ -4491,7 +4490,7 @@ current_search(count, forward)
 	orig_pos = pos = start_pos = curwin->w_cursor;
 
     /* Is the pattern is zero-width? */
-    one_char = is_one_char(spats[last_idx].pat);
+    one_char = is_one_char(spats[last_idx].pat, TRUE);
     if (one_char == -1)
     {
 	p_ws = old_p_ws;
@@ -4550,6 +4549,10 @@ current_search(count, forward)
     start_pos = pos;
     flags = forward ? SEARCH_END : 0;
 
+    /* Check again from the current cursor position,
+     * since the next match might actually by only one char wide */
+    one_char = is_one_char(spats[last_idx].pat, FALSE);
+
     /* move to match, except for zero-width matches, in which case, we are
      * already on the next match */
     if (!one_char)
@@ -4599,26 +4602,38 @@ current_search(count, forward)
 
 /*
  * Check if the pattern is one character or zero-width.
+ * If move is TRUE, check from the beginning of the buffer, else from the
+ * current cursor position.
  * Returns TRUE, FALSE or -1 for failure.
  */
     static int
-is_one_char(pattern)
+is_one_char(pattern, move)
     char_u	*pattern;
+    int		move;
 {
     regmmatch_T	regmatch;
     int		nmatched = 0;
     int		result = -1;
     pos_T	pos;
     int		save_called_emsg = called_emsg;
+    int		flag = 0;
 
     if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH,
 					      SEARCH_KEEP, &regmatch) == FAIL)
 	return -1;
 
     /* move to match */
-    clearpos(&pos);
+    if (move)
+	clearpos(&pos)
+    else
+    {
+	pos = curwin->w_cursor;
+	/* accept a match at the cursor position */
+	flag = SEARCH_START;
+    }
+
     if (searchit(curwin, curbuf, &pos, FORWARD, spats[last_idx].pat, 1,
-				     SEARCH_KEEP, RE_SEARCH, 0, NULL) != FAIL)
+			      SEARCH_KEEP + flag, RE_SEARCH, 0, NULL) != FAIL)
     {
 	/* Zero-width pattern should match somewhere, then we can check if
 	 * start and end are in the same position. */
diff --git a/src/testdir/test53.in b/src/testdir/test53.in
index 011c9ae39d..8ca9c9ed29 100644
--- a/src/testdir/test53.in
+++ b/src/testdir/test53.in
@@ -79,6 +79,8 @@ ggdgn.
 :" test repeating gUgn
 /^Depp
 gggUgn.
+gg/a:0\@!\zs\d\+
+nygnop
 :/^start:/,/^end:/wq! test.out
 ENDTEST
 
@@ -108,6 +110,11 @@ delete first and last chars
 uniquepattern uniquepattern
 my very excellent mother just served us nachos
 for (i=0; i<=10; i++)
+a:10
+
+a:1
+
+a:20
 Y
 text
 Y
diff --git a/src/testdir/test53.ok b/src/testdir/test53.ok
index d7ffa6bc51..0c0b9ded16 100644
--- a/src/testdir/test53.ok
+++ b/src/testdir/test53.ok
@@ -49,6 +49,12 @@ elete first and last char
  uniquepattern
 my very excellent mongoose just served us nachos
 for (j=0; i<=10; i++)
+a:10
+
+a:1
+1
+
+a:20
 
 text
 Y
diff --git a/src/version.c b/src/version.c
index 32fb731575..6408d57077 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    551,
 /**/
     550,
 /**/

From 53cdb5f226abed381a0f1401b7f779a2793cacf7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 13 Dec 2014 22:00:22 +0100
Subject: [PATCH 353/473] Added tag v7-4-551 for changeset eb0fb921e197

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 94ba2483e9..34716a0eb3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3273,3 +3273,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 26a20ce3532c5e3f47f12facc28a5477fedc9e31 v7-4-548
 1fd9f1d43660f9645d8dabfd14131371aa2f529f v7-4-549
 7cda721eadb04f555a912b220c9047f504480bc6 v7-4-550
+eb0fb921e197c7b1294e1142479c982d1770eaa0 v7-4-551

From 10586385287cd252f1c882980c44091d1870a244 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 14 Dec 2014 00:43:54 +0100
Subject: [PATCH 354/473] updated for version 7.4.552 Problem:    Langmap
 applies to Insert mode expression mappings. Solution:   Check for Insert
 mode. (Daniel Hahler)

---
 src/getchar.c               | 2 +-
 src/testdir/test_mapping.in | 9 +++++++++
 src/testdir/test_mapping.ok | 2 ++
 src/version.c               | 2 ++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/getchar.c b/src/getchar.c
index c9ee4d0510..174cfa892f 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2145,7 +2145,7 @@ vgetorpeek(advance)
 			    nolmaplen = 2;
 			else
 			{
-			    LANGMAP_ADJUST(c1, TRUE);
+			    LANGMAP_ADJUST(c1, (State & INSERT) == 0);
 			    nolmaplen = 0;
 			}
 #endif
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
index e2572772c1..5f895a46f2 100644
--- a/src/testdir/test_mapping.in
+++ b/src/testdir/test_mapping.in
@@ -8,6 +8,15 @@ STARTTEST
 :inoreab чкпр   vim
 GAчкпр 
 
+
+: " langmap should not get remapped in insert mode
+:inoremap { FAIL_ilangmap
+:set langmap=+{ langnoremap
+o+
+: " expr mapping with langmap
+:inoremap <expr> { "FAIL_iexplangmap"
+o+
+
 :/^test/,$w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
index abdaea6a36..8d94976582 100644
--- a/src/testdir/test_mapping.ok
+++ b/src/testdir/test_mapping.ok
@@ -1,2 +1,4 @@
 test starts here:
 vim
++
++
diff --git a/src/version.c b/src/version.c
index 6408d57077..e8d75252fa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    552,
 /**/
     551,
 /**/

From 274e12884b89888b565aa784e91611ef3741f19f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 14 Dec 2014 00:43:54 +0100
Subject: [PATCH 355/473] Added tag v7-4-552 for changeset c8d6dbdd1156

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 34716a0eb3..9a193726ec 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3274,3 +3274,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 1fd9f1d43660f9645d8dabfd14131371aa2f529f v7-4-549
 7cda721eadb04f555a912b220c9047f504480bc6 v7-4-550
 eb0fb921e197c7b1294e1142479c982d1770eaa0 v7-4-551
+c8d6dbdd11563d39c42f16a80f9c74bc68155f7a v7-4-552

From 4ef3ea7d06794f1e8b4b46bfaa5736a565549386 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 14 Dec 2014 01:27:49 +0100
Subject: [PATCH 356/473] Updated runtime files.

---
 runtime/doc/eval.txt   | 10 +++++++-
 runtime/doc/map.txt    |  2 +-
 runtime/doc/tags       |  2 ++
 runtime/doc/todo.txt   | 57 +++++++++++++++++++++++++-----------------
 runtime/indent/vim.vim |  4 +--
 5 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 21df37f301..69ab0a641b 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Nov 27
+*eval.txt*	For Vim version 7.4.  Last change: 2014 Dec 07
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -2395,6 +2395,10 @@ col({expr})	The result is a Number, which is the byte index of the column
 			    number of bytes in the cursor line plus one)
 		    'x	    position of mark x (if the mark is not set, 0 is
 			    returned)
+		    v       In Visual mode: the start of the Visual area (the
+			    cursor is the end).  When not in Visual mode
+			    returns the cursor position.  Differs from |'<| in
+			    that it's updated right away.
 		Additionally {expr} can be [lnum, col]: a |List| with the line
 		and column number. Most useful when the column is "$", to get
 		the last column of a specific line.  When "lnum" or "col" is
@@ -6418,6 +6422,10 @@ virtcol({expr})						*virtcol()*
 			    plus one)
 		    'x	    position of mark x (if the mark is not set, 0 is
 			    returned)
+		    v       In Visual mode: the start of the Visual area (the
+			    cursor is the end).  When not in Visual mode
+			    returns the cursor position.  Differs from |'<| in
+			    that it's updated right away.
 		Note that only marks in the current file can be used.
 		Examples: >
   virtcol(".")	   with text "foo^Lbar", with cursor on the "^L", returns 5
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 281aa8b142..fb041c6a5e 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt*       For Vim version 7.4.  Last change: 2014 Oct 03
+*map.txt*       For Vim version 7.4.  Last change: 2014 Dec 08
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 9a23ce4cf9..ae7e22f7d8 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -2057,6 +2057,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 :comc	map.txt	/*:comc*
 :comclear	map.txt	/*:comclear*
 :command	map.txt	/*:command*
+:command-addr	map.txt	/*:command-addr*
 :command-bang	map.txt	/*:command-bang*
 :command-bar	map.txt	/*:command-bar*
 :command-buffer	map.txt	/*:command-buffer*
@@ -4335,6 +4336,7 @@ E885	sign.txt	/*E885*
 E886	starting.txt	/*E886*
 E887	if_pyth.txt	/*E887*
 E888	pattern.txt	/*E888*
+E889	map.txt	/*E889*
 E89	message.txt	/*E89*
 E90	message.txt	/*E90*
 E91	options.txt	/*E91*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 04f9a44b95..d114d36c59 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Dec 06
+*todo.txt*      For Vim version 7.4.  Last change: 2014 Dec 14
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -34,19 +34,6 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Patch to fix list range assign crash. (Yukihiro Nakadaira, 2014 Dec 1)
-
-Patch to fix range with user command. (Marcin Szamotulski, 2014 Dec 2)
-Update Dec 6, with support for user commands.
-
-When window number in Ex range is too high, give an error?
-Only when backwards compatible.
-
-:s/\n// doesn't change anything.  Since 7.4.232? (Eliseo Martínez, 2014 Nov
-28)  Patch on Issue 287
-
-Using vim_snprintf() in window.c can be in a function.
-
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
@@ -78,35 +65,41 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
-Patch to fix recognizing function name. (Ozaki Kiichi, 2014 Nov 28)
-
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
-The entries added by matchaddpos() are returned by getmatches() but can't be
-set with setmatches(). (lcd47, 2014 Jun 29)
-
 Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
 
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-Change behavior of v:hlsearch?  Patch from Christian, 2014 Oct 22.
+When window number in Ex range is too high, should give an error:
+    :3close  " fails if there are only 2 windows.
+Patch from Marcin Szamotulski, 2014 Dec 13.
 
 Patch to recover from X server restart: hint on Issue 203 (2014 Nov 21 18:44)
 
+Insert a block with virtualedit set does not work correctly.
+Patch by James McCoy, 2014 Dec 10.
+
 MS-Windows: When editing a file with a leading space, writing it uses the
 wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
 
 Add LessCss support. (Jenoma / Alessandro Vioni, 2014 Nov 24)
 Now with updated license, Nov 24.
 
+Memory leak using :wviminfo. Issue 296.  With Patch by Christian.
+
 patch to remove FEAT_OSFILETYPE from fileio.c. (Christian, 2014 Nov 12)
 
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
+Patch to also support range for :argdo, :bufdo, etc.
+(Marcin Szamotulski, 2014 Dec 7)
+Asked for tests.
+
 Ukrainian vimtutor. (Issue 288)
 
 Regenerate the Unicode tables in mbyte.c.
@@ -115,11 +108,19 @@ Diff from ZyX, 2014 Dec 6.
 Patch to fix relative numbers. (Christian Brabandt, 2014 Nov 17)
 Update Nov 26.
 
+Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
+(Hirohito Higashi, 2014 Dec 8)
+
 Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
 Nov 12)
 
 Patch to avoid recognizing polkit as hog files. (Issue 292)
 
+Patch 7.4.468 changed how CTRL-C is handled.  It does not take care of mapping
+CTRL-C in different modes. (Ingo Karkat, 2014 Dec 12)
+Patch from Christian Brabandt, 2014 Dec 13.
+Needs to be improved.
+
 Patch to support hex values for setting option value.
 (Zyx, 2015 Nov 6)
 
@@ -150,6 +151,9 @@ Just remove one trailing newline. (lcd, 2014 Oct 17)
 
 Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24)
 
+Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
+26, update 2013 Dec 14, another 2014 Nov 22)
+
 Result of systemlist() does not show whether text ended in line break.
 (Bjorn Linse, 2014 Nov 27)
 
@@ -161,6 +165,9 @@ Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 Patch to add the EndOfBuffer highlight group, used instead of NonText for "~"
 lines. (Marco Hinz, 2014 Nov 2)
 
+Patch for fixing a problem of the combination of conceal and linebreak.
+(Christian Brabandt, 2014 Dec 11)
+
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
 Plugins need to make a lot of effort, lots of mappings, to know what happened
@@ -182,6 +189,7 @@ was already defined.
 (Yasuhiro Matsumoto, 2014 Nov 3)
 
 Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
+Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
 
 Patch for building a 32bit Vim with 64bit MingW compiler.
 (Michael Soyka, 2014 Oct 15)
@@ -213,6 +221,9 @@ No error for missing endwhile. (ZyX, 2014 Mar 20)
 start_global_changes() plus end_global_changes() causes problem for
 clip_unnamed_plus. (Jason Pleau, 2014 Sep 12)
 
+The entries added by matchaddpos() are returned by getmatches() but can't be
+set with setmatches(). (lcd47, 2014 Jun 29)
+
 Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
 
 PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19)
@@ -472,6 +483,9 @@ optional. (2013 Jul 12)
 
 Dialog is too big on Linux too. (David Fishburn, 2013 Sep 2)
 
+Patch to check whether a buffer is quickfix or a location list.
+(Yasuhiro Matsumoto, 2014 Dec 9)
+
 Patch to allow setting w:quickfix_title via setqflist() and setloclist()
 functions. (Christian Brabandt, 2013 May 8, update May 21)
 Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
@@ -915,9 +929,6 @@ names, shell commands and the like.  (Kikuchan, 2010 Oct 14)
 Assume the system converts between the actual encoding of the filesystem to
 the system encoding (usually utf-8).
 
-Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan
-26, update 2013 Dec 14, another 2014 Nov 22)
-
 Problem producing tags file when hebrew.frx is present.  It has a BOM.
 Results in E670. (Tony Mechelynck, 2010 May 2)
 
diff --git a/runtime/indent/vim.vim b/runtime/indent/vim.vim
index ff4af027b4..7511325af4 100644
--- a/runtime/indent/vim.vim
+++ b/runtime/indent/vim.vim
@@ -1,7 +1,7 @@
 " Vim indent file
 " Language:	Vim script
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Sep 19
+" Last Change:	2014 Dec 12
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -89,7 +89,7 @@ function GetVimIndentIntern()
 
   " Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
   " :endfun, :else and :augroup END.
-  if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
+  if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+[eE][nN][dD]\)'
     let ind = ind - &sw
   endif
 

From 78cd74f7cdd8bb635c0e6f23eb182b9e3487b5af Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:36:14 +0100
Subject: [PATCH 357/473] updated for version 7.4.553 Problem:    Various small
 issues. Solution:   Fix those issues.

---
 src/INSTALL           | 2 +-
 src/Make_vms.mms      | 6 +++---
 src/ex_cmds.h         | 2 +-
 src/gui.h             | 2 +-
 src/message.c         | 4 ++--
 src/os_unix.c         | 2 +-
 src/proto/eval.pro    | 2 +-
 src/proto/misc1.pro   | 2 +-
 src/proto/ops.pro     | 2 +-
 src/proto/os_vms.pro  | 3 ++-
 src/proto/screen.pro  | 2 +-
 src/testdir/test39.in | 4 ++++
 src/version.c         | 2 ++
 13 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/src/INSTALL b/src/INSTALL
index aa4b6e341c..54297d198e 100644
--- a/src/INSTALL
+++ b/src/INSTALL
@@ -316,7 +316,7 @@ directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   If you have to use a `make' that does not supports the `VPATH'
+   If you have to use a `make' that does not support the `VPATH'
 variable, you have to compile the package for one architecture at a time
 in the source code directory.  After you have installed the package for
 one architecture, use `make distclean' before reconfiguring for another
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 4d19bcb2ee..f19b688585 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -2,7 +2,7 @@
 # Makefile for Vim on OpenVMS
 #
 # Maintainer:   Zoltan Arpadffy <arpadffy@polarhome.com>
-# Last change:  2014 Feb 24
+# Last change:  2014 Aug 10
 #
 # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
 # with MMS and MMK
@@ -309,7 +309,7 @@ ALL_CFLAGS_VER = /def=($(MODEL_DEF)$(DEFS)$(DEBUG_DEF)$(PERL_DEF)$(PYTHON_DEF) -
 ALL_LIBS = $(LIBS) $(GUI_LIB_DIR) $(GUI_LIB) \
 	   $(PERL_LIB) $(PYTHON_LIB) $(TCL_LIB) $(SNIFF_LIB) $(RUBY_LIB)
 
-SRC =	blowfish.c buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
+SRC =	blowfish.c buffer.c charset.c crypt.c, crypt_zip.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_cmds2.c \
 	ex_docmd.c ex_eval.c ex_getln.c if_xcmdsrv.c fileio.c fold.c getchar.c \
 	hardcopy.c hashtab.c main.c mark.c menu.c mbyte.c memfile.c memline.c message.c misc1.c \
 	misc2.c move.c normal.c ops.c option.c popupmnu.c quickfix.c regexp.c search.c sha256.c\
@@ -318,7 +318,7 @@ SRC =	blowfish.c buffer.c charset.c diff.c digraph.c edit.c eval.c ex_cmds.c ex_
 	$(GUI_SRC) $(PERL_SRC) $(PYTHON_SRC) $(TCL_SRC) $(SNIFF_SRC) \
 	$(RUBY_SRC) $(HANGULIN_SRC) $(MZSCH_SRC)
 
-OBJ =	blowfish.obj buffer.obj charset.obj diff.obj digraph.obj edit.obj eval.obj \
+OBJ =	blowfish.obj buffer.obj charset.obj crypt.obj, crypt_zip.obj diff.obj digraph.obj edit.obj eval.obj \
 	ex_cmds.obj ex_cmds2.obj ex_docmd.obj ex_eval.obj ex_getln.obj \
 	if_xcmdsrv.obj fileio.obj fold.obj getchar.obj hardcopy.obj hashtab.obj main.obj mark.obj \
 	menu.obj memfile.obj memline.obj message.obj misc1.obj misc2.obj \
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index fc6a8ac0fa..95a22898be 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -63,7 +63,7 @@
 #define ADDR_WINDOWS		1
 #define ADDR_ARGUMENTS		2
 #define ADDR_LOADED_BUFFERS	3
-#define ADDR_BUFFERS	4
+#define ADDR_BUFFERS		4
 #define ADDR_TABS		5
 
 #ifndef DO_DECLARE_EXCMD
diff --git a/src/gui.h b/src/gui.h
index 89476c934e..b2fdc6d8fa 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -41,7 +41,7 @@
 # include <Events.h>
 # include <Menus.h>
 # if !(defined (TARGET_API_MAC_CARBON) && (TARGET_API_MAC_CARBON))
-#   include <Windows.h>
+#  include <Windows.h>
 # endif
 # include <Controls.h>
 /*# include <TextEdit.h>*/
diff --git a/src/message.c b/src/message.c
index 8508f6dfd7..b6eaddc0c0 100644
--- a/src/message.c
+++ b/src/message.c
@@ -4030,11 +4030,11 @@ tv_float(tvs, idxp)
  * pointer for resulting string argument if "str_m" is zero (as per ISO C99).
  *
  * The return value is the number of characters which would be generated
- * for the given input, excluding the trailing null. If this value
+ * for the given input, excluding the trailing NUL. If this value
  * is greater or equal to "str_m", not all characters from the result
  * have been stored in str, output bytes beyond the ("str_m"-1) -th character
  * are discarded. If "str_m" is greater than zero it is guaranteed
- * the resulting string will be null-terminated.
+ * the resulting string will be NUL-terminated.
  */
 
 /*
diff --git a/src/os_unix.c b/src/os_unix.c
index 0813cae73c..ff8834527f 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1609,7 +1609,7 @@ x_IOerror_handler(dpy)
 /*
  * If the X11 connection was lost try to restore it.
  * Helps when the X11 server was stopped and restarted while Vim was inactive
- * (e.g. though tmux).
+ * (e.g. through tmux).
  */
     static void
 may_restore_clipboard()
diff --git a/src/proto/eval.pro b/src/proto/eval.pro
index 517d9e71af..b264365fe1 100644
--- a/src/proto/eval.pro
+++ b/src/proto/eval.pro
@@ -59,8 +59,8 @@ int list_append_tv __ARGS((list_T *l, typval_T *tv));
 int list_append_dict __ARGS((list_T *list, dict_T *dict));
 int list_append_string __ARGS((list_T *l, char_u *str, int len));
 int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
-void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
 void list_insert __ARGS((list_T *l, listitem_T *ni, listitem_T *item));
+void vimlist_remove __ARGS((list_T *l, listitem_T *item, listitem_T *item2));
 int garbage_collect __ARGS((void));
 void set_ref_in_ht __ARGS((hashtab_T *ht, int copyID));
 void set_ref_in_list __ARGS((list_T *l, int copyID));
diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro
index 274c7af46f..5df81c9280 100644
--- a/src/proto/misc1.pro
+++ b/src/proto/misc1.pro
@@ -5,7 +5,7 @@ int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum));
 int get_indent_str __ARGS((char_u *ptr, int ts, int list));
 int set_indent __ARGS((int size, int flags));
 int get_number_indent __ARGS((linenr_T lnum));
-int get_breakindent_win __ARGS((win_T *wp, char_u *ptr));
+int get_breakindent_win __ARGS((win_T *wp, char_u *line));
 int open_line __ARGS((int dir, int flags, int second_line_indent));
 int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int include_space));
 int get_last_leader_offset __ARGS((char_u *line, char_u **flags));
diff --git a/src/proto/ops.pro b/src/proto/ops.pro
index fe40151cd4..c1a1b455ef 100644
--- a/src/proto/ops.pro
+++ b/src/proto/ops.pro
@@ -55,8 +55,8 @@ void dnd_yank_drag_data __ARGS((char_u *str, long len));
 char_u get_reg_type __ARGS((int regname, long *reglen));
 char_u *get_reg_contents __ARGS((int regname, int flags));
 void write_reg_contents __ARGS((int name, char_u *str, int maxlen, int must_append));
-void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
 void write_reg_contents_lst __ARGS((int name, char_u **strings, int maxlen, int must_append, int yank_type, long block_len));
+void write_reg_contents_ex __ARGS((int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len));
 void clear_oparg __ARGS((oparg_T *oap));
 void cursor_pos_info __ARGS((void));
 /* vim: set ft=c : */
diff --git a/src/proto/os_vms.pro b/src/proto/os_vms.pro
index 6408455e46..cc0f1d9130 100644
--- a/src/proto/os_vms.pro
+++ b/src/proto/os_vms.pro
@@ -5,11 +5,12 @@ void mch_set_shellsize __ARGS((void));
 char_u *mch_getenv __ARGS((char_u *lognam));
 int mch_setenv __ARGS((char *var, char *value, int x));
 int vms_sys __ARGS((char *cmd, char *out, char *inp));
+char *vms_tolower __ARGS((char *name));
 int vms_sys_status __ARGS((int status));
 int vms_read __ARGS((char *inbuf, size_t nbytes));
-char *vms_tolower __ARGS((char *name));
 int mch_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
 int mch_expandpath __ARGS((garray_T *gap, char_u *path, int flags));
 void *vms_fixfilename __ARGS((void *instring));
 void vms_remove_version __ARGS((void *fname));
+int RealWaitForChar __ARGS((int fd, long msec, int *check_for_gpm));
 /* vim: set ft=c : */
diff --git a/src/proto/screen.pro b/src/proto/screen.pro
index 31f97d5444..a4df6269f2 100644
--- a/src/proto/screen.pro
+++ b/src/proto/screen.pro
@@ -26,7 +26,7 @@ int get_keymap_str __ARGS((win_T *wp, char_u *buf, int len));
 void screen_putchar __ARGS((int c, int row, int col, int attr));
 void screen_getbytes __ARGS((int row, int col, char_u *bytes, int *attrp));
 void screen_puts __ARGS((char_u *text, int row, int col, int attr));
-void screen_puts_len __ARGS((char_u *text, int len, int row, int col, int attr));
+void screen_puts_len __ARGS((char_u *text, int textlen, int row, int col, int attr));
 void screen_stop_highlight __ARGS((void));
 void reset_cterm_colors __ARGS((void));
 void screen_draw_rectangle __ARGS((int row, int col, int height, int width, int invert));
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
index 7d1c672522..410dea61ae 100644
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -85,6 +85,10 @@ bbbb
 cccc
 dddd
 
+yaaa
+���
+bbb
+
 A23
 4567
 
diff --git a/src/version.c b/src/version.c
index e8d75252fa..eb867138fd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    553,
 /**/
     552,
 /**/

From a7ddc79b61230b4a082fc40213f6cfb230859c7e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:36:14 +0100
Subject: [PATCH 358/473] Added tag v7-4-553 for changeset e13f8073c9f9

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 9a193726ec..148614452c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3275,3 +3275,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 7cda721eadb04f555a912b220c9047f504480bc6 v7-4-550
 eb0fb921e197c7b1294e1142479c982d1770eaa0 v7-4-551
 c8d6dbdd11563d39c42f16a80f9c74bc68155f7a v7-4-552
+e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553

From 9fdf0646203f21c4cae311911c530ad39b683bdd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:41:10 +0100
Subject: [PATCH 359/473] updated for version 7.4.554 Problem:    Missing part
 of patch 7.4.519. Solution:   Copy back regprog after calling vim_regexec.

---
 src/quickfix.c | 6 +++++-
 src/version.c  | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/quickfix.c b/src/quickfix.c
index c8954cc531..abb4a6ecf3 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -592,6 +592,8 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast,
 restofline:
 	for ( ; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next)
 	{
+	    int r;
+
 	    idx = fmt_ptr->prefix;
 	    if (multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL)
 		continue;
@@ -607,7 +609,9 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast,
 	    tail = NULL;
 
 	    regmatch.regprog = fmt_ptr->prog;
-	    if (vim_regexec(&regmatch, IObuff, (colnr_T)0))
+	    r = vim_regexec(&regmatch, IObuff, (colnr_T)0);
+	    fmt_ptr->prog = regmatch.regprog;
+	    if (r)
 	    {
 		if ((idx == 'C' || idx == 'Z') && !multiline)
 		    continue;
diff --git a/src/version.c b/src/version.c
index eb867138fd..cd7bfb1291 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    554,
 /**/
     553,
 /**/

From ba884608275a34eba3301294f0d355dd304f6b4f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:41:10 +0100
Subject: [PATCH 360/473] Added tag v7-4-554 for changeset 7e4c22ecc679

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 148614452c..08981d0be4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3276,3 +3276,4 @@ d2239abd3edb1e3672916c15ea8df6a01d1b86c6 v7-4-545
 eb0fb921e197c7b1294e1142479c982d1770eaa0 v7-4-551
 c8d6dbdd11563d39c42f16a80f9c74bc68155f7a v7-4-552
 e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553
+7e4c22ecc679455fdf3e1eec6681d13d998bebe2 v7-4-554

From 1d0952a645265dc2b876aeddbecdc5aa7771a904 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:42:46 +0100
Subject: [PATCH 361/473] updated for version 7.4.555 Problem:   
 test_close_count may fail for some combination of features. Solution:  
 Require normal features.

---
 src/testdir/test_close_count.in | 5 +----
 src/version.c                   | 2 ++
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/testdir/test_close_count.in b/src/testdir/test_close_count.in
index 288945c696..8a4e090ed5 100644
--- a/src/testdir/test_close_count.in
+++ b/src/testdir/test_close_count.in
@@ -1,8 +1,8 @@
 Tests for :[count]close! and :[count]hide     vim: set ft=vim :
 
 STARTTEST
+:so small.vim
 :let tests = []
-:so tiny.vim
 :for i in range(5)
 :new
 :endfor
@@ -46,7 +46,6 @@ ENDTEST
 
 STARTTEST
 :let tests = []
-:so tiny.vim
 :for i in range(5)
 :new
 :endfor
@@ -94,7 +93,6 @@ ENDTEST
 
 STARTTEST
 :let tests = []
-:so tiny.vim
 :set hidden
 :for i in range(5)
 :new
@@ -123,7 +121,6 @@ ENDTEST
 
 STARTTEST
 :let tests = []
-:so tiny.vim
 :set hidden
 :for i in range(5)
 :new
diff --git a/src/version.c b/src/version.c
index cd7bfb1291..0c8b39a0ec 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    555,
 /**/
     554,
 /**/

From f7abc6c4c32830aede437cca0046463db515b9b6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:42:46 +0100
Subject: [PATCH 362/473] Added tag v7-4-555 for changeset c12439378869

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 08981d0be4..729d65f1a3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3277,3 +3277,4 @@ eb0fb921e197c7b1294e1142479c982d1770eaa0 v7-4-551
 c8d6dbdd11563d39c42f16a80f9c74bc68155f7a v7-4-552
 e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553
 7e4c22ecc679455fdf3e1eec6681d13d998bebe2 v7-4-554
+c124393788693271b446ba24b55dca407e765bbe v7-4-555

From f6c3e3feff5e05e99be8384362b286812e8f3acc Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:46:09 +0100
Subject: [PATCH 363/473] updated for version 7.4.556 Problem:    Failed
 commands in Python interface not handled correctly. Solution:   Restore
 window and buffer on failure.

---
 src/if_py_both.h | 9 +++++++--
 src/version.c    | 2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/if_py_both.h b/src/if_py_both.h
index 5044afbeff..206d2987a5 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -3172,6 +3172,7 @@ set_option_value_for(
 	    if (switch_win(&save_curwin, &save_curtab, (win_T *)from,
 			      win_find_tabpage((win_T *)from), FALSE) == FAIL)
 	    {
+		restore_win(save_curwin, save_curtab, TRUE);
 		if (VimTryEnd())
 		    return -1;
 		PyErr_SET_VIM(N_("problem while switching windows"));
@@ -4032,9 +4033,13 @@ switch_to_win_for_buf(
     win_T	*wp;
     tabpage_T	*tp;
 
-    if (find_win_for_buf(buf, &wp, &tp) == FAIL
-	    || switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+    if (find_win_for_buf(buf, &wp, &tp) == FAIL)
 	switch_buffer(save_curbufp, buf);
+    else if (switch_win(save_curwinp, save_curtabp, wp, tp, TRUE) == FAIL)
+    {
+	restore_win(*save_curwinp, *save_curtabp, TRUE);
+	switch_buffer(save_curbufp, buf);
+    }
 }
 
     static void
diff --git a/src/version.c b/src/version.c
index 0c8b39a0ec..017bff6d59 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    556,
 /**/
     555,
 /**/

From 4edbbfb0671c3dda6e92656220e6bb7fe91c86d9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:46:10 +0100
Subject: [PATCH 364/473] Added tag v7-4-556 for changeset a35752526cd0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 729d65f1a3..92005f436d 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3278,3 +3278,4 @@ c8d6dbdd11563d39c42f16a80f9c74bc68155f7a v7-4-552
 e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553
 7e4c22ecc679455fdf3e1eec6681d13d998bebe2 v7-4-554
 c124393788693271b446ba24b55dca407e765bbe v7-4-555
+a35752526cd050f35306bac3dc04ac4a34a9f309 v7-4-556

From b4fd19f535be8d792189c6770f1ee761d142523d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:47:56 +0100
Subject: [PATCH 365/473] updated for version 7.4.557 Problem:    One more
 small issue. Solution:   Update function proto.

---
 src/proto/window.pro | 2 +-
 src/version.c        | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/proto/window.pro b/src/proto/window.pro
index 2d33c17576..b89cf085a0 100644
--- a/src/proto/window.pro
+++ b/src/proto/window.pro
@@ -75,7 +75,7 @@ void restore_win __ARGS((win_T *save_curwin, tabpage_T *save_curtab, int no_disp
 void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf));
 void restore_buffer __ARGS((buf_T *save_curbuf));
 int win_hasvertsplit __ARGS((void));
-int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos));
+int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos_list));
 int match_delete __ARGS((win_T *wp, int id, int perr));
 void clear_matches __ARGS((win_T *wp));
 matchitem_T *get_match __ARGS((win_T *wp, int id));
diff --git a/src/version.c b/src/version.c
index 017bff6d59..514193a93a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    557,
 /**/
     556,
 /**/

From 13012ec206eee6d533e1cfeb17ece7729ade1d58 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 14:47:56 +0100
Subject: [PATCH 366/473] Added tag v7-4-557 for changeset fcd5a3207100

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 92005f436d..887d4d8c91 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3279,3 +3279,4 @@ e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553
 7e4c22ecc679455fdf3e1eec6681d13d998bebe2 v7-4-554
 c124393788693271b446ba24b55dca407e765bbe v7-4-555
 a35752526cd050f35306bac3dc04ac4a34a9f309 v7-4-556
+fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557

From 7dedc4e7580843238a7df0bd63e2bbac7cd82cb7 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 17:59:31 +0100
Subject: [PATCH 367/473] updated for version 7.4.558 Problem:    When the X
 server restarts Vim may get stuck. Solution:   Destroy the application
 context and create it again.  (Issue 203)

---
 src/os_unix.c | 11 +++++++++++
 src/version.c |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/src/os_unix.c b/src/os_unix.c
index ff8834527f..bcf11ddc76 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -1617,6 +1617,17 @@ may_restore_clipboard()
     if (xterm_dpy_was_reset)
     {
 	xterm_dpy_was_reset = FALSE;
+
+# ifndef LESSTIF_VERSION
+	/* This has been reported to avoid Vim getting stuck. */
+	if (app_context != (XtAppContext)NULL)
+	{
+	    XtDestroyApplicationContext(app_context);
+	    app_context = (XtAppContext)NULL;
+	    x11_display = NULL; /* freed by XtDestroyApplicationContext() */
+	}
+# endif
+
 	setup_term_clip();
 	get_x11_title(FALSE);
     }
diff --git a/src/version.c b/src/version.c
index 514193a93a..4efee6ae8c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    558,
 /**/
     557,
 /**/

From 40bad689727c0b69444f28bfe3a96633bb029984 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 17:59:31 +0100
Subject: [PATCH 368/473] Added tag v7-4-558 for changeset 48111d5fd8a8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 887d4d8c91..d39f9f1705 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3280,3 +3280,4 @@ e13f8073c9f9b8f2e80f32cf0c13073304a3f967 v7-4-553
 c124393788693271b446ba24b55dca407e765bbe v7-4-555
 a35752526cd050f35306bac3dc04ac4a34a9f309 v7-4-556
 fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
+48111d5fd8a8b133b32fa92137a56ae910915370 v7-4-558

From 8411a2141d27f0fbaf3cbc91ad0aa3a3ebb4d0f3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 18:35:42 +0100
Subject: [PATCH 369/473] updated for version 7.4.559 Problem:    Appending a
 block in the middle of a tab does not work correctly 	    when virtualedit
 is set. Solution:   Decrement spaces and count, don't reset them. (James
 McCoy)

---
 src/ops.c             |  12 ++++++------
 src/testdir/test39.in |   9 ++++++---
 src/testdir/test39.ok | Bin 514 -> 584 bytes
 src/version.c         |   2 ++
 4 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/src/ops.c b/src/ops.c
index edc84a07aa..0db8c2d25c 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -612,20 +612,20 @@ block_insert(oap, s, b_insert, bdp)
 #ifdef FEAT_MBYTE
 	if (has_mbyte && spaces > 0)
 	{
+	    int off;
+
 	    /* Avoid starting halfway a multi-byte character. */
 	    if (b_insert)
 	    {
-		int off = (*mb_head_off)(oldp, oldp + offset + spaces);
-		spaces -= off;
-		count -= off;
+		off = (*mb_head_off)(oldp, oldp + offset + spaces);
 	    }
 	    else
 	    {
-		int off = (*mb_off_next)(oldp, oldp + offset);
+		off = (*mb_off_next)(oldp, oldp + offset);
 		offset += off;
-		spaces = 0;
-		count = 0;
 	    }
+	    spaces -= off;
+	    count -= off;
 	}
 #endif
 
diff --git a/src/testdir/test39.in b/src/testdir/test39.in
index 410dea61ae..c4e46fff26 100644
--- a/src/testdir/test39.in
+++ b/src/testdir/test39.in
@@ -38,11 +38,14 @@ G$khhhhhkkcmno
 /^C23$/
 :exe ":norm! l\<C-V>j$hhAab\<Esc>"
 :.,/^$/w >> test.out
-:" Test for Visual block insert when virtualedit=all
-:set ve=all
+:" Test for Visual block insert when virtualedit=all and utf-8 encoding
+:set ve=all enc=utf-8
 :/\t\tline
 :exe ":norm! 07l\<C-V>jjIx\<Esc>"
-:set ve=
+:.,/^$/w >> test.out
+:" Test for Visual block append when virtualedit=all
+:exe ":norm! 012l\<C-v>jjAx\<Esc>"
+:set ve= enc=latin1
 :.,/^$/w >> test.out
 :" gUe must uppercase a whole word, also when � changes to SS
 Gothe youtu�euu endYpk0wgUe
diff --git a/src/testdir/test39.ok b/src/testdir/test39.ok
index d8e901563af492e50b8f70c470fee5678644dc0c..5c517e2223d5c830ca8297b7c8ec71d180777d82 100644
GIT binary patch
delta 75
lcmZo-Il;1lkI`NM0xG~1h|I~%OEu)eDr|%)Jei&GHvnM#5FP*k

delta 11
ScmX@X(!{cXk8yGc;}-xH<OA*i

diff --git a/src/version.c b/src/version.c
index 4efee6ae8c..e2ac04052e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    559,
 /**/
     558,
 /**/

From 881e0a8acfd0760fdd9cf4bb6110aeb262fc8e59 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 18:35:42 +0100
Subject: [PATCH 370/473] Added tag v7-4-559 for changeset 29f5cfca3388

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d39f9f1705..1a54fa3a0e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3281,3 +3281,4 @@ c124393788693271b446ba24b55dca407e765bbe v7-4-555
 a35752526cd050f35306bac3dc04ac4a34a9f309 v7-4-556
 fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 48111d5fd8a8b133b32fa92137a56ae910915370 v7-4-558
+29f5cfca338897412e3a7c819085c1fe36da2135 v7-4-559

From 70bffe65af5e138479f3a24ae1d2489bff552535 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 21:00:49 +0100
Subject: [PATCH 371/473] updated for version 7.4.560 Problem:    Memory leak
 using :wviminfo. Issue 296. Solution:   Free memory when needed. (idea by
 Christian Brabandt)

---
 src/ops.c     | 64 ++++++++++++++++++++++++++++++++++++++-------------
 src/version.c |  2 ++
 2 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/src/ops.c b/src/ops.c
index 0db8c2d25c..0c3d11b87f 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5663,6 +5663,8 @@ read_viminfo_register(virp, force)
     int		set_prev = FALSE;
     char_u	*str;
     char_u	**array = NULL;
+    int		new_type;
+    colnr_T	new_width;
 
     /* We only get here (hopefully) if line[0] == '"' */
     str = virp->vir_line + 1;
@@ -5695,21 +5697,25 @@ read_viminfo_register(virp, force)
     limit = 100;	/* Optimized for registers containing <= 100 lines */
     if (do_it)
     {
+	/*
+	 * Build the new register in array[].
+	 * y_array is kept as-is until done.
+	 * The "do_it" flag is reset when something is wrong, in which case
+	 * array[] needs to be freed.
+	 */
 	if (set_prev)
 	    y_previous = y_current;
-	vim_free(y_current->y_array);
-	array = y_current->y_array =
-		       (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
+	array = (char_u **)alloc((unsigned)(limit * sizeof(char_u *)));
 	str = skipwhite(skiptowhite(str));
 	if (STRNCMP(str, "CHAR", 4) == 0)
-	    y_current->y_type = MCHAR;
+	    new_type = MCHAR;
 	else if (STRNCMP(str, "BLOCK", 5) == 0)
-	    y_current->y_type = MBLOCK;
+	    new_type = MBLOCK;
 	else
-	    y_current->y_type = MLINE;
+	    new_type = MLINE;
 	/* get the block width; if it's missing we get a zero, which is OK */
 	str = skipwhite(skiptowhite(str));
-	y_current->y_width = getdigits(&str);
+	new_width = getdigits(&str);
     }
 
     while (!(eof = viminfo_readline(virp))
@@ -5717,40 +5723,66 @@ read_viminfo_register(virp, force)
     {
 	if (do_it)
 	{
-	    if (size >= limit)
+	    if (size == limit)
 	    {
-		y_current->y_array = (char_u **)
+		char_u **new_array = (char_u **)
 			      alloc((unsigned)(limit * 2 * sizeof(char_u *)));
+
+		if (new_array == NULL)
+		{
+		    do_it = FALSE;
+		    break;
+		}
 		for (i = 0; i < limit; i++)
-		    y_current->y_array[i] = array[i];
+		    new_array[i] = array[i];
 		vim_free(array);
+		array = new_array;
 		limit *= 2;
-		array = y_current->y_array;
 	    }
 	    str = viminfo_readstring(virp, 1, TRUE);
 	    if (str != NULL)
 		array[size++] = str;
 	    else
+		/* error, don't store the result */
 		do_it = FALSE;
 	}
     }
     if (do_it)
     {
+	/* free y_array[] */
+	for (i = 0; i < y_current->y_size; i++)
+	    vim_free(y_current->y_array[i]);
+	vim_free(y_current->y_array);
+
+	y_current->y_type = new_type;
+	y_current->y_width = new_width;
+	y_current->y_size = size;
 	if (size == 0)
 	{
-	    vim_free(array);
 	    y_current->y_array = NULL;
 	}
-	else if (size < limit)
+	else
 	{
+	    /* Move the lines from array[] to y_array[]. */
 	    y_current->y_array =
 			(char_u **)alloc((unsigned)(size * sizeof(char_u *)));
 	    for (i = 0; i < size; i++)
-		y_current->y_array[i] = array[i];
-	    vim_free(array);
+	    {
+		if (y_current->y_array == NULL)
+		    vim_free(array[i]);
+		else
+		    y_current->y_array[i] = array[i];
+	    }
 	}
-	y_current->y_size = size;
     }
+    else
+    {
+	/* Free array[] if it was filled. */
+	for (i = 0; i < size; i++)
+	    vim_free(array[i]);
+    }
+    vim_free(array);
+
     return eof;
 }
 
diff --git a/src/version.c b/src/version.c
index e2ac04052e..2ca9502d14 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    560,
 /**/
     559,
 /**/

From 07c0de24b73b27eb8bb2a44264df2b34199d1edb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 17 Dec 2014 21:00:49 +0100
Subject: [PATCH 372/473] Added tag v7-4-560 for changeset 86aacd619ac0

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1a54fa3a0e..6026db5b79 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3282,3 +3282,4 @@ a35752526cd050f35306bac3dc04ac4a34a9f309 v7-4-556
 fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 48111d5fd8a8b133b32fa92137a56ae910915370 v7-4-558
 29f5cfca338897412e3a7c819085c1fe36da2135 v7-4-559
+86aacd619ac0ab9b6b6519cf132367b744adf8f0 v7-4-560

From 7533f8e41ccbf47eaddef59343d5939295000d6f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 13:15:45 +0100
Subject: [PATCH 373/473] updated for version 7.4.561 Problem:    Ex range
 handling is wrong for buffer-local user commands. Solution:   Check for
 CMD_USER_BUF. (Marcin Szamotulski)

---
 src/ex_docmd.c                    | 3 ++-
 src/testdir/test_command_count.in | 8 +++++++-
 src/testdir/test_command_count.ok | 2 ++
 src/version.c                     | 2 ++
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0c8123cbc0..b37c6ed8cc 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2133,12 +2133,13 @@ do_one_cmd(cmdlinep, sourcing,
     if (ea.cmdidx != CMD_SIZE
 #ifdef FEAT_USR_CMDS
 	&& ea.cmdidx != CMD_USER
+	&& ea.cmdidx != CMD_USER_BUF
 #endif
        )
 	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
     else
 #ifdef FEAT_USR_CMDS
-	if (ea.cmdidx != CMD_USER)
+	if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_USER_BUF)
 #endif
 	ea.addr_type = ADDR_LINES;
     /* ea.addr_type for user commands is set by find_ucmd */
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index cca178e5cf..c71ae5a386 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -3,7 +3,7 @@ Test for user command counts	    vim: set ft=vim :
 STARTTEST
 :let g:lines = []
 :so tiny.vim
-:com -range RangeLines :call add(g:lines, 'Rangeg:Lines '.<line1>.' '.<line2>)
+:com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
 :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
 :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
 :com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>)
@@ -42,6 +42,12 @@ STARTTEST
 :%RangeTabs
 :RangeTabsAll
 :1tabonly
+:s/\n/\r\r\r\r\r/
+:2ma<
+:$-ma>
+:'<,'>RangeLines
+:com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '.<line1>.' '.<line2>)
+:'<,'>LocalRangeLines
 :e! test.out
 :call append(0, g:lines)
 :w|qa!
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
index 11e88b3903..693a22d63f 100644
--- a/src/testdir/test_command_count.ok
+++ b/src/testdir/test_command_count.ok
@@ -14,4 +14,6 @@ RangeBuffersAll 1 5
 RangeTabs 2 5
 RangeTabs 1 5
 RangeTabsAll 1 5
+RangeLines 2 5
+LocalRangeLines 2 5
 
diff --git a/src/version.c b/src/version.c
index 2ca9502d14..9d06ab33f4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    561,
 /**/
     560,
 /**/

From d442b9712cbb3b93ca9cf717fe9a8e4e95149b3b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 13:15:45 +0100
Subject: [PATCH 374/473] Added tag v7-4-561 for changeset 82c6a3bddb23

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6026db5b79..a264a5317e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3283,3 +3283,4 @@ fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 48111d5fd8a8b133b32fa92137a56ae910915370 v7-4-558
 29f5cfca338897412e3a7c819085c1fe36da2135 v7-4-559
 86aacd619ac0ab9b6b6519cf132367b744adf8f0 v7-4-560
+82c6a3bddb23c7343fefc271b33960a20506ead5 v7-4-561

From 043ba26ece25aac0a54545e0edcd2b5c88ab23b8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 13:31:52 +0100
Subject: [PATCH 375/473] updated for version 7.4.562 Problem:    Segfault with
 wide screen and error in 'rulerformat'. (Ingo Karkat) Solution:   Check there
 is enough space. (Christian Brabandt)

---
 src/buffer.c  | 2 ++
 src/screen.c  | 3 ++-
 src/version.c | 2 ++
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/buffer.c b/src/buffer.c
index 37182e146c..0d14706063 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4409,6 +4409,8 @@ get_rel_pos(wp, buf, buflen)
     long	above; /* number of lines above window */
     long	below; /* number of lines below window */
 
+    if (buflen < 3) /* need at least 3 chars for writing */
+	return;
     above = wp->w_topline - 1;
 #ifdef FEAT_DIFF
     above += diff_check_fill(wp, wp->w_topline) - wp->w_topfill;
diff --git a/src/screen.c b/src/screen.c
index e7b8e78d78..290dd1bd3d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -10588,7 +10588,8 @@ win_redr_ruler(wp, always)
 	    this_ru_col = (WITH_WIDTH(width) + 1) / 2;
 	if (this_ru_col + o < WITH_WIDTH(width))
 	{
-	    while (this_ru_col + o < WITH_WIDTH(width))
+	    /* need at least 3 chars left for get_rel_pos() + NUL */
+	    while (this_ru_col + o < WITH_WIDTH(width) && RULER_BUF_LEN > i + 4)
 	    {
 #ifdef FEAT_MBYTE
 		if (has_mbyte)
diff --git a/src/version.c b/src/version.c
index 9d06ab33f4..5c7dbd91ff 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    562,
 /**/
     561,
 /**/

From bf9efaed1d96fda661bbd0c36b8bc6c6a432a681 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 13:31:53 +0100
Subject: [PATCH 376/473] Added tag v7-4-562 for changeset b5df99582638

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a264a5317e..23245649e3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3284,3 +3284,4 @@ fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 29f5cfca338897412e3a7c819085c1fe36da2135 v7-4-559
 86aacd619ac0ab9b6b6519cf132367b744adf8f0 v7-4-560
 82c6a3bddb23c7343fefc271b33960a20506ead5 v7-4-561
+b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562

From 3fdfe6f5cd663c284f86294be9bf227f96027665 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 14:02:52 +0100
Subject: [PATCH 377/473] updated for version 7.4.563 Problem:    No test for
 replacing on a tab in Virtual replace mode. Solution:   Add a test. (Elias
 Diem)

---
 src/testdir/test48.in | 5 +++++
 src/testdir/test48.ok | 1 +
 src/version.c         | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/src/testdir/test48.in b/src/testdir/test48.in
index 48f4abbf75..d480f8cc18 100644
--- a/src/testdir/test48.in
+++ b/src/testdir/test48.in
@@ -44,6 +44,10 @@ $4lDi<-- 'D' should be intact
 /^"r"
 $5lrxa<-- should be 'x'
 :"
+:" Test "r" on a tab
+:" Note that for this test, 'ts' must be 8 (the default).
+^5lrxA<-- should be '  x  '
+:"
 :"   Test to make sure 'x' can delete control characters
 :set display=uhex
 ^xxxxxxi[This line should contain only the text between the brackets.]
@@ -72,6 +76,7 @@ this is a test
 this is a test
 this is a test
 "r"
+"r"	
 ab
sd
 abcv6efi.him0kl
 
diff --git a/src/testdir/test48.ok b/src/testdir/test48.ok
index 334cb5a29c..14cd9b12ec 100644
--- a/src/testdir/test48.ok
+++ b/src/testdir/test48.ok
@@ -12,6 +12,7 @@ this is a test
 this is a test
 this is a test
 "r"    x<-- should be 'x'
+"r"  x  <-- should be '  x  '
 [This line should contain only the text between the brackets.]
    v   i   m   <-- should show the name of a noted text editor
     6   .   0   <-- and its version number
diff --git a/src/version.c b/src/version.c
index 5c7dbd91ff..4d127143df 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    563,
 /**/
     562,
 /**/

From 2b48e5526f7c66a13909db518dc90bf3f34eb113 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 14:02:52 +0100
Subject: [PATCH 378/473] Added tag v7-4-563 for changeset 9dc52b404c1b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 23245649e3..2800116ba8 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3285,3 +3285,4 @@ fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 86aacd619ac0ab9b6b6519cf132367b744adf8f0 v7-4-560
 82c6a3bddb23c7343fefc271b33960a20506ead5 v7-4-561
 b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
+9dc52b404c1b3f32d36df2841c4c8eddea6e4407 v7-4-563

From f20bb97fd6395c345473157bbea3231b96ba2bb9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 14:43:39 +0100
Subject: [PATCH 379/473] updated for version 7.4.564 Problem:   
 FEAT_OSFILETYPE is used even though it's never defined. Solution:   Remove
 the code. (Christian Brabandt)

---
 src/fileio.c  | 109 +++-----------------------------------------------
 src/version.c |   2 +
 2 files changed, 8 insertions(+), 103 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index 0af3627f8e..0fa0fc8e09 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -10049,57 +10049,12 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
 {
     regmatch_T	regmatch;
     int		result = FALSE;
-#ifdef FEAT_OSFILETYPE
-    int		no_pattern = FALSE; /* TRUE if check is filetype only */
-    char_u	*type_start;
-    char_u	c;
-    int		match = FALSE;
-#endif
 
     regmatch.rm_ic = p_fic; /* ignore case if 'fileignorecase' is set */
-#ifdef FEAT_OSFILETYPE
-    if (*pattern == '<')
-    {
-	/* There is a filetype condition specified with this pattern.
-	 * Check the filetype matches first. If not, don't bother with the
-	 * pattern (set regprog to NULL).
-	 * Always use magic for the regexp.
-	 */
-
-	for (type_start = pattern + 1; (c = *pattern); pattern++)
-	{
-	    if ((c == ';' || c == '>') && match == FALSE)
-	    {
-		*pattern = NUL;	    /* Terminate the string */
-		/* TODO: match with 'filetype' of buffer that "fname" comes
-		 * from. */
-		match = mch_check_filetype(fname, type_start);
-		*pattern = c;	    /* Restore the terminator */
-		type_start = pattern + 1;
-	    }
-	    if (c == '>')
-		break;
-	}
-
-	/* (c should never be NUL, but check anyway) */
-	if (match == FALSE || c == NUL)
-	    regmatch.regprog = NULL;	/* Doesn't match - don't check pat. */
-	else if (*pattern == NUL)
-	{
-	    regmatch.regprog = NULL;	/* Vim will try to free regprog later */
-	    no_pattern = TRUE;	/* Always matches - don't check pat. */
-	}
-	else
-	    regmatch.regprog = vim_regcomp(pattern + 1, RE_MAGIC);
-    }
+    if (prog != NULL)
+	regmatch.regprog = *prog;
     else
-#endif
-    {
-	if (prog != NULL)
-	    regmatch.regprog = *prog;
-	else
-	    regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
-    }
+	regmatch.regprog = vim_regcomp(pattern, RE_MAGIC);
 
     /*
      * Try for a match with the pattern with:
@@ -10107,19 +10062,12 @@ match_file_pat(pattern, prog, fname, sfname, tail, allow_dirs)
      * 2. the short file name, when the pattern has a '/'.
      * 3. the tail of the file name, when the pattern has no '/'.
      */
-    if (
-#ifdef FEAT_OSFILETYPE
-	    /* If the check is for a filetype only and we don't care
-	     * about the path then skip all the regexp stuff.
-	     */
-	    no_pattern ||
-#endif
-	    (regmatch.regprog != NULL
+    if (regmatch.regprog != NULL
 	     && ((allow_dirs
 		     && (vim_regexec(&regmatch, fname, (colnr_T)0)
 			 || (sfname != NULL
 			     && vim_regexec(&regmatch, sfname, (colnr_T)0))))
-		 || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0)))))
+		 || (!allow_dirs && vim_regexec(&regmatch, tail, (colnr_T)0))))
 	result = TRUE;
 
     if (prog != NULL)
@@ -10176,9 +10124,6 @@ match_file_list(list, sfname, ffname)
  * allow_dirs, otherwise FALSE is put there -- webb.
  * Handle backslashes before special characters, like "\*" and "\ ".
  *
- * If FEAT_OSFILETYPE defined then pass initial <type> through unchanged. Eg:
- * '<html>myfile' becomes '<html>^myfile$' -- leonard.
- *
  * Returns NULL when out of memory.
  */
     char_u *
@@ -10188,54 +10133,19 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
     char	*allow_dirs;	/* Result passed back out in here */
     int		no_bslash UNUSED; /* Don't use a backward slash as pathsep */
 {
-    int		size;
+    int		size = 2; /* '^' at start, '$' at end */
     char_u	*endp;
     char_u	*reg_pat;
     char_u	*p;
     int		i;
     int		nested = 0;
     int		add_dollar = TRUE;
-#ifdef FEAT_OSFILETYPE
-    int		check_length = 0;
-#endif
 
     if (allow_dirs != NULL)
 	*allow_dirs = FALSE;
     if (pat_end == NULL)
 	pat_end = pat + STRLEN(pat);
 
-#ifdef FEAT_OSFILETYPE
-    /* Find out how much of the string is the filetype check */
-    if (*pat == '<')
-    {
-	/* Count chars until the next '>' */
-	for (p = pat + 1; p < pat_end && *p != '>'; p++)
-	    ;
-	if (p < pat_end)
-	{
-	    /* Pattern is of the form <.*>.*  */
-	    check_length = p - pat + 1;
-	    if (p + 1 >= pat_end)
-	    {
-		/* The 'pattern' is a filetype check ONLY */
-		reg_pat = (char_u *)alloc(check_length + 1);
-		if (reg_pat != NULL)
-		{
-		    mch_memmove(reg_pat, pat, (size_t)check_length);
-		    reg_pat[check_length] = NUL;
-		}
-		return reg_pat;
-	    }
-	}
-	/* else: there was no closing '>' - assume it was a normal pattern */
-
-    }
-    pat += check_length;
-    size = 2 + check_length;
-#else
-    size = 2;		/* '^' at start, '$' at end */
-#endif
-
     for (p = pat; p < pat_end; p++)
     {
 	switch (*p)
@@ -10270,14 +10180,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
     if (reg_pat == NULL)
 	return NULL;
 
-#ifdef FEAT_OSFILETYPE
-    /* Copy the type check in to the start. */
-    if (check_length)
-	mch_memmove(reg_pat, pat - check_length, (size_t)check_length);
-    i = check_length;
-#else
     i = 0;
-#endif
 
     if (pat[0] == '*')
 	while (pat[0] == '*' && pat < pat_end - 1)
diff --git a/src/version.c b/src/version.c
index 4d127143df..7c6b49d4e8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    564,
 /**/
     563,
 /**/

From c059fb788f19104473473a97976c7f2335efed0d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 14:43:39 +0100
Subject: [PATCH 380/473] Added tag v7-4-564 for changeset 9657929ee562

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2800116ba8..0f7ffe63b3 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3286,3 +3286,4 @@ fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 82c6a3bddb23c7343fefc271b33960a20506ead5 v7-4-561
 b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 9dc52b404c1b3f32d36df2841c4c8eddea6e4407 v7-4-563
+9657929ee56251b52885cd0660941b0aab2af3ba v7-4-564

From d8f7fb0545b62a552d96e7768b64bfc71ad78532 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 15:57:17 +0100
Subject: [PATCH 381/473] updated for version 7.4.565 Problem:    Ranges for
 arguments, buffers, tabs, etc. are not checked to be 	    valid but limited
 to the maximum.  This can cause the wrong thing 	    to happen.
 Solution:   Give an error for an invalid value. (Marcin Szamotulski) 	   
 Use windows range for ":wincmd".

---
 src/ex_cmds.h                      |   2 +-
 src/ex_docmd.c                     | 106 ++++++++++++++++-------------
 src/testdir/test62.in              |   2 +-
 src/testdir/test_argument_count.in |   3 +-
 src/testdir/test_argument_count.ok |   4 +-
 src/testdir/test_close_count.in    |   4 +-
 src/testdir/test_command_count.in  |  42 +++++++++++-
 src/testdir/test_command_count.ok  |  11 +++
 src/version.c                      |   2 +
 9 files changed, 119 insertions(+), 57 deletions(-)

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 95a22898be..6396d60c25 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1574,7 +1574,7 @@ EX(CMD_winsize,		"winsize",	ex_winsize,
 			ADDR_LINES),
 EX(CMD_wincmd,		"wincmd",	ex_wincmd,
 			NEEDARG|WORD1|RANGE|NOTADR,
-			ADDR_LINES),
+			ADDR_WINDOWS),
 EX(CMD_windo,		"windo",	ex_listdo,
 			BANG|NEEDARG|EXTRA|NOTRLCOM,
 			ADDR_LINES),
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index b37c6ed8cc..3276abfdbc 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2161,6 +2161,8 @@ do_one_cmd(cmdlinep, sourcing,
 		break;
 	    case ADDR_ARGUMENTS:
 		ea.line2 = curwin->w_arg_idx + 1;
+		if (ea.line2 > ARGCOUNT)
+		    ea.line2 = ARGCOUNT;
 		break;
 	    case ADDR_LOADED_BUFFERS:
 	    case ADDR_BUFFERS:
@@ -3110,7 +3112,7 @@ find_command(eap, full)
      * Exceptions:
      * - the 'k' command can directly be followed by any character.
      * - the 's' command can be followed directly by 'c', 'g', 'i', 'I' or 'r'
-     *	    but :sre[wind] is another command, as are :scrip[tnames],
+     *	    but :sre[wind] is another command, as are :scr[iptnames],
      *	    :scs[cope], :sim[alt], :sig[ns] and :sil[ent].
      * - the "d" command can directly be followed by 'l' or 'p' flag.
      */
@@ -4573,46 +4575,6 @@ get_address(ptr, addr_type, skip, to_other_file)
 		lnum -= n;
 	    else
 		lnum += n;
-
-	    switch (addr_type)
-	    {
-		case ADDR_LINES:
-		    break;
-		case ADDR_ARGUMENTS:
-		    if (lnum < 0)
-			lnum = 0;
-		    else if (lnum >= ARGCOUNT)
-			lnum = ARGCOUNT;
-		    break;
-		case ADDR_TABS:
-		    if (lnum < 0)
-		    {
-			lnum = 0;
-			break;
-		    }
-		    if (lnum >= LAST_TAB_NR)
-			lnum = LAST_TAB_NR;
-		    break;
-		case ADDR_WINDOWS:
-		    if (lnum < 0)
-		    {
-			lnum = 0;
-			break;
-		    }
-		    if (lnum >= LAST_WIN_NR)
-			lnum = LAST_WIN_NR;
-		    break;
-		case ADDR_LOADED_BUFFERS:
-		case ADDR_BUFFERS:
-		    if (lnum < firstbuf->b_fnum)
-		    {
-			lnum = firstbuf->b_fnum;
-			break;
-		    }
-		    if (lnum > lastbuf->b_fnum)
-			lnum = lastbuf->b_fnum;
-		    break;
-	    }
 	}
     } while (*cmd == '/' || *cmd == '?');
 
@@ -4675,17 +4637,65 @@ ex_script_ni(eap)
 invalid_range(eap)
     exarg_T	*eap;
 {
+    buf_T	*buf;
     if (       eap->line1 < 0
 	    || eap->line2 < 0
-	    || eap->line1 > eap->line2
-	    || ((eap->argt & RANGE)
-		&& !(eap->argt & NOTADR)
-		&& eap->line2 > curbuf->b_ml.ml_line_count
+	    || eap->line1 > eap->line2)
+	return (char_u *)_(e_invrange);
+
+    if (eap->argt & RANGE)
+    {
+	switch(eap->addr_type)
+	{
+	    case ADDR_LINES:
+		if (!(eap->argt & NOTADR)
+			&& eap->line2 > curbuf->b_ml.ml_line_count
 #ifdef FEAT_DIFF
-			+ (eap->cmdidx == CMD_diffget)
+			    + (eap->cmdidx == CMD_diffget)
 #endif
-		))
-	return (char_u *)_(e_invrange);
+		   )
+		    return (char_u *)_(e_invrange);
+		break;
+	    case ADDR_ARGUMENTS:
+		if (eap->line2 > ARGCOUNT + (!ARGCOUNT))    // add 1 if ARCOUNT is 0
+		    return (char_u *)_(e_invrange);
+		break;
+	    case ADDR_BUFFERS:
+		if (eap->line1 < firstbuf->b_fnum
+			|| eap->line2 > lastbuf->b_fnum)
+		    return (char_u *)_(e_invrange);
+		break;
+	    case ADDR_LOADED_BUFFERS:
+		buf = firstbuf;
+		while (buf->b_ml.ml_mfp == NULL)
+		{
+		    if (buf->b_next == NULL)
+			return (char_u *)_(e_invrange);
+		    buf = buf->b_next;
+		}
+		if (eap->line1 < buf->b_fnum)
+		    return (char_u *)_(e_invrange);
+		buf = lastbuf;
+		while (buf->b_ml.ml_mfp == NULL)
+		{
+		    if (buf->b_prev == NULL)
+			return (char_u *)_(e_invrange);
+		    buf = buf->b_prev;
+		}
+		if (eap->line2 > buf->b_fnum)
+		    return (char_u *)_(e_invrange);
+		break;
+	    case ADDR_WINDOWS:
+		if (eap->line1 < 1
+			|| eap->line2 > LAST_WIN_NR)
+		    return (char_u *)_(e_invrange);
+		break;
+	    case ADDR_TABS:
+		if (eap->line2 > LAST_TAB_NR)
+		    return (char_u *)_(e_invrange);
+		break;
+	}
+    }
     return NULL;
 }
 
diff --git a/src/testdir/test62.in b/src/testdir/test62.in
index 93d968b33e..c201fe7137 100644
--- a/src/testdir/test62.in
+++ b/src/testdir/test62.in
@@ -13,7 +13,7 @@ STARTTEST
 :" Open three tab pages and use ":tabdo"
 :0tabnew
 :1tabnew
-:888tabnew
+:$tabnew
 :tabdo call append(line('$'), 'this is tab page ' . tabpagenr())
 :tabclose! 2
 :tabrewind
diff --git a/src/testdir/test_argument_count.in b/src/testdir/test_argument_count.in
index cdac0308e7..db7eadb726 100644
--- a/src/testdir/test_argument_count.in
+++ b/src/testdir/test_argument_count.in
@@ -27,10 +27,9 @@ STARTTEST
 :1arga c
 :1arga b
 :$argu
-:+arga d
 :$arga x
 :call add(arglists, argv())
-:$-10arga Y
+:0arga Y
 :call add(arglists, argv())
 :%argd
 :call add(arglists, argv())
diff --git a/src/testdir/test_argument_count.ok b/src/testdir/test_argument_count.ok
index f591bf2614..f51562620d 100644
--- a/src/testdir/test_argument_count.ok
+++ b/src/testdir/test_argument_count.ok
@@ -7,7 +7,7 @@ c
 a b d
 a d
 a
-a b c d x
-Y a b c d x
+a b c x
+Y a b c x
 
 a f
diff --git a/src/testdir/test_close_count.in b/src/testdir/test_close_count.in
index 8a4e090ed5..f07da99b0f 100644
--- a/src/testdir/test_close_count.in
+++ b/src/testdir/test_close_count.in
@@ -28,7 +28,7 @@ STARTTEST
 :new
 :new
 :2wincmd w
-:-2close!
+:-1close!
 :let buffers = []
 :windo call add(buffers, bufnr('%'))
 :call add(tests, buffers)
@@ -61,7 +61,7 @@ STARTTEST
 :let buffers = []
 :windo call add(buffers, bufnr('%'))
 :call add(tests, buffers)
-:9hide
+:$hide
 :let buffers = []
 :windo call add(buffers, bufnr('%'))
 :call add(tests, buffers)
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index c71ae5a386..e7dadd2bed 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -1,8 +1,8 @@
 Test for user command counts	    vim: set ft=vim :
 
 STARTTEST
-:let g:lines = []
 :so tiny.vim
+:let g:lines = []
 :com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
 :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
 :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>)
@@ -48,6 +48,46 @@ STARTTEST
 :'<,'>RangeLines
 :com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '.<line1>.' '.<line2>)
 :'<,'>LocalRangeLines
+:b1
+ENDTEST
+
+STARTTEST
+:call add(g:lines, '')
+:%argd
+:arga a b c d
+:let v:errmsg = ''
+:5argu
+:call add(g:lines, '5argu ' . v:errmsg)
+:$argu
+:call add(g:lines, '4argu ' . expand('%:t'))
+:let v:errmsg = ''
+:1argu
+:call add(g:lines, '1argu ' . expand('%:t'))
+:let v:errmsg = ''
+:100b
+:call add(g:lines, '100b ' . v:errmsg)
+:split|split|split|split
+:let v:errmsg = ''
+:0close
+:call add(g:lines, '0close ' . v:errmsg)
+:$wincmd w
+:$close
+:call add(g:lines, '$close ' . winnr())
+:let v:errmsg = ''
+:$+close
+:call add(g:lines, '$+close ' . v:errmsg)
+:$tabe
+:call add(g:lines, '$tabe ' . tabpagenr())
+:let v:errmsg = ''
+:$+tabe
+:call add(g:lines, '$+tabe ' . v:errmsg)
+:only!
+:e x
+:0tabm
+:normal 1gt
+:call add(g:lines, '0tabm ' . expand('%:t'))
+:tabonly!
+:only!
 :e! test.out
 :call append(0, g:lines)
 :w|qa!
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
index 693a22d63f..6e85f29d94 100644
--- a/src/testdir/test_command_count.ok
+++ b/src/testdir/test_command_count.ok
@@ -17,3 +17,14 @@ RangeTabsAll 1 5
 RangeLines 2 5
 LocalRangeLines 2 5
 
+5argu E16: Invalid range
+4argu d
+1argu a
+100b E16: Invalid range
+0close E16: Invalid range
+$close 4
+$+close E16: Invalid range
+$tabe 2
+$+tabe E16: Invalid range
+0tabm x
+
diff --git a/src/version.c b/src/version.c
index 7c6b49d4e8..835afbbf02 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    565,
 /**/
     564,
 /**/

From 42965ecbc89f020240597c2b06516f67d839f7e1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 15:57:18 +0100
Subject: [PATCH 382/473] Added tag v7-4-565 for changeset 22f95a018b13

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 0f7ffe63b3..4e3f39a6b7 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3287,3 +3287,4 @@ fcd5a3207100a1f75d96ead301249c60b4f23d79 v7-4-557
 b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 9dc52b404c1b3f32d36df2841c4c8eddea6e4407 v7-4-563
 9657929ee56251b52885cd0660941b0aab2af3ba v7-4-564
+22f95a018b13dc9d8a3246d990a1ea0b5b3a264d v7-4-565

From 6c40c5553fce3225a4c70db05026f5f252264fd0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 16:54:21 +0100
Subject: [PATCH 383/473] updated for version 7.4.566 Problem:    :argdo,
 :bufdo, :windo and :tabdo don't take a range. Solution:   Support the range.
 (Marcin Szamotulski)

---
 runtime/doc/editing.txt           |  9 ++++----
 runtime/doc/tabpage.txt           | 12 ++++++----
 runtime/doc/windows.txt           | 11 +++++----
 src/ex_cmds.h                     | 16 ++++++-------
 src/ex_cmds2.c                    | 38 +++++++++++++++++++++++++++----
 src/testdir/test_command_count.in | 34 +++++++++++++++++++++++++++
 src/testdir/test_command_count.ok |  5 ++++
 src/version.c                     |  2 ++
 8 files changed, 102 insertions(+), 25 deletions(-)

diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index 71f2f8c25c..4b8e536df5 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt*   For Vim version 7.4.  Last change: 2014 Dec 05
+*editing.txt*   For Vim version 7.4.  Last change: 2015 Jan 04
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -832,8 +832,9 @@ current window.  The two windows then share this list, until one of them uses
 USING THE ARGUMENT LIST
 
 						*:argdo*
-:argdo[!] {cmd}		Execute {cmd} for each file in the argument list.
-			It works like doing this: >
+:[range]argdo[!] {cmd}	Execute {cmd} for each file in the argument list or
+			if [range] is specified only for arguments in that
+			range.  It works like doing this: >
 				:rewind
 				:{cmd}
 				:next
@@ -1391,7 +1392,7 @@ reveal it to others.  The 'viminfo' file is not encrypted.
 You could do this to edit very secret text: >
 	:set noundofile viminfo=
 	:noswapfile edit secrets.txt
-Keep in mind that without a swap file you risk loosing your work in a crash.
+Keep in mind that without a swap file you risk losing your work in a crash.
 
 WARNING: If you make a typo when entering the key and then write the file and
 exit, the text will be lost!
diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt
index 47e1a4b674..2d44fe2ff5 100644
--- a/runtime/doc/tabpage.txt
+++ b/runtime/doc/tabpage.txt
@@ -1,4 +1,4 @@
-*tabpage.txt*   For Vim version 7.4.  Last change: 2014 Nov 27
+*tabpage.txt*   For Vim version 7.4.  Last change: 2015 Jan 04
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -206,7 +206,7 @@ REORDERING TAB PAGES:
 		    :tabmove	" move the tab page to the right
 		    :.tabmove	" as above
 		    :+tabmove	" as above
-		    :0tabmove	" move the tab page to the begining of the tab
+		    :0tabmove	" move the tab page to the beginning of the tab
 				" list
 		    :$tabmove	" move the tab page to the end of the tab list
 <
@@ -224,8 +224,10 @@ clarification what +N means in this context see |[range]|.
 LOOPING OVER TAB PAGES:
 
 							*:tabd* *:tabdo*
-:tabd[o] {cmd}	Execute {cmd} in each tab page.
-		It works like doing this: >
+:[range]tabd[o] {cmd}
+		Execute {cmd} in each tab page or if [range] is given only in
+		tab pages which tab page number is in the [range].  It works
+		like doing this: >
 			:tabfirst
 			:{cmd}
 			:tabnext
@@ -271,8 +273,8 @@ window on the same buffer and then edit another buffer.  Thus ":tabnew"
 triggers:
 	WinLeave		leave current window
 	TabLeave		leave current tab page
-	TabEnter		enter new tab page
 	WinEnter		enter window in new tab page
+	TabEnter		enter new tab page
 	BufLeave		leave current buffer
 	BufEnter		enter new empty buffer
 
diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt
index 67925b864a..532cca3e50 100644
--- a/runtime/doc/windows.txt
+++ b/runtime/doc/windows.txt
@@ -698,8 +698,9 @@ can also get to them with the buffer list commands, like ":bnext".
 8. Do a command in all buffers or windows			*list-repeat*
 
 							*:windo*
-:windo {cmd}		Execute {cmd} in each window.
-			It works like doing this: >
+:[range]windo {cmd}	Execute {cmd} in each window or if [range] is given
+			only in windows for which the window number lies in
+			the [range].  It works like doing this: >
 				CTRL-W t
 				:{cmd}
 				CTRL-W w
@@ -717,8 +718,10 @@ can also get to them with the buffer list commands, like ":bnext".
 			Also see |:tabdo|, |:argdo| and |:bufdo|.
 
 							*:bufdo*
-:bufdo[!] {cmd}		Execute {cmd} in each buffer in the buffer list.
-			It works like doing this: >
+:[range]bufdo[!] {cmd}	Execute {cmd} in each buffer in the buffer list or if
+			[range] is given only for buffers for which their
+			buffer numer is in the [range].  It works like doing
+			this: >
 				:bfirst
 				:{cmd}
 				:bnext
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 6396d60c25..50e82521a6 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -133,8 +133,8 @@ EX(CMD_argdelete,	"argdelete",	ex_argdelete,
 			BANG|RANGE|NOTADR|FILES|TRLBAR,
 			ADDR_ARGUMENTS),
 EX(CMD_argdo,		"argdo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM,
-			ADDR_LINES),
+			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+			ADDR_ARGUMENTS),
 EX(CMD_argedit,		"argedit",	ex_argedit,
 			BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR,
 			ADDR_ARGUMENTS),
@@ -220,8 +220,8 @@ EX(CMD_buffers,		"buffers",	buflist_list,
 			BANG|TRLBAR|CMDWIN,
 			ADDR_LINES),
 EX(CMD_bufdo,		"bufdo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM,
-			ADDR_LINES),
+			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+			ADDR_BUFFERS),
 EX(CMD_bunload,		"bunload",	ex_bunload,
 			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
 			ADDR_LOADED_BUFFERS),
@@ -1384,8 +1384,8 @@ EX(CMD_tabclose,	"tabclose",	ex_tabclose,
 			RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
 			ADDR_TABS),
 EX(CMD_tabdo,		"tabdo",	ex_listdo,
-			NEEDARG|EXTRA|NOTRLCOM,
-			ADDR_LINES),
+			NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+			ADDR_TABS),
 EX(CMD_tabedit,		"tabedit",	ex_splitview,
 			BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
 			ADDR_TABS),
@@ -1576,8 +1576,8 @@ EX(CMD_wincmd,		"wincmd",	ex_wincmd,
 			NEEDARG|WORD1|RANGE|NOTADR,
 			ADDR_WINDOWS),
 EX(CMD_windo,		"windo",	ex_listdo,
-			BANG|NEEDARG|EXTRA|NOTRLCOM,
-			ADDR_LINES),
+			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
+			ADDR_WINDOWS),
 EX(CMD_winpos,		"winpos",	ex_winpos,
 			EXTRA|TRLBAR|CMDWIN,
 			ADDR_LINES),
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 4614deab80..48badeb93f 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -2472,15 +2472,36 @@ ex_listdo(eap)
 				    | (eap->forceit ? CCGD_FORCEIT : 0)
 				    | CCGD_EXCMD))
     {
-	/* start at the first argument/window/buffer */
 	i = 0;
+	/* start at the eap->line1 argument/window/buffer */
 #ifdef FEAT_WINDOWS
 	wp = firstwin;
 	tp = first_tabpage;
 #endif
+	switch (eap->cmdidx)
+	{
+#ifdef FEAT_WINDOWS
+	    case CMD_windo:
+		for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
+		    i++;
+		break;
+	    case CMD_tabdo:
+		for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
+		    i++;
+		break;
+#endif
+	    case CMD_argdo:
+		i = eap->line1 - 1;
+		break;
+	    case CMD_bufdo:
+		i = eap->line1;
+		break;
+	    default:
+		break;
+	}
 	/* set pcmark now */
 	if (eap->cmdidx == CMD_bufdo)
-	    goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
+	    goto_buffer(eap, DOBUF_FIRST, FORWARD, i);
 	else
 	    setpcmark();
 	listcmd_busy = TRUE;	    /* avoids setting pcmark below */
@@ -2506,7 +2527,6 @@ ex_listdo(eap)
 		}
 		if (curwin->w_arg_idx != i)
 		    break;
-		++i;
 	    }
 #ifdef FEAT_WINDOWS
 	    else if (eap->cmdidx == CMD_windo)
@@ -2541,6 +2561,8 @@ ex_listdo(eap)
 		    }
 	    }
 
+	    ++i;
+
 	    /* execute the command */
 	    do_cmdline(eap->arg, eap->getline, eap->cookie,
 						DOCMD_VERBOSE + DOCMD_NOWAIT);
@@ -2548,7 +2570,7 @@ ex_listdo(eap)
 	    if (eap->cmdidx == CMD_bufdo)
 	    {
 		/* Done? */
-		if (next_fnum < 0)
+		if (next_fnum < 0 || next_fnum > eap->line2)
 		    break;
 		/* Check if the buffer still exists. */
 		for (buf = firstbuf; buf != NULL; buf = buf->b_next)
@@ -2579,6 +2601,14 @@ ex_listdo(eap)
 		    do_check_scrollbind(TRUE);
 #endif
 	    }
+
+#ifdef FEAT_WINDOWS
+	    if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
+		if (i+1 > eap->line2)
+		    break;
+#endif
+	    if (eap->cmdidx == CMD_argdo && i >= eap->line2)
+		break;
 	}
 	listcmd_busy = FALSE;
     }
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index e7dadd2bed..16daad0b2d 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -90,6 +90,40 @@ STARTTEST
 :only!
 :e! test.out
 :call append(0, g:lines)
+:unlet g:lines
+:w|bd
+:se hidden
+:b1
+ENDTEST
+
+STARTTEST
+:only!
+:let g:lines = []
+:%argd
+:arga a b c d e f
+:3argu
+:let args = ''
+:.,$-argdo let args .= ' '.expand('%')
+:call add(g:lines, 'argdo:' . args)
+:split|split|split|split
+:2wincmd w
+:let windows = ''
+:.,$-windo let windows .= ' '.winnr()
+:call add(g:lines, 'windo:'. windows)
+:b2
+:let buffers = ''
+:.,$-bufdo let buffers .= ' '.bufnr('%')
+:call add(g:lines, 'bufdo:' . buffers)
+:let buffers = ''
+:3,7bufdo let buffers .= ' '.bufnr('%')
+:call add(g:lines, 'bufdo:' . buffers)
+:tabe|tabe|tabe|tabe
+:normal! 2gt
+:let tabpages = ''
+:.,$-tabdo let tabpages .= ' '.tabpagenr()
+:call add(g:lines, 'tabdo:' . tabpages)
+:e! test.out
+:call append('$', g:lines)
 :w|qa!
 ENDTEST
 
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
index 6e85f29d94..a936715b36 100644
--- a/src/testdir/test_command_count.ok
+++ b/src/testdir/test_command_count.ok
@@ -28,3 +28,8 @@ $tabe 2
 $+tabe E16: Invalid range
 0tabm x
 
+argdo: c d e
+windo: 2 3 4
+bufdo: 2 3 4 5 6 7 8 9 10 12
+bufdo: 3 4 5 6 7
+tabdo: 2 3 4
diff --git a/src/version.c b/src/version.c
index 835afbbf02..6339bcb724 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    566,
 /**/
     565,
 /**/

From 234435a6112c5c926e510552bc04343ef487db1c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 16:54:22 +0100
Subject: [PATCH 384/473] Added tag v7-4-566 for changeset a88d4dc02bf4

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 4e3f39a6b7..28e1718171 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3288,3 +3288,4 @@ b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 9dc52b404c1b3f32d36df2841c4c8eddea6e4407 v7-4-563
 9657929ee56251b52885cd0660941b0aab2af3ba v7-4-564
 22f95a018b13dc9d8a3246d990a1ea0b5b3a264d v7-4-565
+a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566

From 9e29e825eda66310900d9d0935713bb93d6bd0bb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 16:57:10 +0100
Subject: [PATCH 385/473] Update runtime files.

---
 runtime/autoload/netrw.vim           | 2484 ++++++++++++++++----------
 runtime/autoload/netrwSettings.vim   |    9 +-
 runtime/autoload/netrw_gitignore.vim |   13 +-
 runtime/doc/gui_w32.txt              |    5 +-
 runtime/doc/index.txt                |    4 +-
 runtime/doc/options.txt              |    4 +-
 runtime/doc/pi_netrw.txt             |  766 +++++---
 runtime/doc/repeat.txt               |    6 +-
 runtime/doc/syntax.txt               |   10 +-
 runtime/doc/tags                     |   21 +-
 runtime/doc/todo.txt                 |   73 +-
 runtime/filetype.vim                 |    5 +-
 runtime/ftplugin/less.vim            |   20 +
 runtime/ftplugin/man.vim             |    6 +-
 runtime/ftplugin/matlab.vim          |   14 +-
 runtime/indent/less.vim              |   13 +
 runtime/plugin/netrwPlugin.vim       |   44 +-
 runtime/syntax/diff.vim              |    7 +-
 runtime/syntax/html.vim              |    7 +-
 runtime/syntax/less.vim              |   79 +
 runtime/syntax/netrw.vim             |   16 +-
 runtime/syntax/r.vim                 |   54 +-
 runtime/tutor/tutor.uk.utf-8         |  976 ++++++++++
 23 files changed, 3342 insertions(+), 1294 deletions(-)
 create mode 100644 runtime/ftplugin/less.vim
 create mode 100644 runtime/indent/less.vim
 create mode 100644 runtime/syntax/less.vim
 create mode 100644 runtime/tutor/tutor.uk.utf-8

diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index d8d1857099..42439a57d3 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,7 +1,7 @@
 " netrw.vim: Handles file transfer and remote directory listing across
 "            AUTOLOAD SECTION
-" Date:		May 13, 2014
-" Version:	152
+" Date:		Jan 05, 2015
+" Version:	153
 " Maintainer:	Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
 " Copyright:    Copyright (C) 1999-2013 Charles E. Campbell {{{1
@@ -29,7 +29,7 @@ if v:version < 704 || !has("patch213")
  let s:needpatch213= 1
  finish
 endif
-let g:loaded_netrw = "v152"
+let g:loaded_netrw = "v153"
 if !exists("s:NOTE")
  let s:NOTE    = 0
  let s:WARNING = 1
@@ -51,7 +51,10 @@ setl cpo&vim
 "   0=note     = s:NOTE
 "   1=warning  = s:WARNING
 "   2=error    = s:ERROR
-"  Apr 16, 2014 : max errnum currently is 97
+"   Usage: netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,"some message",error-number)
+"          netrw#ErrorMsg(s:NOTE | s:WARNING | s:ERROR,["message1","message2",...],error-number)
+"          (this function can optionally take a list of messages)
+"  May 15, 2014 : max errnum currently is 98
 fun! netrw#ErrorMsg(level,msg,errnum)
 "  call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
 
@@ -84,18 +87,31 @@ fun! netrw#ErrorMsg(level,msg,errnum)
     exe bufwinnr("NetrwMessage")."wincmd w"
 "    call Decho("setl ma noro")
     setl ma noro
-    keepj call setline(line("$")+1,level.a:msg)
-    keepj $
+    if type(a:msg) == 3
+     for msg in a:msg
+      NetrwKeepj call setline(line("$")+1,level.msg)
+     endfor
+    else
+     NetrwKeepj call setline(line("$")+1,level.a:msg)
+    endif
+    NetrwKeepj $
    else
 "    call Decho("create a NetrwMessage buffer window")
     bo 1split
     sil! call s:NetrwEnew()
-    sil! keepj call s:NetrwSafeOptions()
+    sil! NetrwKeepj call s:NetrwSafeOptions()
     setl bt=nofile
-    keepj file NetrwMessage
+    NetrwKeepj file NetrwMessage
 "    call Decho("setl ma noro")
     setl ma noro
-    call setline(line("$"),level.a:msg)
+    if type(a:msg) == 3
+     for msg in a:msg
+      NetrwKeepj call setline(line("$")+1,level.msg)
+     endfor
+    else
+     NetrwKeepj call setline(line("$"),level.a:msg)
+    endif
+    NetrwKeepj $
    endif
 "   call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr())
    if &fo !~ '[ta]'
@@ -118,7 +134,15 @@ fun! netrw#ErrorMsg(level,msg,errnum)
    elseif a:level == s:ERROR
     echohl Error
    endif
-   echomsg level.a:msg
+
+   if type(a:msg) == 3
+     for msg in a:msg
+      echomsg level.msg
+     endfor
+   else
+    echomsg level.a:msg
+   endif
+
 "   call Decho("echomsg ***netrw*** ".a:msg)
    echohl None
   endif
@@ -127,7 +151,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
 endfun
 
 " ---------------------------------------------------------------------
-" NetrwInit: initializes variables if they haven't been defined {{{2
+" s:NetrwInit: initializes variables if they haven't been defined {{{2
 "            Loosely,  varname = value.
 fun s:NetrwInit(varname,value)
 " call Decho("varname<".a:varname."> value=".a:value)
@@ -175,6 +199,13 @@ if !exists("g:netrw_fetch_cmd")
   let g:netrw_fetch_cmd	= ""
  endif
 endif
+if !exists("g:netrw_file_cmd")
+ if executable("elinks")
+  call s:NetrwInit("g:netrw_file_cmd","elinks")
+ elseif executable("links")
+  call s:NetrwInit("g:netrw_file_cmd","links")
+ endif
+endif
 if !exists("g:netrw_ftp_cmd")
   let g:netrw_ftp_cmd	= "ftp"
 endif
@@ -203,6 +234,7 @@ if !exists("g:netrw_http_cmd")
  endif
 endif
 call s:NetrwInit("g:netrw_http_put_cmd","curl -T")
+call s:NetrwInit("g:netrw_keepj","keepj")
 call s:NetrwInit("g:netrw_rcp_cmd"  , "rcp")
 call s:NetrwInit("g:netrw_rsync_cmd", "rsync")
 if !exists("g:netrw_scp_cmd")
@@ -300,12 +332,20 @@ if !exists("g:netrw_list_cmd")
    " provide a pscp-based listing command
    let g:netrw_scp_cmd ="pscp -i C:\\private.ppk"
   endif
-  let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:"
+  if exists("g:netrw_list_cmd_options")
+   let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME: ".g:netrw_list_cmd_options
+  else
+   let g:netrw_list_cmd= g:netrw_scp_cmd." -ls USEPORT HOSTNAME:"
+  endif
  elseif executable(g:netrw_ssh_cmd)
   " provide a scp-based default listing command
-  let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
+  if exists("g:netrw_list_cmd_options")
+   let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa ".g:netrw_list_cmd_options
+  else
+   let g:netrw_list_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME ls -FLa"
+  endif
  else
-"  call Decho("g:netrw_ssh_cmd." is not executable")
+"  call Decho(g:netrw_ssh_cmd." is not executable")
   let g:netrw_list_cmd= ""
  endif
 endif
@@ -331,6 +371,19 @@ if !exists("g:netrw_localcopycmd")
   let g:netrw_localcopycmd= ""
  endif
 endif
+if !exists("g:netrw_localcopydircmd")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+  if g:netrw_cygwin
+   let g:netrw_localcopydircmd= "cp -R"
+  else
+   let g:netrw_localcopycmd= expand("$COMSPEC")." /c xcopy /e /c /h /i /k"
+  endif
+ elseif has("unix") || has("macunix")
+  let g:netrw_localcopydircmd= "cp -R"
+ else
+  let g:netrw_localcopycmd= ""
+ endif
+endif
 if exists("g:netrw_local_mkdir")
  let g:netrw_localmkdir= g:netrw_local_mkdir
  call netrw#ErrorMsg(s:NOTE,"g:netrw_local_mkdir is deprecated in favor of g:netrw_localmkdir",87)
@@ -399,6 +452,7 @@ else
 endif
 call s:NetrwInit("g:netrw_preview"       , 0)
 call s:NetrwInit("g:netrw_scpport"       , "-P")
+call s:NetrwInit("g:netrw_servername"    , "NETRWSERVER")
 call s:NetrwInit("g:netrw_sshport"       , "-p")
 call s:NetrwInit("g:netrw_rename_cmd"    , g:netrw_ssh_cmd." USEPORT HOSTNAME mv")
 call s:NetrwInit("g:netrw_rm_cmd"        , g:netrw_ssh_cmd." USEPORT HOSTNAME rm")
@@ -407,16 +461,20 @@ call s:NetrwInit("g:netrw_rmf_cmd"       , g:netrw_ssh_cmd." USEPORT HOSTNAME rm
 " Default values - q-s ---------- {{{3
 call s:NetrwInit("g:netrw_quickhelp",0)
 let s:QuickHelp= ["-:go up dir  D:delete  R:rename  s:sort-by  x:special",
-   \              "%:create new file  d:create new directory",
-   \              "o:split&open  v:vert-split&open",
-   \              "i:style  qf:file info  O:obtain  r:reverse  p:preview",
-   \              "mf:mark file  mt:set target  mm:move  mc:copy",
-   \              "-bookmarks-  mb:make  mB:delete  qb:list  gb:go to",
-   \              "-history-  qb:list  u:go up  U:go down",
-   \              "-targets-  mt:target Tb:use bookmark  Th:use history"]
+   \              "(create new)  %:file  d:directory",
+   \              "(windows split&open) o:horz  v:vert  p:preview",
+   \              "i:style  qf:file info  O:obtain  r:reverse",
+   \              "(marks)  mf:mark file  mt:set target  mm:move  mc:copy",
+   \              "(bookmarks)  mb:make  mB:delete  qb:list  gb:go to",
+   \              "(history)  qb:list  u:go up  U:go down",
+   \              "(targets)  mt:target Tb:use bookmark  Th:use history"]
 " g:netrw_sepchr: picking a character that doesn't appear in filenames that can be used to separate priority from filename
 call s:NetrwInit("g:netrw_sepchr"        , (&enc == "euc-jp")? "\<Char-0x01>" : "\<Char-0xff>")
-call s:NetrwInit("s:netrw_silentxfer"    , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil keepj " : "keepj ")
+if !exists("g:netrw_keepj") || g:netrw_keepj == "keepj"
+ call s:NetrwInit("s:netrw_silentxfer"    , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil keepj " : "keepj ")
+else
+ call s:NetrwInit("s:netrw_silentxfer"    , (exists("g:netrw_silent") && g:netrw_silent != 0)? "sil " : " ")
+endif
 call s:NetrwInit("g:netrw_sort_by"       , "name") " alternatives: date                                      , size
 call s:NetrwInit("g:netrw_sort_options"  , "")
 call s:NetrwInit("g:netrw_sort_direction", "normal") " alternative: reverse  (z y x ...)
@@ -488,6 +546,13 @@ if v:version >= 700 && has("balloon_eval") && !exists("s:initbeval") && !exists(
 endif
 au WinEnter *	if &ft == "netrw"|call s:NetrwInsureWinVars()|endif
 
+if g:netrw_keepj =~ "keepj"
+ com! -nargs=*	NetrwKeepj	keepj <args>
+else
+ let g:netrw_keepj= ""
+ com! -nargs=*	NetrwKeepj	<args>
+endif
+
 " ==============================
 "  Netrw Utility Functions: {{{1
 " ==============================
@@ -525,7 +590,7 @@ if v:version >= 700 && has("balloon_eval") && has("syntax") && exists("g:syntax_
 " if v:version < 700            |call Decho("did not load netrw#BalloonHelp(): vim version ".v:version." < 700 -")|endif
 " if !has("balloon_eval")       |call Decho("did not load netrw#BalloonHelp(): does not have balloon eval")       |endif
 " if !has("syntax")             |call Decho("did not load netrw#BalloonHelp(): syntax disabled")                  |endif
-" if !exists("g:syntax_on")     |call Decho("did not load netrw#BalloonHelp(): g:syntax_on=".g:syntax_on)         |endif
+" if !exists("g:syntax_on")     |call Decho("did not load netrw#BalloonHelp(): g:syntax_on n/a")                  |endif
 " if  exists("g:netrw_nobeval") |call Decho("did not load netrw#BalloonHelp(): g:netrw_nobeval exists")           |endif
 endif
 
@@ -655,7 +720,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
 "  else " Decho
 "   call Decho("case a:dosplit=".a:dosplit." AND modified=".&modified." AND a:style=".a:style." is not 6")
   endif
-  keepj norm! 0
+  NetrwKeepj norm! 0
 
   if a:0 > 0
 "   call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">")
@@ -751,7 +816,6 @@ fun! netrw#Explore(indx,dosplit,style,...)
    endif
    if dirname =~ '^scp://' || dirname =~ '^ftp://'
     call netrw#Nread(2,dirname)
-    "call s:NetrwBrowse(0,dirname)
    else
     if dirname == ""
      let dirname= getcwd()
@@ -778,9 +842,9 @@ fun! netrw#Explore(indx,dosplit,style,...)
    " ---------------------------------------------------------------------
    " Jan 24, 2013: not sure why the following was present.  See P08-Ingelrest
 "   if has("win32") || has("win95") || has("win64") || has("win16")
-"    keepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW')
+"    NetrwKeepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW')
 "   else
-"    keepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW')
+"    NetrwKeepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW')
 "   endif
    " ---------------------------------------------------------------------
 
@@ -811,7 +875,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
      " Nexplore
 "     call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")")
      if !exists("w:netrw_explore_list") " sanity check
-      keepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
+      NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
       if has("clipboard")
        sil! let @* = keepregstar
        sil! let @+ = keepregstar
@@ -836,7 +900,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
      " Pexplore
 "     call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")")
      if !exists("w:netrw_explore_list") " sanity check
-      keepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
+      NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
       if has("clipboard")
        sil! let @* = keepregstar
        sil! let @+ = keepregstar
@@ -861,7 +925,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
      " Explore -- initialize
      " build list of files to Explore with Nexplore/Pexplore
 "     call Decho("..starpat=".starpat.": case Explore: initialize (indx=".indx.")")
-     keepj keepalt call s:NetrwClearExplore()
+     NetrwKeepj keepalt call s:NetrwClearExplore()
      let w:netrw_explore_indx= 0
      if !exists("b:netrw_curdir")
       let b:netrw_curdir= getcwd()
@@ -874,7 +938,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
 "      call Decho("..case starpat=".starpat.": build *//pattern list  (curdir-only srch for files containing pattern)  &hls=".&hls)
 "      call Decho("....pattern<".pattern.">")
       try
-       exe "keepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*"
+       exe "NetrwKeepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*"
       catch /^Vim\%((\a\+)\)\=:E480/
        keepalt call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76)
 "       call Dret("netrw#Explore : unable to find pattern<".pattern.">")
@@ -888,7 +952,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
 "      call Decho("..case starpat=".starpat.": build **//pattern list  (recursive descent files containing pattern)")
 "      call Decho("....pattern<".pattern.">")
       try
-       exe "sil keepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*"
+       exe "sil NetrwKeepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*"
       catch /^Vim\%((\a\+)\)\=:E480/
        keepalt call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
        if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
@@ -927,7 +991,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
 "     call Decho("....w:netrw_explore_listlen=".w:netrw_explore_listlen)
 
      if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
-      keepalt keepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
+      keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
       if has("clipboard")
        sil! let @* = keepregstar
        sil! let @+ = keepregstar
@@ -947,7 +1011,7 @@ fun! netrw#Explore(indx,dosplit,style,...)
 "     call Decho("....wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")")
      let indx                = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0
      let w:netrw_explore_indx= indx
-     keepalt keepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
+     keepalt NetrwKeepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
     endif
 
     exe "let dirfile= w:netrw_explore_list[".indx."]"
@@ -961,20 +1025,20 @@ fun! netrw#Explore(indx,dosplit,style,...)
      let w:netrw_liststyle= g:netrw_liststyle
     endif
     if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST
-     keepalt keepj call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
+     keepalt NetrwKeepj call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
     else
-     keepalt keepj call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
+     keepalt NetrwKeepj call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
     endif
     let w:netrw_explore_mtchcnt = indx + 1
     let w:netrw_explore_bufnr   = bufnr("%")
     let w:netrw_explore_line    = line(".")
-    keepalt keepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
+    keepalt NetrwKeepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
 "    call Decho("....explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
 
    else
 "    call Decho("..your vim does not have +path_extra")
     if !exists("g:netrw_quiet")
-     keepalt keepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
+     keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
     endif
     if has("clipboard")
      sil! let @* = keepregstar
@@ -993,9 +1057,9 @@ fun! netrw#Explore(indx,dosplit,style,...)
    endif
    let newdir= dirname
    if !exists("b:netrw_curdir")
-    keepj call netrw#LocalBrowseCheck(getcwd())
+    NetrwKeepj call netrw#LocalBrowseCheck(getcwd())
    else
-    keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir))
+    NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir))
    endif
   endif
 
@@ -1057,50 +1121,99 @@ endfun
 
 " ---------------------------------------------------------------------
 " netrw#Lexplore: toggle Explorer window, keeping it on the left of the current tab {{{2
-fun! netrw#Lexplore(...)
-"  call Dfunc("netrw#Lexplore() a:0=".a:0)
+fun! netrw#Lexplore(count,rightside,...)
+"  call Dfunc("netrw#Lexplore(count=".a:count."rightside=".a:rightside.",...) a:0=".a:0." ft=".&ft)
+  let curwin= winnr()
+
   if a:0 > 0 && a:1 != ""
    " if a netrw window is already on the left-side of the tab
    " and a directory has been specified, explore with that
    " directory.
-   let lexwinnr= winnr()
+   let a1 = expand(a:1)
+"   call Decho("a:1<".a:1.">  curwin#".curwin)
    exe "1wincmd w"
    if &ft == "netrw"
-    exe "Explore ".fnameescape(a:1)
-    exe lexwinnr."wincmd w"
+"    call Decho("exe Explore ".fnameescape(a:1))
+    exe "Explore ".fnameescape(a1)
+    exe curwin."wincmd w"
+    if exists("t:netrw_lexposn")
+"     call Decho("forgetting t:netrw_lexposn")
+     unlet t:netrw_lexposn
+    endif
+"    call Dret("netrw#Lexplore")
+    return
    endif
-   exe lexwinnr."wincmd w"
-"   call Dret("netrw#Lexplore")
-   return
+   exe curwin."wincmd w"
+  else
+   let a1= ""
   endif
 
   if exists("t:netrw_lexbufnr")
-   " close down netrw explorer window
+   " check if t:netrw_lexbufnr refers to a netrw window
    let lexwinnr = bufwinnr(t:netrw_lexbufnr)
-   if lexwinnr != -1
-    let curwin   = winnr()
-    exe lexwinnr."wincmd w"
-    close
-    exe curwin."wincmd w"
-   endif
+  else
+   let lexwinnr= 0
+  endif
+
+  if lexwinnr > 0
+   " close down netrw explorer window
+"  call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window")
+   exe lexwinnr."wincmd w"
+   let g:netrw_winsize = -winwidth(0)
+   let t:netrw_lexposn = netrw#SavePosn()
+"   call Decho("saving t:netrw_lexposn")
+   close
+   if lexwinnr < curwin
+    let curwin= curwin - 1
+   endif
+   exe curwin."wincmd w"
    unlet t:netrw_lexbufnr
 
   else
    " open netrw explorer window
+"   call Decho("t:netrw_lexbufnr<n/a>: open netrw explorer window")
    exe "1wincmd w"
    let keep_altv    = g:netrw_altv
    let g:netrw_altv = 0
-   if a:0 > 0 && a:1 != ""
-    exe "Vexplore ".fnameescape(a:1)
+   if a:count != 0
+    let netrw_winsize   = g:netrw_winsize
+    let g:netrw_winsize = a:count
+   endif
+   let curfile= expand("%")
+"   call Decho("curfile<".curfile.">")
+   exe (a:rightside? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new"
+   if a:0 > 0 && a1 != ""
+"    call Decho("case 1: Explore ".a1)
+    exe "Explore ".fnameescape(a1)
+   elseif curfile =~ '^\a\+://'
+"    call Decho("case 2: Explore ".substitute(curfile,'[^/\\]*$','',''))
+    exe "Explore ".substitute(curfile,'[^/\\]*$','','')
    else
-    Vexplore .
+"    call Decho("case 3: Explore .")
+    Explore .
    endif
+   if a:count != 0
+    let g:netrw_winsize = netrw_winsize
+   endif
+   setlocal winfixwidth
    let g:netrw_altv     = keep_altv
    let t:netrw_lexbufnr = bufnr("%")
+   if exists("t:netrw_lexposn")
+"    call Decho("restoring to t:netrw_lexposn")
+    call netrw#RestorePosn(t:netrw_lexposn)
+    unlet t:netrw_lexposn
+   endif
   endif
+
+  " set up default window for editing via <cr>
   if exists("g:netrw_chgwin") && g:netrw_chgwin == -1
-   let g:netrw_chgwin= 2
+   if a:rightside
+    let g:netrw_chgwin= 1
+   else
+    let g:netrw_chgwin= 2
+   endif
   endif
+
 "  call Dret("netrw#Lexplore")
 endfun
 
@@ -1261,17 +1374,16 @@ fun! netrw#Obtain(islocal,fname,...)
      let path= ""
     endif
     let filelist= join(map(deepcopy(fnamelist),'shellescape(g:netrw_machine.":".path.v:val,1)'))
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1))
-    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".filelist." ".shellescape(tgtdir,1))
 
    elseif b:netrw_method == 2
     " obtain file using ftp + .netrc
 "     call Decho("obtain via ftp+.netrc (method #2)")
-     call s:SaveBufVars()|sil keepjumps new|call s:RestoreBufVars()
+     call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
      let tmpbufnr= bufnr("%")
      setl ff=unix
      if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
-      keepj put =g:netrw_ftpmode
+      NetrwKeepj put =g:netrw_ftpmode
 "      call Decho("filter input: ".getline('$'))
      endif
 
@@ -1281,7 +1393,7 @@ fun! netrw#Obtain(islocal,fname,...)
      endif
 
      if exists("g:netrw_ftpextracmd")
-      keepj put =g:netrw_ftpextracmd
+      NetrwKeepj put =g:netrw_ftpextracmd
 "      call Decho("filter input: ".getline('$'))
      endif
      for fname in fnamelist
@@ -1289,11 +1401,9 @@ fun! netrw#Obtain(islocal,fname,...)
 "      call Decho("filter input: ".getline('$'))
      endfor
      if exists("g:netrw_port") && g:netrw_port != ""
-"      call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
      else
-"      call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
      endif
      " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
      if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
@@ -1306,53 +1416,53 @@ fun! netrw#Obtain(islocal,fname,...)
    elseif b:netrw_method == 3
     " obtain with ftp + machine, id, passwd, and fname (ie. no .netrc)
 "    call Decho("obtain via ftp+mipf (method #3)")
-    call s:SaveBufVars()|sil keepjumps new|call s:RestoreBufVars()
+    call s:SaveBufVars()|sil NetrwKeepj new|call s:RestoreBufVars()
     let tmpbufnr= bufnr("%")
     setl ff=unix
 
     if exists("g:netrw_port") && g:netrw_port != ""
-     keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+     NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
 "     call Decho("filter input: ".getline('$'))
     else
-     keepj put ='open '.g:netrw_machine
+     NetrwKeepj put ='open '.g:netrw_machine
 "     call Decho("filter input: ".getline('$'))
     endif
 
     if exists("g:netrw_uid") && g:netrw_uid != ""
      if exists("g:netrw_ftp") && g:netrw_ftp == 1
-      keepj put =g:netrw_uid
+      NetrwKeepj put =g:netrw_uid
 "      call Decho("filter input: ".getline('$'))
       if exists("s:netrw_passwd") && s:netrw_passwd != ""
-       keepj put ='\"'.s:netrw_passwd.'\"'
+       NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
       endif
 "      call Decho("filter input: ".getline('$'))
      elseif exists("s:netrw_passwd")
-      keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+      NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
 "      call Decho("filter input: ".getline('$'))
      endif
     endif
 
     if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
-     keepj put =g:netrw_ftpmode
+     NetrwKeepj put =g:netrw_ftpmode
 "     call Decho("filter input: ".getline('$'))
     endif
 
     if exists("b:netrw_fname") && b:netrw_fname != ""
-     keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+     NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
 "     call Decho("filter input: ".getline('$'))
     endif
 
     if exists("g:netrw_ftpextracmd")
-     keepj put =g:netrw_ftpextracmd
+     NetrwKeepj put =g:netrw_ftpextracmd
 "     call Decho("filter input: ".getline('$'))
     endif
 
     if exists("g:netrw_ftpextracmd")
-     keepj put =g:netrw_ftpextracmd
+     NetrwKeepj put =g:netrw_ftpextracmd
 "     call Decho("filter input: ".getline('$'))
     endif
     for fname in fnamelist
-     keepj call setline(line("$")+1,'get "'.fname.'"')
+     NetrwKeepj call setline(line("$")+1,'get "'.fname.'"')
     endfor
 "    call Decho("filter input: ".getline('$'))
 
@@ -1360,14 +1470,13 @@ fun! netrw#Obtain(islocal,fname,...)
     " -i       : turns off interactive prompting from ftp
     " -n  unix : DON'T use <.netrc>, even though it exists
     " -n  win32: quit being obnoxious about password
-    keepj norm! 1Gdd
-"    call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
-    exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+    NetrwKeepj norm! 1Gdd
+    call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
     if getline(1) !~ "^$"
 "     call Decho("error<".getline(1).">")
      if !exists("g:netrw_quiet")
-      keepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
+      NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),5)
      endif
     endif
 
@@ -1379,8 +1488,7 @@ fun! netrw#Obtain(islocal,fname,...)
     else
      let localfile= a:fname
     endif
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
-    exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1).shellescape(localfile)." ".shellescape(tgtdir))
 
    elseif !exists("b:netrw_method") || b:netrw_method < 0
     " probably a badly formed url; protocol not recognized
@@ -1390,7 +1498,7 @@ fun! netrw#Obtain(islocal,fname,...)
    else
     " protocol recognized but not supported for Obtain (yet?)
     if !exists("g:netrw_quiet")
-     keepj call netrw#ErrorMsg(s:ERROR,"current protocol not supported for obtaining file",97)
+     NetrwKeepj call netrw#ErrorMsg(s:ERROR,"current protocol not supported for obtaining file",97)
     endif
 "    call Dret("netrw#Obtain : current protocol not supported for obtaining file")
     return
@@ -1398,7 +1506,7 @@ fun! netrw#Obtain(islocal,fname,...)
 
    " restore status line
    if type(a:fname) == 1 && exists("s:netrw_users_stl")
-    keepj call s:SetupNetrwStatusLine(s:netrw_users_stl)
+    NetrwKeepj call s:SetupNetrwStatusLine(s:netrw_users_stl)
    endif
 
   endif
@@ -1440,7 +1548,7 @@ fun! s:NetrwOptionRestore(vt)
   if !exists("{a:vt}netrw_optionsave")
    if exists("s:nbcd_curpos_{bufnr('%')}")
 "    call Decho("restoring previous position  (s:nbcd_curpos_".bufnr('%')." exists)")
-    keepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+    NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
 "    call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"))
 "    call Decho("unlet s:nbcd_curpos_".bufnr('%'))
     unlet s:nbcd_curpos_{bufnr('%')}
@@ -1481,7 +1589,9 @@ fun! s:NetrwOptionRestore(vt)
   if exists("{a:vt}netrw_cpokeep")  |let &l:cpo    = {a:vt}netrw_cpokeep     |unlet {a:vt}netrw_cpokeep  |endif
   if exists("{a:vt}netrw_diffkeep") |let &l:diff   = {a:vt}netrw_diffkeep    |unlet {a:vt}netrw_diffkeep |endif
   if exists("{a:vt}netrw_fenkeep")  |let &l:fen    = {a:vt}netrw_fenkeep     |unlet {a:vt}netrw_fenkeep  |endif
-  if exists("{a:vt}netrw_ffkeep")   |let &l:ff     = {a:vt}netrw_ffkeep      |unlet {a:vt}netrw_ffkeep   |endif
+  if exists("g:netrw_ffkep") && g:netrw_ffkeep
+   if exists("{a:vt}netrw_ffkeep")   |let &l:ff     = {a:vt}netrw_ffkeep      |unlet {a:vt}netrw_ffkeep   |endif
+  endif
   if exists("{a:vt}netrw_fokeep")   |let &l:fo     = {a:vt}netrw_fokeep      |unlet {a:vt}netrw_fokeep   |endif
   if exists("{a:vt}netrw_gdkeep")   |let &l:gd     = {a:vt}netrw_gdkeep      |unlet {a:vt}netrw_gdkeep   |endif
   if exists("{a:vt}netrw_hidkeep")  |let &l:hidden = {a:vt}netrw_hidkeep     |unlet {a:vt}netrw_hidkeep  |endif
@@ -1535,7 +1645,7 @@ fun! s:NetrwOptionRestore(vt)
   if exists("{a:vt}netrw_regslash")|sil! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif
   if exists("s:nbcd_curpos_{bufnr('%')}")
 "   call Decho("restoring previous position  (s:nbcd_curpos_".bufnr('%')." exists)")
-   keepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
+   NetrwKeepj call netrw#RestorePosn(s:nbcd_curpos_{bufnr('%')})
 "   call Decho("unlet s:nbcd_curpos_".bufnr('%'))
    if exists("s:nbcd_curpos_".bufnr('%'))
     unlet s:nbcd_curpos_{bufnr('%')}
@@ -1599,7 +1709,7 @@ fun! s:NetrwOptionSave(vt)
   let {a:vt}netrw_cpokeep   = &l:cpo
   let {a:vt}netrw_diffkeep  = &l:diff
   let {a:vt}netrw_fenkeep   = &l:fen
-  if !exists("g:netrw_ffkeep") || g:netrw_ffkeep == 1
+  if !exists("g:netrw_ffkeep") || g:netrw_ffkeep
    let {a:vt}netrw_ffkeep    = &l:ff
   endif
   let {a:vt}netrw_fokeep    = &l:fo           " formatoptions
@@ -1686,10 +1796,10 @@ fun! s:NetrwSafeOptions()
 "  call Decho("ft<".&ft."> ei=".&ei)
   if &ft == "netrw"
 "   call Decho("do any netrw FileType autocmds (doau FileType netrw)")
-   sil! keepalt keepj doau FileType netrw
+   sil! keepalt NetrwKeepj doau FileType netrw
   endif
 
-"  call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh)
+"  call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist")." bh=".&l:bh." bt<".&bt.">")
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "  call Dret("s:NetrwSafeOptions")
 endfun
@@ -1744,6 +1854,10 @@ fun! netrw#NetRead(mode,...)
   call s:NetrwOptionSave("w:")
   call s:NetrwSafeOptions()
   call s:RestoreCursorline()
+  " NetrwSafeOptions sets a buffer up for a netrw listing, which includes buflisting off.
+  " However, this setting is not wanted for a remote editing session.  The buffer should be "nofile", still.
+  setl bl
+"  call Decho("(netrw#NetRead) buf#".bufnr("%")."<".bufname("%")."> bl=".&bl." bt=".&bt." bh=".&bh)
 
   " NetRead: interpret mode into a readcmd {{{3
   if     a:mode == 0 " read remote file before current line
@@ -1790,6 +1904,7 @@ fun! netrw#NetRead(mode,...)
      echomsg ':Nread fetch://machine/path                 uses fetch'
      echomsg ':Nread ftp://[user@]machine[:port]/path     uses ftp   autodetects <.netrc>'
      echomsg ':Nread http://[user@]machine/path           uses http  wget'
+     echomsg ':Nread file:///path           		  uses elinks'
      echomsg ':Nread https://[user@]machine/path          uses http  wget'
      echomsg ':Nread rcp://[user@]machine/path            uses rcp'
      echomsg ':Nread rsync://machine[:port]/path          uses rsync'
@@ -1841,7 +1956,7 @@ fun! netrw#NetRead(mode,...)
 "   call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
    if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^https\=://'
 "    call Decho("yes, choice matches '^.*[\/]$'")
-    keepj call s:NetrwBrowse(0,choice)
+    NetrwKeepj call s:NetrwBrowse(0,choice)
 "    call Dret("netrw#NetRead :3 getcwd<".getcwd().">")
     return
    endif
@@ -1875,8 +1990,7 @@ fun! netrw#NetRead(mode,...)
      let uid_machine = g:netrw_machine
     endif
    endif
-"   call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
-   exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+   call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
    let result           = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
    let b:netrw_lastfile = choice
 
@@ -1885,29 +1999,27 @@ fun! netrw#NetRead(mode,...)
    elseif b:netrw_method  == 2		" read with ftp + <.netrc>
 "     call Decho("read via ftp+.netrc (method #2)")
      let netrw_fname= b:netrw_fname
-     keepj call s:SaveBufVars()|new|keepj call s:RestoreBufVars()
+     NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
      let filtbuf= bufnr("%")
      setl ff=unix
-     keepj put =g:netrw_ftpmode
+     NetrwKeepj put =g:netrw_ftpmode
 "     call Decho("filter input: ".getline(line("$")))
      if exists("g:netrw_ftpextracmd")
-      keepj put =g:netrw_ftpextracmd
+      NetrwKeepj put =g:netrw_ftpextracmd
 "      call Decho("filter input: ".getline(line("$")))
      endif
      call setline(line("$")+1,'get "'.netrw_fname.'" '.tmpfile)
 "     call Decho("filter input: ".getline(line("$")))
      if exists("g:netrw_port") && g:netrw_port != ""
-"      call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
      else
-"      call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
      endif
      " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
      if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
       let debugkeep = &debug
       setl debug=msg
-      keepj call netrw#ErrorMsg(s:ERROR,getline(1),4)
+      NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),4)
       let &debug    = debugkeep
      endif
      call s:SaveBufVars()
@@ -1926,49 +2038,48 @@ fun! netrw#NetRead(mode,...)
     " Construct execution string (four lines) which will be passed through filter
 "    call Decho("read via ftp+mipf (method #3)")
     let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-    keepj call s:SaveBufVars()|new|keepj call s:RestoreBufVars()
+    NetrwKeepj call s:SaveBufVars()|new|NetrwKeepj call s:RestoreBufVars()
     let filtbuf= bufnr("%")
     setl ff=unix
     if exists("g:netrw_port") && g:netrw_port != ""
-     keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+     NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
 "     call Decho("filter input: ".getline('.'))
     else
-     keepj put ='open '.g:netrw_machine
+     NetrwKeepj put ='open '.g:netrw_machine
 "     call Decho("filter input: ".getline('.'))
     endif
 
     if exists("g:netrw_uid") && g:netrw_uid != ""
      if exists("g:netrw_ftp") && g:netrw_ftp == 1
-      keepj put =g:netrw_uid
+      NetrwKeepj put =g:netrw_uid
 "       call Decho("filter input: ".getline('.'))
       if exists("s:netrw_passwd")
-       keepj put ='\"'.s:netrw_passwd.'\"'
+       NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
       endif
 "      call Decho("filter input: ".getline('.'))
      elseif exists("s:netrw_passwd")
-      keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+      NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
 "      call Decho("filter input: ".getline('.'))
      endif
     endif
 
     if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
-     keepj put =g:netrw_ftpmode
+     NetrwKeepj put =g:netrw_ftpmode
 "     call Decho("filter input: ".getline('.'))
     endif
     if exists("g:netrw_ftpextracmd")
-     keepj put =g:netrw_ftpextracmd
+     NetrwKeepj put =g:netrw_ftpextracmd
 "     call Decho("filter input: ".getline('.'))
     endif
-    keepj put ='get \"'.netrw_fname.'\" '.tmpfile
+    NetrwKeepj put ='get \"'.netrw_fname.'\" '.tmpfile
 "    call Decho("filter input: ".getline('.'))
 
     " perform ftp:
     " -i       : turns off interactive prompting from ftp
     " -n  unix : DON'T use <.netrc>, even though it exists
     " -n  win32: quit being obnoxious about password
-    keepj norm! 1Gdd
-"    call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
-    exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+    NetrwKeepj norm! 1Gdd
+    call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
     if getline(1) !~ "^$"
 "     call Decho("error<".getline(1).">")
@@ -1989,8 +2100,14 @@ fun! netrw#NetRead(mode,...)
     else
      let useport= ""
     endif
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
-    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+    " 'C' in 'C:\path\to\file' is handled as hostname on windows.
+    " This is workaround to avoid mis-handle windows local-path:
+    if g:netrw_scp_cmd =~ '^scp' && (has("win32") || has("win95") || has("win64") || has("win16"))
+      let tmpfile_get = substitute(tr(tmpfile, '\', '/'), '^\(\a\):[/\\]\(.*\)$', '/\1/\2', '')
+    else
+      let tmpfile_get = tmpfile
+    endif
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile_get,1))
     let result           = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
     let b:netrw_lastfile = choice
 
@@ -2010,11 +2127,9 @@ fun! netrw#NetRead(mode,...)
      " using g:netrw_http_cmd (usually elinks, links, curl, wget, or fetch)
 "     call Decho('using '.g:netrw_http_cmd.' (# not in b:netrw_fname<'.b:netrw_fname.">)")
      if exists("g:netrw_http_xcmd")
-"      call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1))
-      exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1)
+      call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)." ".g:netrw_http_xcmd." ".shellescape(tmpfile,1))
      else
-"      call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
-      exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1)
+      call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.b:netrw_fname,1))
      endif
      let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
 
@@ -2025,11 +2140,10 @@ fun! netrw#NetRead(mode,...)
      let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
 "     call Decho("netrw_html<".netrw_html.">")
 "     call Decho("netrw_tag <".netrw_tag.">")
-"     call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1))
-     exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1)
+     call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile,1)." ".shellescape(b:netrw_http."://".g:netrw_machine.netrw_html,1))
      let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
 "     call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
-     exe 'keepj norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
+     exe 'NetrwKeepj norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
     endif
     let b:netrw_lastfile = choice
 "    call Decho("setl ro")
@@ -2046,28 +2160,26 @@ fun! netrw#NetRead(mode,...)
      return
     endif
     if g:netrw_dav_cmd =~ "curl"
-"     call Decho("exe ".s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1))
-     exe s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1)
+     call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_dav_cmd." ".shellescape("dav://".g:netrw_machine.b:netrw_fname,1)." ".shellescape(tmpfile,1))
     else
      " Construct execution string (four lines) which will be passed through filter
      let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
      new
      setl ff=unix
      if exists("g:netrw_port") && g:netrw_port != ""
-      keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+      NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
      else
-      keepj put ='open '.g:netrw_machine
+      NetrwKeepj put ='open '.g:netrw_machine
      endif
      if exists("g:netrw_uid") && exists("s:netrw_passwd") && g:netrw_uid != ""
-      keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
+      NetrwKeepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
      endif
-     keepj put ='get '.netrw_fname.' '.tmpfile
-     keepj put ='quit'
+     NetrwKeepj put ='get '.netrw_fname.' '.tmpfile
+     NetrwKeepj put ='quit'
 
      " perform cadaver operation:
-     keepj norm! 1Gdd
-"    call Decho("executing: %!".g:netrw_dav_cmd)
-     exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
+     NetrwKeepj norm! 1Gdd
+     call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd)
      bd!
     endif
     let result           = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
@@ -2077,8 +2189,7 @@ fun! netrw#NetRead(mode,...)
    " NetRead: (rsync) NetRead Method #7 {{{3
    elseif     b:netrw_method  == 7
 "    call Decho("read via rsync (method #7)")
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
-    exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".shellescape(tmpfile,1))
     let result		 = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
     let b:netrw_lastfile = choice
 
@@ -2089,7 +2200,7 @@ fun! netrw#NetRead(mode,...)
 "    call Decho("read via fetch (method #8)")
     if g:netrw_fetch_cmd == ""
      if !exists("g:netrw_quiet")
-      keepj call netrw#ErrorMsg(s:ERROR,"fetch command not available",7)
+      NetrwKeepj call netrw#ErrorMsg(s:ERROR,"fetch command not available",7)
      endif
 "     call Dret("NetRead")
      return
@@ -2102,11 +2213,9 @@ fun! netrw#NetRead(mode,...)
 "    call Decho("read via fetch for ".netrw_option)
 
     if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != ""
-"     call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1))
-     exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1)
+     call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".b:netrw_fname,1))
     else
-"     call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
-     exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1)
+     call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".shellescape(tmpfile,1)." ".shellescape(netrw_option."://".g:netrw_machine."/".b:netrw_fname,1))
     endif
 
     let result		= s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
@@ -2118,11 +2227,18 @@ fun! netrw#NetRead(mode,...)
    " NetRead: (sftp) NetRead Method #9 {{{3
    elseif     b:netrw_method  == 9
 "    call Decho("read via sftp (method #9)")
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
-    exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)." ".tmpfile)
     let result		= s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
     let b:netrw_lastfile = choice
 
+   ".........................................
+   " NetRead: (file) NetRead Method #10 {{{3
+  elseif      b:netrw_method == 10 && exists("g:netrw_file_cmd")
+"   "    call Decho("read via ".b:netrw_file_cmd." (method #10)")
+   call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_file_cmd." ".shellescape(b:netrw_fname,1)." ".tmpfile)
+   let result		= s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
+   let b:netrw_lastfile = choice
+
    ".........................................
    " NetRead: Complain {{{3
    else
@@ -2138,9 +2254,9 @@ fun! netrw#NetRead(mode,...)
   endif
   if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't' && tmpfile !~ '.tar.xz$' && tmpfile !~ '.txz'
 "   call Decho("cleanup by deleting tmpfile<".tmpfile.">")
-   keepj call s:NetrwDelete(tmpfile)
+   NetrwKeepj call s:NetrwDelete(tmpfile)
   endif
-  keepj call s:NetrwOptionRestore("w:")
+  NetrwKeepj call s:NetrwOptionRestore("w:")
 
 "  call Dret("netrw#NetRead :5 getcwd<".getcwd().">")
 endfun
@@ -2175,16 +2291,16 @@ fun! netrw#NetWrite(...) range
    " (line numbers don't really make sense for that).
    " Also supports the writing of tar and zip files.
 "   call Decho("(write entire file) sil exe w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
-   exe "sil keepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
+   exe "sil NetrwKeepj w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
   elseif g:netrw_cygwin
    " write (selected portion of) file to temporary
    let cygtmpfile= substitute(tmpfile,g:netrw_cygdrive.'/\(.\)','\1:','')
 "   call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile))
-   exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)
+   exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(cygtmpfile)
   else
    " write (selected portion of) file to temporary
 "   call Decho("(write selected portion) sil exe ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile))
-   exe "sil keepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
+   exe "sil NetrwKeepj ".a:firstline."," . a:lastline . "w! ".fnameescape(v:cmdarg)." ".fnameescape(tmpfile)
   endif
 
   if curbufname == ""
@@ -2251,7 +2367,7 @@ fun! netrw#NetWrite(...) range
 "   call Decho("choice<" . choice . "> ichoice=".ichoice)
 
    " Determine method of write (ftp, rcp, etc) {{{4
-   keepj call s:NetrwMethod(choice)
+   NetrwKeepj call s:NetrwMethod(choice)
    if !exists("b:netrw_method") || b:netrw_method < 0
 "    call Dfunc("netrw#NetWrite : unsupported method")
     return
@@ -2282,8 +2398,7 @@ fun! netrw#NetWrite(...) range
       let uid_machine = g:netrw_machine
      endif
     endif
-"    call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1))
-    exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile,1)." ".shellescape(uid_machine.":".b:netrw_fname,1))
     let b:netrw_lastfile = choice
 
    ".........................................
@@ -2300,26 +2415,24 @@ fun! netrw#NetWrite(...) range
 
 "    call Decho("filter input window#".winnr())
     setl ff=unix
-    keepj put =g:netrw_ftpmode
+    NetrwKeepj put =g:netrw_ftpmode
 "    call Decho("filter input: ".getline('$'))
     if exists("g:netrw_ftpextracmd")
-     keepj put =g:netrw_ftpextracmd
+     NetrwKeepj put =g:netrw_ftpextracmd
 "     call Decho("filter input: ".getline("$"))
     endif
-    keepj call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"')
+    NetrwKeepj call setline(line("$")+1,'put "'.tmpfile.'" "'.netrw_fname.'"')
 "    call Decho("filter input: ".getline("$"))
     if exists("g:netrw_port") && g:netrw_port != ""
-"     call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
-     exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+     call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
     else
 "     call Decho("filter input window#".winnr())
-"     call Decho("executing: %!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
-     exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+     call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
     endif
     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
     if getline(1) !~ "^$"
      if !exists("g:netrw_quiet")
-      keepj call netrw#ErrorMsg(s:ERROR,getline(1),14)
+      NetrwKeepj call netrw#ErrorMsg(s:ERROR,getline(1),14)
      endif
      let mod=1
     endif
@@ -2347,32 +2460,32 @@ fun! netrw#NetWrite(...) range
     setl ff=unix
 
     if exists("g:netrw_port") && g:netrw_port != ""
-     keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+     NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
 "     call Decho("filter input: ".getline('.'))
     else
-     keepj put ='open '.g:netrw_machine
+     NetrwKeepj put ='open '.g:netrw_machine
 "     call Decho("filter input: ".getline('.'))
     endif
     if exists("g:netrw_uid") && g:netrw_uid != ""
      if exists("g:netrw_ftp") && g:netrw_ftp == 1
-      keepj put =g:netrw_uid
+      NetrwKeepj put =g:netrw_uid
 "      call Decho("filter input: ".getline('.'))
       if exists("s:netrw_passwd") && s:netrw_passwd != ""
-       keepj put ='\"'.s:netrw_passwd.'\"'
+       NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
       endif
 "      call Decho("filter input: ".getline('.'))
      elseif exists("s:netrw_passwd") && s:netrw_passwd != ""
-      keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+      NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
 "      call Decho("filter input: ".getline('.'))
      endif
     endif
-    keepj put =g:netrw_ftpmode
+    NetrwKeepj put =g:netrw_ftpmode
 "    call Decho("filter input: ".getline('$'))
     if exists("g:netrw_ftpextracmd")
-     keepj put =g:netrw_ftpextracmd
+     NetrwKeepj put =g:netrw_ftpextracmd
 "     call Decho("filter input: ".getline("$"))
     endif
-    keepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
+    NetrwKeepj put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
 "    call Decho("filter input: ".getline('.'))
     " save choice/id/password for future use
     let b:netrw_lastfile = choice
@@ -2381,9 +2494,8 @@ fun! netrw#NetWrite(...) range
     " -i       : turns off interactive prompting from ftp
     " -n  unix : DON'T use <.netrc>, even though it exists
     " -n  win32: quit being obnoxious about password
-    keepj norm! 1Gdd
-"    call Decho("executing: %!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
-    exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+    NetrwKeepj norm! 1Gdd
+    call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
     if getline(1) !~ "^$"
      if  !exists("g:netrw_quiet")
@@ -2407,8 +2519,7 @@ fun! netrw#NetWrite(...) range
     else
      let useport= ""
     endif
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
-    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
     let b:netrw_lastfile = choice
 
    ".........................................
@@ -2418,8 +2529,7 @@ fun! netrw#NetWrite(...) range
     let curl= substitute(g:netrw_http_put_cmd,'\s\+.*$',"","")
     if executable(curl)
      let url= g:netrw_choice
-"     call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) )
-     exe s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) 
+     call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_http_put_cmd." ".shellescape(tmpfile,1)." ".shellescape(url,1) )
     elseif !exists("g:netrw_quiet")
      call netrw#ErrorMsg(s:ERROR,"can't write to http using <".g:netrw_http_put_cmd".">".",16)
     endif
@@ -2440,19 +2550,18 @@ fun! netrw#NetWrite(...) range
 
     setl ff=unix
     if exists("g:netrw_port") && g:netrw_port != ""
-     keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+     NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
     else
-     keepj put ='open '.g:netrw_machine
+     NetrwKeepj put ='open '.g:netrw_machine
     endif
     if exists("g:netrw_uid") && exists("s:netrw_passwd") && g:netrw_uid != ""
-     keepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
+     NetrwKeepj put ='user '.g:netrw_uid.' '.s:netrw_passwd
     endif
-    keepj put ='put '.tmpfile.' '.netrw_fname
+    NetrwKeepj put ='put '.tmpfile.' '.netrw_fname
 
     " perform cadaver operation:
-    keepj norm! 1Gdd
-"    call Decho("executing: %!".g:netrw_dav_cmd)
-    exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
+    NetrwKeepj norm! 1Gdd
+    call s:NetrwExe(s:netrw_silentxfer."%!".g:netrw_dav_cmd)
 
     " remove enew buffer (quietly)
     let filtbuf= bufnr("%")
@@ -2466,8 +2575,7 @@ fun! netrw#NetWrite(...) range
    " NetWrite: (rsync) NetWrite Method #7 {{{3
    elseif     b:netrw_method == 7
 "    call Decho("write via rsync (method #7)")
-"    call Decho("executing: !".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
-    exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(tmpfile,1)." ".shellescape(g:netrw_machine.":".b:netrw_fname,1))
     let b:netrw_lastfile = choice
 
    ".........................................
@@ -2490,9 +2598,8 @@ fun! netrw#NetWrite(...) range
     setl ff=unix
     call setline(1,'put "'.escape(tmpfile,'\').'" '.netrw_fname)
 "    call Decho("filter input: ".getline('.'))
-"    call Decho("executing: %!".g:netrw_sftp_cmd.' '.shellescape(uid_machine,1))
     let sftpcmd= substitute(g:netrw_sftp_cmd,"%TEMPFILE%",escape(tmpfile,'\'),"g")
-    exe s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1)
+    call s:NetrwExe(s:netrw_silentxfer."%!".sftpcmd.' '.shellescape(uid_machine,1))
     let filtbuf= bufnr("%")
     exe curbuf."b!"
     let &l:bh            = bhkeep
@@ -2670,12 +2777,12 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
     call tar#Browse(tfile)
    else
 "    call Decho("edit temporary file")
-    e!
+    NetrwKeepj e!
    endif
 
    " rename buffer back to remote filename
 "   call Decho("exe sil! keepalt file ".fnameescape(rfile))
-   exe "sil! keepj keepalt file ".fnameescape(rfile)
+   exe "sil! NetrwKeepj keepalt file ".fnameescape(rfile)
 
    " Detect filetype of local version of remote file.
    " Note that isk must not include a "/" for scripts.vim
@@ -2690,7 +2797,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
 
   elseif !&ma
    " attempting to read a file after the current line in the file, but the buffer is not modifiable
-   keepj call netrw#ErrorMsg(s:WARNING,"attempt to read<".a:tfile."> into a non-modifiable buffer!",94)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"attempt to read<".a:tfile."> into a non-modifiable buffer!",94)
 "   call Dret("NetrwGetFile : attempt to read<".a:tfile."> into a non-modifiable buffer!") 
    return
 
@@ -2700,7 +2807,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
    let curline = line(".")
    let lastline= line("$")
 "   call Decho("exe<".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile).">  line#".curline)
-   exe "keepj ".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)
+   exe "NetrwKeepj ".a:readcmd." ".fnameescape(v:cmdarg)." ".fnameescape(a:tfile)
    let line1= curline + 1
    let line2= line("$") - lastline + 1
 
@@ -2708,7 +2815,7 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
    " not readable
 "   call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
 "   call Decho("tfile<".a:tfile."> not readable")
-   keepj call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
 "   call Dret("NetrwGetFile : tfile<".a:tfile."> not readable")
    return
   endif
@@ -2716,14 +2823,14 @@ fun! s:NetrwGetFile(readcmd, tfile, method)
   " User-provided (ie. optional) fix-it-up command
   if exists("*NetReadFixup")
 "   call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
-   keepj call NetReadFixup(a:method, line1, line2)
+   NetrwKeepj call NetReadFixup(a:method, line1, line2)
 "  else " Decho
 "   call Decho("NetReadFixup() not called, doesn't exist  (line1=".line1." line2=".line2.")")
   endif
 
   if has("gui") && has("menu") && has("gui_running") && &go =~# 'm' && g:netrw_menu
    " update the Buffers menu
-   keepj call s:UpdateBuffersMenu()
+   NetrwKeepj call s:UpdateBuffersMenu()
   endif
 
 "  call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile))
@@ -2749,6 +2856,7 @@ endfun
 "	           7: rsync                                           
 "	           8: fetch                                           
 "	           9: sftp                                            
+"	          10: file
 "  g:netrw_machine= hostname
 "  b:netrw_fname  = filename
 "  g:netrw_port   = optional port number (for ftp)
@@ -2799,11 +2907,9 @@ fun! s:NetrwMethod(choice)
   " rsyncurm : rsync://host[:port]/path              Use rsync
   " fetchurm : fetch://[user@]host[:http]/filename   Use fetch (defaults to ftp, override for http)
   " sftpurm  : sftp://[user@]host/filename  Use scp
+  " fileurm  : file://[user@]host/filename	     Use elinks or links
   let mipf     = '^\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)$'
   let mf       = '^\(\S\+\)\s\+\(\S\+\)$'
-"  let ftpurm   = '^ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
-"  let rcpurm   = '^rcp://\%(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$'
-"  let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
   let ftpurm   = '^ftp://\(\([^/]*\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
   let rcpurm   = '^rcp://\%(\([^/]*\)@\)\=\([^/]\{-}\)/\(.*\)$'
   let rcphf    = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$'
@@ -2813,6 +2919,7 @@ fun! s:NetrwMethod(choice)
   let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$'
   let fetchurm = '^fetch://\(\([^/]*\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
   let sftpurm  = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
+  let fileurm  = '^file\=://\(.*\)$'
 
 "  call Decho("determine method:")
   " Determine Method
@@ -2969,6 +3076,13 @@ fun! s:NetrwMethod(choice)
     let g:netrw_uid= userid
    endif
 
+   " Method#10: file://user@hostname/...path-to-file {{{3
+  elseif match(a:choice,fileurm) == 0 && exists("g:netrw_file_cmd")
+"   call Decho("http[s]://...")
+   let b:netrw_method = 10
+   let b:netrw_fname  = substitute(a:choice,fileurm,'\1',"")
+"   call Decho('\1<'.substitute(a:choice,fileurm,'\1',"").">")
+
   " Cannot Determine Method {{{3
   else
    if !exists("g:netrw_quiet")
@@ -3023,7 +3137,7 @@ if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
    if method == 3   " ftp (no <.netrc>)
     let fourblanklines= line2 - 3
     if fourblanklines >= line1
-     exe "sil keepj ".fourblanklines.",".line2."g/^\s*$/d"
+     exe "sil NetrwKeepj ".fourblanklines.",".line2."g/^\s*$/d"
      call histdel("/",-1)
     endif
    endif
@@ -3163,9 +3277,9 @@ endfun
 "    0: (user: <mb>)   bookmark current directory
 "    1: (user: <gb>)   change to the bookmarked directory
 "    2: (user: <qb>)   list bookmarks
-"    3: (browsing)     record current directory history
-"    4: (user: <u>)    go up   (previous) bookmark
-"    5: (user: <U>)    go down (next)     bookmark
+"    3: (browsing)     records current directory history
+"    4: (user: <u>)    go up   (previous) directory, using history
+"    5: (user: <U>)    go down (next)     directory, using history
 "    6: (user: <mB>)   delete bookmark
 fun! s:NetrwBookHistHandler(chg,curdir)
 "  call Dfunc("s:NetrwBookHistHandler(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." histcnt=".g:netrw_dirhist_cnt." histmax=".g:netrw_dirhistmax)
@@ -3174,26 +3288,26 @@ fun! s:NetrwBookHistHandler(chg,curdir)
    return
   endif
 
-  let ykeep= @@
+  let ykeep    = @@
+  let curbufnr = bufnr("%")
+
   if a:chg == 0
    " bookmark the current directory
 "   call Decho("(user: <b>) bookmark the current directory")
-   if !exists("g:netrw_bookmarklist")
-    let g:netrw_bookmarklist= []
-   endif
-   if index(g:netrw_bookmarklist,a:curdir) == -1
-    " curdir not currently in g:netrw_bookmarklist, so include it
-    call add(g:netrw_bookmarklist,a:curdir)
-    call sort(g:netrw_bookmarklist)
+   if exists("s:netrwmarkfilelist_{curbufnr}")
+    call s:NetrwBookmark(0)
+    echo "bookmarked marked files"
+   else
+    call s:MakeBookmark(a:curdir)
+    echo "bookmarked the current directory"
    endif
-   echo "bookmarked the current directory"
 
   elseif a:chg == 1
    " change to the bookmarked directory
 "   call Decho("(user: <".v:count."gb>) change to the bookmarked directory")
    if exists("g:netrw_bookmarklist[v:count-1]")
 "    call Decho("(user: <".v:count."gb>) bookmarklist=".string(g:netrw_bookmarklist))
-    exe "keepj e ".fnameescape(g:netrw_bookmarklist[v:count-1])
+    exe "NetrwKeepj e ".fnameescape(g:netrw_bookmarklist[v:count-1])
    else
     echomsg "Sorry, bookmark#".v:count." doesn't exist!"
    endif
@@ -3267,13 +3381,13 @@ fun! s:NetrwBookHistHandler(chg,curdir)
     if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
      setl ma noro
 "     call Decho("setl ma noro")
-     sil! keepj %d
+     sil! NetrwKeepj %d
      setl nomod
 "     call Decho("setl nomod")
 "     call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
     endif
 "    call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
-    exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
+    exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
    else
     if g:netrw_dirhistmax > 0
      let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt + v:count1 ) % g:netrw_dirhistmax
@@ -3293,14 +3407,14 @@ fun! s:NetrwBookHistHandler(chg,curdir)
      if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
 "      call Decho("setl ma noro")
       setl ma noro
-      sil! keepj %d
+      sil! NetrwKeepj %d
 "      call Decho("removed all lines from buffer (%d)")
 "      call Decho("setl nomod")
       setl nomod
 "      call Decho("(set nomod)  ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
      endif
 "    call Decho("exe e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt}))
-     exe "keepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
+     exe "NetrwKeepj e! ".fnameescape(g:netrw_dirhist_{g:netrw_dirhist_cnt})
     else
      let g:netrw_dirhist_cnt= ( g:netrw_dirhist_cnt - 1 ) % g:netrw_dirhistmax
      if g:netrw_dirhist_cnt < 0
@@ -3314,17 +3428,17 @@ fun! s:NetrwBookHistHandler(chg,curdir)
    endif
 
   elseif a:chg == 6
-   " delete the v:count'th bookmark
-"   call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">")
-   let savefile= s:NetrwHome()."/.netrwbook"
-   if filereadable(savefile)
-"    call Decho("merge bookmarks (active and file)")
-    keepj call s:NetrwBookHistSave() " done here to merge bookmarks first
-"    call Decho("bookmark delete savefile<".savefile.">")
-    keepj call delete(savefile)
-   endif
+   if exists("s:netrwmarkfilelist_{curbufnr}")
+    call s:NetrwBookmark(1)
+    echo "removed marked files from bookmarks"
+   else
+    " delete the v:count'th bookmark
+"    call Decho("delete bookmark#".v:count."<".g:netrw_bookmarklist[v:count-1].">")
+    call s:MergeBookmarks()
 "   call Decho("remove g:netrw_bookmarklist[".(v:count-1)."]")
-   keepj call remove(g:netrw_bookmarklist,v:count-1)
+    NetrwKeepj call remove(g:netrw_bookmarklist,v:count-1)
+    echo "removed current directory from bookmarks"
+   endif
 "   call Decho("resulting g:netrw_bookmarklist=".string(g:netrw_bookmarklist))
   endif
   call s:NetrwBookmarkMenu()
@@ -3335,6 +3449,7 @@ endfun
 
 " ---------------------------------------------------------------------
 " s:NetrwBookHistRead: this function reads bookmarks and history {{{2
+"  Will source the history file (.netrwhist) only if the g:netrw_disthistmax is > 0.
 "                      Sister function: s:NetrwBookHistSave()
 fun! s:NetrwBookHistRead()
 "  call Dfunc("s:NetrwBookHistRead()")
@@ -3348,13 +3463,13 @@ fun! s:NetrwBookHistRead()
    let savefile= home."/.netrwbook"
    if filereadable(savefile)
 "    call Decho("sourcing .netrwbook")
-    exe "keepalt keepj so ".savefile
+    exe "keepalt NetrwKeepj so ".savefile
    endif
    if g:netrw_dirhistmax > 0
     let savefile= home."/.netrwhist"
     if filereadable(savefile)
 "    call Decho("sourcing .netrwhist")
-     exe "keepalt keepj so ".savefile
+     exe "keepalt NetrwKeepj so ".savefile
     endif
     let s:netrw_initbookhist= 1
     au VimLeave * call s:NetrwBookHistSave()
@@ -3369,6 +3484,8 @@ endfun
 "                      Sister function: s:NetrwBookHistRead()
 "                      I used to do this via viminfo but that appears to
 "                      be unreliable for long-term storage
+"                      If g:netrw_dirhistmax is <= 0, no history or bookmarks
+"                      will be saved.
 fun! s:NetrwBookHistSave()
 "  call Dfunc("s:NetrwBookHistSave() dirhistmax=".g:netrw_dirhistmax)
   if !exists("g:netrw_dirhistmax") || g:netrw_dirhistmax <= 0
@@ -3383,7 +3500,7 @@ fun! s:NetrwBookHistSave()
   setl nocin noai noci magic nospell nohid wig= noaw
   setl ma noro write
   if exists("+acd") | setl noacd | endif
-  sil! keepj keepalt %d
+  sil! NetrwKeepj keepalt %d
 
   " save .netrwhist -- no attempt to merge
   sil! keepalt file .netrwhist
@@ -3397,21 +3514,20 @@ fun! s:NetrwBookHistSave()
   endwhile
   exe "sil! w! ".savefile
 
-  sil keepj %d
+  sil NetrwKeepj %d
   if exists("g:netrw_bookmarklist") && g:netrw_bookmarklist != []
    " merge and write .netrwbook
    let savefile= s:NetrwHome()."/.netrwbook"
 
    if filereadable(savefile)
     let booklist= deepcopy(g:netrw_bookmarklist)
-    exe "sil keepj keepalt so ".savefile
+    exe "sil NetrwKeepj keepalt so ".savefile
     for bdm in booklist
      if index(g:netrw_bookmarklist,bdm) == -1
       call add(g:netrw_bookmarklist,bdm)
      endif
     endfor
     call sort(g:netrw_bookmarklist)
-    exe "sil! w! ".savefile
    endif
 
    " construct and save .netrwbook
@@ -3436,12 +3552,18 @@ fun! s:NetrwBrowse(islocal,dirname)
 "  call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")." modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
 "  call Dredir("ls!")
 
-  " s:NetrwBrowse: initialize history {{{3
+  " save alternate-file's filename if w:netrw_rexlocal doesn't exist
+  " This is useful when one edits a local file, then :e ., then :Rex
+  if a:islocal && !exists("w:netrw_rexfile") && bufname("#") != ""
+   let w:netrw_rexfile= bufname("#")
+  endif
+
+  " s:NetrwBrowse : initialize history {{{3
   if !exists("s:netrw_initbookhist")
-   keepj call s:NetrwBookHistRead()
+   NetrwKeepj call s:NetrwBookHistRead()
   endif
 
-  " s:NetrwBrowse: simplify the dirname (especially for ".."s in dirnames) {{{3
+  " s:NetrwBrowse : simplify the dirname (especially for ".."s in dirnames) {{{3
   if a:dirname !~ '^\a\+://'
    let dirname= simplify(a:dirname)
   else
@@ -3455,77 +3577,83 @@ fun! s:NetrwBrowse(islocal,dirname)
    return
   endif
 
-  " s:NetrwBrowse: sanity checks: {{{3
+  " s:NetrwBrowse : sanity checks: {{{3
   if !exists("*shellescape")
-   keepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69)
 "   call Dret("s:NetrwBrowse : missing shellescape()")
    return
   endif
   if !exists("*fnameescape")
-   keepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70)
 "   call Dret("s:NetrwBrowse : missing fnameescape()")
    return
   endif
 
-  " s:NetrwBrowse: save options: {{{3
+  " s:NetrwBrowse : save options: {{{3
   call s:NetrwOptionSave("w:")                                                                                                            
 
-  " s:NetrwBrowse: re-instate any marked files {{{3
+  " s:NetrwBrowse : re-instate any marked files {{{3
   if exists("s:netrwmarkfilelist_{bufnr('%')}")
 "   call Decho("clearing marked files")
    exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
   endif
 
   if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep
-   " s:NetrwBrowse: set up "safe" options for local directory/file {{{3
+   " s:NetrwBrowse : set up "safe" options for local directory/file {{{3
 "   call Decho("handle w:netrw_acdkeep:")
-"   call Decho("keepjumps lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
+"   call Decho("NetrwKeepj lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
    call s:NetrwLcd(dirname)
    call s:NetrwSafeOptions()
 "   call Decho("getcwd<".getcwd().">")
 
   elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"'
-   " s:NetrwBrowse: looks like a remote regular file, attempt transfer {{{3
-"   call Decho("attempt transfer as regular file<".dirname.">")
-
-   " remove any filetype indicator from end of dirname, except for the
-   " "this is a directory" indicator (/).
-   " There shouldn't be one of those here, anyway.
-   let path= substitute(dirname,'[*=@|]\r\=$','','e')
-"   call Decho("new path<".path.">")
-   call s:RemotePathAnalysis(dirname)
-
-   " s:NetrwBrowse: remote-read the requested file into current buffer {{{3
-   keepj mark '
-   call s:NetrwEnew(dirname)
-   call s:NetrwSafeOptions()
-   setl ma noro
-"   call Decho("setl ma noro")
-   let b:netrw_curdir = dirname
-   let url            = s:method."://".s:user.s:machine.(s:port ? ":".s:port : "")."/".s:path
-"   call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")")
-   exe "sil! keepj keepalt file ".fnameescape(url)
-   exe "sil! keepj keepalt doau BufReadPre ".fnameescape(s:fname)
-   sil call netrw#NetRead(2,url)
-   " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
-"   call Decho("url<".url.">")
-"   call Decho("s:path<".s:path.">")
-"   call Decho("s:fname<".s:fname.">")
-   if s:path =~ '.bz2'
-    exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','',''))
-   elseif s:path =~ '.gz'
-    exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.gz$','',''))
-   elseif s:path =~ '.gz'
-    exe "sil keepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.txz$','',''))
+   " s:NetrwBrowse :  remote regular file handler {{{3
+"   call Decho("handle remote regular file: dirname<".dirname.">")
+   if bufname(dirname) != ""
+"    call Decho("edit buf#".bufname(dirname)." in win#".winnr())
+    exe "NetrwKeepj b ".bufname(dirname)
    else
-    exe "sil keepj keepalt doau BufReadPost ".fnameescape(s:fname)
+    " attempt transfer of remote regular file
+"    call Decho("attempt transfer as regular file<".dirname.">")
+
+    " remove any filetype indicator from end of dirname, except for the
+    " "this is a directory" indicator (/).
+    " There shouldn't be one of those here, anyway.
+    let path= substitute(dirname,'[*=@|]\r\=$','','e')
+"    call Decho("new path<".path.">")
+    call s:RemotePathAnalysis(dirname)
+
+    " s:NetrwBrowse : remote-read the requested file into current buffer {{{3
+    call s:NetrwEnew(dirname)
+    call s:NetrwSafeOptions()
+    setl ma noro
+"    call Decho("setl ma noro")
+    let b:netrw_curdir = dirname
+    let url            = s:method."://".((s:user == "")? "" : s:user."@").s:machine.(s:port ? ":".s:port : "")."/".s:path
+"    call Decho("exe sil! keepalt file ".fnameescape(url)." (bt=".&bt.")")
+    exe "sil! NetrwKeepj keepalt file ".fnameescape(url)
+    exe "sil! NetrwKeepj keepalt doau BufReadPre ".fnameescape(s:fname)
+    sil call netrw#NetRead(2,url)
+    " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
+"    call Decho("url<".url.">")
+"    call Decho("s:path<".s:path.">")
+"    call Decho("s:fname<".s:fname.">")
+    if s:path =~ '.bz2'
+     exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','',''))
+    elseif s:path =~ '.gz'
+     exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.gz$','',''))
+    elseif s:path =~ '.gz'
+     exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.txz$','',''))
+    else
+     exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(s:fname)
+    endif
    endif
 
-   " s:NetrwBrowse: save certain window-oriented variables into buffer-oriented variables {{{3
+   " s:NetrwBrowse : save certain window-oriented variables into buffer-oriented variables {{{3
    call s:SetBufWinVars()
    call s:NetrwOptionRestore("w:")
 "   call Decho("setl ma nomod")
-   setl ma nomod
+   setl ma nomod noro
 "   call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
 
 "   call Dret("s:NetrwBrowse : file<".s:fname.">")
@@ -3541,9 +3669,11 @@ fun! s:NetrwBrowse(islocal,dirname)
   let s:last_sort_by         = g:netrw_sort_by
 
   " set up menu {{{3
-  keepj call s:NetrwMenu(1)
+  NetrwKeepj call s:NetrwMenu(1)
 
   " get/set-up buffer {{{3
+"  call Decho("saving position across a buffer refresh")
+  let svpos  = netrw#SavePosn()
   let reusing= s:NetrwGetBuffer(a:islocal,dirname)
   " maintain markfile highlighting
   if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
@@ -3559,7 +3689,7 @@ fun! s:NetrwBrowse(islocal,dirname)
 "   call Decho("setl noma nomod nowrap")
    setl noma nomod nowrap
 "   call Decho("(set noma nomod nowrap)  ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-"   call Dret("s:NetrwBrowse : re-using buffer")
+"   call Dret("s:NetrwBrowse : re-using not-cleared buffer")
    return
   endif
 
@@ -3631,9 +3761,9 @@ fun! s:NetrwBrowse(islocal,dirname)
    let dirpat  = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
    if dirname !~ dirpat
     if !exists("g:netrw_quiet")
-     keepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
+     NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
     endif
-    keepj call s:NetrwOptionRestore("w:")
+    NetrwKeepj call s:NetrwOptionRestore("w:")
 "    call Decho("setl noma nomod nowrap")
     setl noma nomod nowrap
 "    call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -3647,9 +3777,9 @@ fun! s:NetrwBrowse(islocal,dirname)
   " -----------------------
   " Directory Listing: {{{3
   " -----------------------
-  keepj call s:NetrwMaps(a:islocal)
-  keepj call s:NetrwCommands(a:islocal)
-  keepj call s:PerformListing(a:islocal)
+  NetrwKeepj call s:NetrwMaps(a:islocal)
+  NetrwKeepj call s:NetrwCommands(a:islocal)
+  NetrwKeepj call s:PerformListing(a:islocal)
   if v:version >= 700 && has("balloon_eval") && &beval == 0 && &l:bexpr == "" && !exists("g:netrw_nobeval")
    let &l:bexpr= "netrw#BalloonHelp()"
 "   call Decho("set up balloon help: l:bexpr=".&l:bexpr)
@@ -3657,6 +3787,12 @@ fun! s:NetrwBrowse(islocal,dirname)
   endif
   call s:NetrwOptionRestore("w:")
 
+  " restore position and jumplist entry
+  if !reusing
+"   call Decho("restoring position across buffer refresh")
+   call netrw#RestorePosn(svpos)
+  endif
+
   " The s:LocalBrowseRefresh() function is called by an autocmd
   " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow, medium speed).
   " However, s:NetrwBrowse() causes the FocusGained event to fire the firstt time.
@@ -3738,7 +3874,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
     exe "sil! noswapfile keepalt b ".w:netrw_treebufnr
     let &ei= eikeep
     setl ma
-    sil! keepj %d
+    sil! NetrwKeepj %d
 "    call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "    call Dret("s:NetrwGetBuffer 0<buffer cleared> : bufnum#".w:netrw_treebufnr."<NetrwTreeListing>")
     return 0
@@ -3819,7 +3955,7 @@ fun! s:NetrwGetBuffer(islocal,dirname)
 
   " get enew buffer and name it -or- re-use buffer {{{3
 "  call Decho("  get enew buffer and name it OR re-use buffer")
-  sil! keepj keepalt mark '
+  sil! NetrwKeepj keepalt mark '
   if bufnum < 0 || !bufexists(bufnum)
 "   call Decho("--get enew buffer and name it  (bufnum#".bufnum."<0 OR bufexists(".bufnum.")=".bufexists(bufnum)."==0)")
    call s:NetrwEnew(dirname)
@@ -3843,8 +3979,8 @@ fun! s:NetrwGetBuffer(islocal,dirname)
     nnoremap <silent> <buffer> ]]       :sil call <SID>TreeListMove(']')<cr>
 "    call Decho("  tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr)
    else
-"    let v:errmsg= "" " Decho
-    let escdirname= fnameescape(dirname)
+"    let v:errmsg   = "" " Decho
+    let escdirname = fnameescape(dirname)
 "    call Decho("  errmsg<".v:errmsg."> bufnr(escdirname<".escdirname.">)=".bufnr(escdirname)." bufname()<".bufname(bufnr(escdirname)).">")
 "    call Decho('  exe sil! keepalt file '.escdirname)
 "    let v:errmsg= "" " Decho
@@ -3869,25 +4005,30 @@ fun! s:NetrwGetBuffer(islocal,dirname)
     exe "sil! keepalt file ".fnameescape(getcwd())
    endif
    let &ei= eikeep
+
    if line("$") <= 1
-    keepj call s:NetrwListSettings(a:islocal)
+    NetrwKeepj call s:NetrwListSettings(a:islocal)
 "    call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "    call Dret("s:NetrwGetBuffer 0<buffer empty> : re-using buffer#".bufnr("%").", but its empty, so refresh it")
     return 0
+
    elseif g:netrw_fastbrowse == 0 || (a:islocal && g:netrw_fastbrowse == 1)
-    keepj call s:NetrwListSettings(a:islocal)
-    sil keepj %d
+"    call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse." a:islocal=".a:islocal.": clear buffer")
+    NetrwKeepj call s:NetrwListSettings(a:islocal)
+    sil NetrwKeepj %d
 "    call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "    call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but refreshing due to g:netrw_fastbrowse=".g:netrw_fastbrowse)
     return 0
+
    elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
 "    call Decho("--re-use tree listing--")
 "    call Decho("  clear buffer<".expand("%")."> with :%d")
-    sil keepj %d
-    keepj call s:NetrwListSettings(a:islocal)
+    sil NetrwKeepj %d
+    NetrwKeepj call s:NetrwListSettings(a:islocal)
 "    call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "    call Dret("s:NetrwGetBuffer 0<cleared buffer> : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh")
     return 0
+
    else
 "    call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "    call Dret("s:NetrwGetBuffer 1<buffer not cleared> : buf#".bufnr("%"))
@@ -3902,14 +4043,14 @@ fun! s:NetrwGetBuffer(islocal,dirname)
   "  fast   2         H      H
 "  call Decho("--do netrw settings: make this buffer#".bufnr("%")." not-a-file, modifiable, not line-numbered, etc--")
   let fname= expand("%")
-  keepj call s:NetrwListSettings(a:islocal)
+  NetrwKeepj call s:NetrwListSettings(a:islocal)
 "  call Decho("exe sil! keepalt file ".fnameescape(fname))
-  exe "sil! keepj keepalt file ".fnameescape(fname)
+  exe "sil! NetrwKeepj keepalt file ".fnameescape(fname)
 
   " delete all lines from buffer {{{3
 "  call Decho("--delete all lines from buffer--")
 "  call Decho("  clear buffer<".expand("%")."> with :%d")
-  sil! keepalt keepj %d
+  sil! keepalt NetrwKeepj %d
 
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "  call Dret("s:NetrwGetBuffer 0<cleared buffer> : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%"))
@@ -3936,7 +4077,7 @@ endfun
 " ---------------------------------------------------------------------
 "  s:NetrwGetWord: it gets the directory/file named under the cursor {{{2
 fun! s:NetrwGetWord()
-"  call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".g:netrw_liststyle." virtcol=".virtcol("."))
+"  call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".s:ShowStyle()." virtcol=".virtcol("."))
   call s:UseBufWinVars()
 
   " insure that w:netrw_liststyle is set up
@@ -3946,18 +4087,18 @@ fun! s:NetrwGetWord()
    else
     let w:netrw_liststyle= s:THINLIST
    endif
-"   call Decho("w:netrw_liststyle=".w:netrw_liststyle)
+"   "call Decho("w:netrw_liststyle=".w:netrw_liststyle)
   endif
 
   if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
    " Active Banner support
-"   call Decho("active banner handling")
-   keepj norm! 0
+"   "call Decho("active banner handling")
+   NetrwKeepj norm! 0
    let dirname= "./"
    let curline= getline('.')
 
    if curline =~ '"\s*Sorted by\s'
-    keepj norm s
+    NetrwKeepj norm s
     let s:netrw_skipbrowse= 1
     echo 'Pressing "s" also works'
 
@@ -3966,67 +4107,67 @@ fun! s:NetrwGetWord()
     echo 'Press "S" to edit sorting sequence'
 
    elseif curline =~ '"\s*Quick Help:'
-    keepj norm ?
+    NetrwKeepj norm ?
     let s:netrw_skipbrowse= 1
-    echo 'Pressing "?" also works'
 
    elseif curline =~ '"\s*\%(Hiding\|Showing\):'
-    keepj norm a
+    NetrwKeepj norm a
     let s:netrw_skipbrowse= 1
     echo 'Pressing "a" also works'
 
    elseif line("$") > w:netrw_bannercnt
-    exe 'sil keepj '.w:netrw_bannercnt
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt
    endif
 
   elseif w:netrw_liststyle == s:THINLIST
-"   call Decho("thin column handling")
-   keepj norm! 0
-   let dirname= getline('.')
+"   "call Decho("thin column handling")
+   NetrwKeepj norm! 0
+   let dirname= substitute(getline('.'),'\t -->.*$','','')
 
   elseif w:netrw_liststyle == s:LONGLIST
-"   call Decho("long column handling")
-   keepj norm! 0
+"   "call Decho("long column handling")
+   NetrwKeepj norm! 0
    let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
 
   elseif w:netrw_liststyle == s:TREELIST
-"   call Decho("treelist handling")
+"   "call Decho("treelist handling")
    let dirname= substitute(getline('.'),'^\('.s:treedepthstring.'\)*','','e')
+   let dirname= substitute(dirname,'\t -->.*$','','')
 
   else
-"   call Decho("obtain word from wide listing")
+"   "call Decho("obtain word from wide listing")
    let dirname= getline('.')
 
    if !exists("b:netrw_cpf")
     let b:netrw_cpf= 0
-    exe 'sil keepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
     call histdel("/",-1)
-"   call Decho("computed cpf=".b:netrw_cpf)
+"    "call Decho("computed cpf=".b:netrw_cpf)
    endif
 
-"   call Decho("buf#".bufnr("%")."<".bufname("%").">")
+"   "call Decho("buf#".bufnr("%")."<".bufname("%").">")
    let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
-"   call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart."  bannercnt=".w:netrw_bannercnt)
-"   call Decho("1: dirname<".dirname.">")
+"   "call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart."  bannercnt=".w:netrw_bannercnt)
+"   "call Decho("1: dirname<".dirname.">")
    if filestart == 0
-    keepj norm! 0ma
+    NetrwKeepj norm! 0ma
    else
     call cursor(line("."),filestart+1)
-    keepj norm! ma
+    NetrwKeepj norm! ma
    endif
    let rega= @a
    let eofname= filestart + b:netrw_cpf + 1
    if eofname <= col("$")
     call cursor(line("."),filestart+b:netrw_cpf+1)
-    keepj norm! "ay`a
+    NetrwKeepj norm! "ay`a
    else
-    keepj norm! "ay$
+    NetrwKeepj norm! "ay$
    endif
    let dirname = @a
    let @a      = rega
-"   call Decho("2: dirname<".dirname.">")
+"   "call Decho("2: dirname<".dirname.">")
    let dirname= substitute(dirname,'\s\+$','','e')
-"   call Decho("3: dirname<".dirname.">")
+"   "call Decho("3: dirname<".dirname.">")
   endif
 
   " symlinks are indicated by a trailing "@".  Remove it before further processing.
@@ -4101,7 +4242,7 @@ fun! s:NetrwListStyle(islocal)
    let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
 
   else
-   keepj call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
    let g:netrw_liststyle = s:THINLIST
    let w:netrw_liststyle = g:netrw_liststyle
    let g:netrw_list_cmd  = substitute(g:netrw_list_cmd,' -l','','ge')
@@ -4111,7 +4252,7 @@ fun! s:NetrwListStyle(islocal)
 
   " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh
 "  call Decho("clear buffer<".expand("%")."> with :%d")
-  sil! keepj %d
+  sil! NetrwKeepj %d
   " following prevents tree listing buffer from being marked "modified"
 "  call Decho("setl nomod")
   setl nomod
@@ -4119,11 +4260,11 @@ fun! s:NetrwListStyle(islocal)
 
   " refresh the listing
 "  call Decho("refresh the listing")
-  keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  keepj call s:NetrwCursor()
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call s:NetrwCursor()
 
   " restore position; keep cursor on the filename
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call netrw#RestorePosn(svpos)
   let @@= ykeep
 
 "  call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
@@ -4144,16 +4285,86 @@ fun! s:NetrwBannerCtrl(islocal)
 
   " keep cursor on the filename
   let fname= s:NetrwGetWord()
-  sil keepj $
+  sil NetrwKeepj $
   let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
 "  call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
   if result <= 0 && exists("w:netrw_bannercnt")
-   exe "keepj ".w:netrw_bannercnt
+   exe "NetrwKeepj ".w:netrw_bannercnt
   endif
   let @@= ykeep
 "  call Dret("s:NetrwBannerCtrl : g:netrw_banner=".g:netrw_banner)
 endfun
 
+" ---------------------------------------------------------------------
+" s:NetrwBookmark: supports :NetrwMB[!] [file]s                 {{{2
+"
+"  No bang: enters files/directories into Netrw's bookmark system
+"   No argument and in netrw buffer:
+"     if there are marked files: bookmark marked files
+"     otherwise                : bookmark file/directory under cursor
+"   No argument and not in netrw buffer: bookmarks current open file
+"   Has arguments: globs them individually and bookmarks them
+"
+"  With bang: deletes files/directories from Netrw's bookmark system
+fun! s:NetrwBookmark(del,...)
+"  call Dfunc("s:NetrwBookmark(del=".a:del.",...) a:0=".a:0)
+  if a:0 == 0
+   if &ft == "netrw"
+    let curbufnr = bufnr("%")
+
+    if exists("s:netrwmarkfilelist_{curbufnr}")
+     " for every filename in the marked list
+"     call Decho("bookmark every filename in marked list")
+     let svpos  = netrw#SavePosn()
+     let islocal= expand("%") !~ '^\a\+://'
+     for fname in s:netrwmarkfilelist_{curbufnr}
+      if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+     endfor
+     let curdir  = exists("b:netrw_curdir")? b:netrw_curdir : getcwd()
+     call s:NetrwUnmarkList(curbufnr,curdir)
+     NetrwKeepj call s:NetrwRefresh(islocal,s:NetrwBrowseChgDir(islocal,'./'))
+     NetrwKeepj call netrw#RestorePosn(svpos)
+    else
+     let fname= s:NetrwGetWord()
+     if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+    endif
+
+   else
+    " bookmark currently open file
+"    call Decho("bookmark currently open file")
+    let fname= expand("%")
+    if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif
+   endif
+
+  else
+   " bookmark specified files
+   "  attempts to infer if working remote or local
+   "  by deciding if the current file begins with an url
+   "  Globbing cannot be done remotely.
+   let islocal= expand("%") !~ '^\a\+://'
+"   call Decho("bookmark specified file".((a:0>1)? "s" : ""))
+   let i = 1
+   while i <= a:0
+    if islocal
+     let mbfiles= glob(a:{i},0,1)
+    else
+     let mbfiles= [a:{i}]
+    endif
+"    call Decho("mbfiles".string(mbfiles))
+    for mbfile in mbfiles
+"     call Decho("mbfile<".mbfile.">")
+     if a:del|call s:DeleteBookmark(mbfile)|else|call s:MakeBookmark(mbfile)|endif
+    endfor
+    let i= i + 1
+   endwhile
+  endif
+
+  " update the menu
+  call s:NetrwBookmarkMenu()
+
+"  call Dret("s:NetrwBookmark")
+endfun
+
 " ---------------------------------------------------------------------
 " s:NetrwBookmarkMenu: Uses menu priorities {{{2
 "                      .2.[cnt] for bookmarks, and
@@ -4241,8 +4452,8 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 
   " NetrwBrowseChgDir: save options and initialize {{{3
 "  call Decho("saving options")
-  keepj call s:NetrwOptionSave("s:")
-  keepj call s:NetrwSafeOptions()
+  NetrwKeepj call s:NetrwOptionSave("s:")
+  NetrwKeepj call s:NetrwSafeOptions()
   let nbcd_curpos                = netrw#SavePosn()
   let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos
 "  call Decho("setting s:nbcd_curpos_".bufnr('%')." to SavePosn")
@@ -4257,6 +4468,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 "  call Decho("dirname<".dirname.">")
 
   " ignore <cr>s when done in the banner
+"  call Decho('ignore <cr>s when done in banner (g:netrw_banner='.g:netrw_banner.")")
   if g:netrw_banner
 "   call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"))
    if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt
@@ -4265,10 +4477,10 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
      let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp)
 "     call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
      setl ma noro nowrap
-     keepj call setline(line('.'),'"   Quick Help: <F1>:help  '.s:QuickHelp[g:netrw_quickhelp])
+     NetrwKeepj call setline(line('.'),'"   Quick Help: <F1>:help  '.s:QuickHelp[g:netrw_quickhelp])
      setl noma nomod nowrap
-     keepj call netrw#RestorePosn(nbcd_curpos)
-     keepj call s:NetrwOptionRestore("s:")
+     NetrwKeepj call netrw#RestorePosn(nbcd_curpos)
+     NetrwKeepj call s:NetrwOptionRestore("s:")
 "     call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
     endif
    endif
@@ -4291,8 +4503,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    let dirname= dirname.'/'
 "   call Decho("adjusting dirname<".dirname.">")
   endif
+"  call Decho("newdir<".newdir."> !~ dirpat<".dirpat.">? ".((newdir !~ dirpat)? "yes" : "no"))
 
-  if newdir !~ dirpat
+  if newdir !~ dirpat && !(a:islocal && isdirectory(newdir))
    " ------------------------------
    " NetrwBrowseChgDir: edit a file {{{3
    " ------------------------------
@@ -4308,7 +4521,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
 "    call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">")
 "    call Decho("edit-a-file: newdir<".newdir.">")
-    let dirname= s:NetrwTreeDir()
+    let dirname= s:NetrwTreeDir(a:islocal)
     if dirname =~ '/$'
      let dirname= dirname.newdir
     else
@@ -4322,29 +4535,40 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
     let dirname= s:ComposePath(dirname,newdir)
    endif
 "   call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")")
-   " this lets NetrwBrowseX avoid the edit
+   " this lets netrw#BrowseX avoid the edit
    if a:0 < 1
 "    call Decho("edit-a-file: set up windows for editing<".fnameescape(dirname).">  didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"))
-    keepj call s:NetrwOptionRestore("s:")
+    NetrwKeepj call s:NetrwOptionRestore("s:")
     if !exists("s:didsplit")
-"     call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".g:netrw_browse_split." win#".winnr())
-     if     g:netrw_browse_split == 1
+"     call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr())
+     if type(g:netrw_browse_split) == 3
+      " open file in server
+      " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr]
+"      call Decho("edit-a-file: open file in server")
+      call s:NetrwServerEdit(a:islocal,dirname)
+"      call Dret("s:NetrwBrowseChgDir")
+      return
+     elseif g:netrw_browse_split == 1
       " horizontally splitting the window first
+"      call Decho("edit-a-file: horizontally splitting window prior to edit")
       keepalt new
       if !&ea
        keepalt wincmd _
       endif
      elseif g:netrw_browse_split == 2
       " vertically splitting the window first
+"      call Decho("edit-a-file: vertically splitting window prior to edit")
       keepalt rightb vert new
       if !&ea
        keepalt wincmd |
       endif
      elseif g:netrw_browse_split == 3
       " open file in new tab
+"      call Decho("edit-a-file: opening new tab prior to edit")
       keepalt tabnew
      elseif g:netrw_browse_split == 4
       " act like "P" (ie. open previous window)
+"      call Decho("edit-a-file: use previous window for edit")
       if s:NetrwPrevWinOpen(2) == 3
        let @@= ykeep
 "       call Dret("s:NetrwBrowseChgDir")
@@ -4356,15 +4580,16 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
       call s:NetrwMenu(0)
       " optional change to window
       if g:netrw_chgwin >= 1
+"       call Decho("edit-a-file: changing window to #".g:netrw_chgwin)
        if winnr("$")+1 == g:netrw_chgwin
 	" if g:netrw_chgwin is set to one more than the last window, then
 	" vertically split the last window to make that window available.
 	let curwin= winnr()
-	exe "keepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
+	exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".winnr("$")
 	vs
-	exe "keepj keepalt ".g:netrw_chgwin."wincmd ".curwin
+	exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd ".curwin
        endif
-       exe "keepj keepalt ".g:netrw_chgwin."wincmd w"
+       exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w"
       endif
      endif
     endif
@@ -4377,13 +4602,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
      " some like c-^ to return to the last edited file
      " others like c-^ to return to the netrw buffer
      if exists("g:netrw_altfile") && g:netrw_altfile
-      exe "keepj keepalt e! ".fnameescape(dirname)
+      exe "NetrwKeepj keepalt e! ".fnameescape(dirname)
      else
-      exe "keepj e! ".fnameescape(dirname)
+      exe "NetrwKeepj e! ".fnameescape(dirname)
      endif
-"     call Decho("after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
+"     call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
      call s:NetrwCursor()
-"     call Decho("COMBAK#1: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
      if &hidden || &bufhidden == "hide"
       " file came from vim's hidden storage.  Don't "restore" options with it.
       let dorestore= 0
@@ -4392,7 +4616,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 "     call Decho("edit-a-file: remote file: NetrwBrowse will edit it")
     endif
     let dolockout= 1
-"     call Decho("COMBAK#2: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
 
     " handle g:Netrw_funcref -- call external-to-netrw functions
     "   This code will handle g:Netrw_funcref as an individual function reference
@@ -4402,12 +4625,12 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 "     call Decho("edit-a-file: handle optional Funcrefs")
      if type(g:Netrw_funcref) == 2
 "      call Decho("edit-a-file: handling a g:Netrw_funcref")
-      keepj call g:Netrw_funcref()
+      NetrwKeepj call g:Netrw_funcref()
      elseif type(g:Netrw_funcref) == 3
 "      call Decho("edit-a-file: handling a list of g:Netrw_funcrefs")
       for Fncref in g:Netrw_funcref
        if type(FncRef) == 2
-        keepj call FncRef()
+        NetrwKeepj call FncRef()
        endif
       endfor
      endif
@@ -4419,16 +4642,16 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    " NetrwBrowseChgDir: just go to the new directory spec {{{3
    " ----------------------------------------------------
 "   call Decho('goto-newdir: case "just go to new directory spec": newdir<'.newdir.'>')
-   let dirname    = newdir
-   keepj call s:SetRexDir(a:islocal,dirname)
-   keepj call s:NetrwOptionRestore("s:")
+   let dirname = newdir
+   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+   NetrwKeepj call s:NetrwOptionRestore("s:")
 
   elseif newdir == './'
    " ---------------------------------------------
    " NetrwBrowseChgDir: refresh the directory list {{{3
    " ---------------------------------------------
 "   call Decho('refresh-dirlist: case "refresh directory listing": newdir == "./"')
-   keepj call s:SetRexDir(a:islocal,dirname)
+   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
 
   elseif newdir == '../'
    " --------------------------------------
@@ -4441,7 +4664,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 "    call Decho("go-up: clear buffer<".expand("%")."> with :%d")
 "    call Decho("go-up: setl noro ma")
     setl noro ma
-    keepj %d
+    NetrwKeepj %d
    endif
 
    if has("amiga")
@@ -4483,7 +4706,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
     endif
 "    call Decho("go-up: unix: dirname<".dirname."> (go up one dir)")
    endif
-   keepj call s:SetRexDir(a:islocal,dirname)
+   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
 
   elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
    " --------------------------------------
@@ -4495,14 +4718,15 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    setl noro ma
    if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir"))
 "    call Decho("tree-list: clear buffer<".expand("%")."> with :%d")
-    keepj %d
+    NetrwKeepj %d
    endif
-   let treedir      = s:NetrwTreeDir()
+   let treedir      = s:NetrwTreeDir(a:islocal)
    let s:treecurpos = nbcd_curpos
-   let haskey= 0
+   let haskey       = 0
 "   call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">")
 
    " search treedict for tree dir as-is
+"   call Decho("search treedict for tree dir as-is")
    if has_key(w:netrw_treedict,treedir)
 "    call Decho('tree-list: ....searched for treedir<'.treedir.'> : found it!')
     let haskey= 1
@@ -4511,6 +4735,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    endif
 
    " search treedict for treedir with a / appended
+"   call Decho("search treedict for treedir with a / appended")
    if !haskey && treedir !~ '/$'
     if has_key(w:netrw_treedict,treedir."/")
      let treedir= treedir."/"
@@ -4522,6 +4747,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    endif
 
    " search treedict for treedir with any trailing / elided
+"   call Decho("search treedict for treedir with any trailing / elided")
    if !haskey && treedir =~ '/$'
     let treedir= substitute(treedir,'/$','','')
     if has_key(w:netrw_treedict,treedir)
@@ -4532,6 +4758,7 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
     endif
    endif
 
+"   call Decho("haskey=".haskey)
    if haskey
     " close tree listing for selected subdirectory
 "    call Decho("tree-list: closing selected subdirectory<".dirname.">")
@@ -4543,8 +4770,10 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
     " go down one directory
     let dirname= substitute(treedir,'/*$','/','')
 "    call Decho("tree-list: go down one dir: treedir<".treedir.">")
+"    call Decho("tree-list: ...            : dirname<".dirname.">")
    endif
-   keepj call s:SetRexDir(a:islocal,dirname)
+   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
+"   call Decho("setting s:treeforceredraw to true")
    let s:treeforceredraw = 1
 
   else
@@ -4553,22 +4782,20 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
    " ----------------------------------------
    let dirname    = s:ComposePath(dirname,newdir)
 "   call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
-   keepj call s:SetRexDir(a:islocal,dirname)
+   NetrwKeepj call s:SetRexDir(a:islocal,dirname)
   endif
 
  " --------------------------------------
  " NetrwBrowseChgDir: Restore and Cleanup {{{3
  " --------------------------------------
-"  call Decho("COMBAK#3: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
   if dorestore
    " dorestore is zero'd when a local file was hidden or bufhidden;
    " in such a case, we want to keep whatever settings it may have.
 "   call Decho("doing option restore (dorestore=".dorestore.")")
-   keepj call s:NetrwOptionRestore("s:")
+   NetrwKeepj call s:NetrwOptionRestore("s:")
 "  else " Decho
 "   call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod)
   endif
-"  call Decho("COMBAK#4: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
   if dolockout && dorestore
 "   call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname))
    if filewritable(dirname)
@@ -4583,7 +4810,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...)
 "    call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
    endif
   endif
-"  call Decho("COMBAK#5: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod)
   let @@= ykeep
 
 "  call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">")
@@ -4596,9 +4822,18 @@ endfun
 "    for tree, keeps cursor on current filename
 fun! s:NetrwBrowseUpDir(islocal)
 "  call Dfunc("s:NetrwBrowseUpDir(islocal=".a:islocal.")")
+  if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt-1
+   " this test needed because occasionally this function seems to be incorrectly called
+   " when multiple leftmouse clicks are taken when atop the one line help in the banner.
+   " I'm allowing the very bottom line to permit a "-" exit so that one may escape empty 
+   " directories.
+"   call Dret("s:NetrwBrowseUpDir : cursor not in file area")
+   return
+  endif
+
   norm! 0
   if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
-"   call Decho("ftp + treestyle")
+"   call Decho("case: treestyle")
    let curline= getline(".")
    let swwline= winline() - 1
    if exists("w:netrw_treetop")
@@ -4611,19 +4846,19 @@ fun! s:NetrwBrowseUpDir(islocal)
    endif
    if !search('\c^'.s:treedepthstring.curline,'cw')
     if !search('\c^'.curline,'cw')
-     sil! keepj 1
+     sil! NetrwKeepj 1
     endif
    endif
-   exe "sil! keepj norm! z\<cr>"
+   exe "sil! NetrwKeepj norm! z\<cr>"
    while winline() < swwline
     let curwinline= winline()
-    exe "sil! keepj norm! \<c-y>"
+    exe "sil! NetrwKeepj norm! \<c-y>"
     if curwinline == winline()
      break
     endif
    endwhile
   else
-"   call Decho("ftp + not treestyle")
+"   call Decho("case: not treestyle")
    if a:islocal
     call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../'))
    else
@@ -4640,15 +4875,26 @@ fun! s:NetrwBrowseUpDir(islocal)
 endfun
 
 " ---------------------------------------------------------------------
-" s:NetrwBrowseX:  (implements "x") executes a special "viewer" script or program for the {{{2
+" netrw#BrowseX:  (implements "x") executes a special "viewer" script or program for the {{{2
 "              given filename; typically this means given their extension.
 "              0=local, 1=remote
-fun! netrw#NetrwBrowseX(fname,remote)
-"  call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")")
+fun! netrw#BrowseX(fname,remote)
+"  call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.")")
+
+  " if its really just a directory, then do a "gf" instead
+  if a:fname =~ '/$'
+   norm! gf
+"   call Dret("netrw#BrowseX : did gf instead")
+  endif
+
 
   let ykeep      = @@
   let screenposn = netrw#SavePosn()
 
+  " need to save and restore aw setting as gx can invoke this function from non-netrw buffers
+  let awkeep     = &aw
+  set noaw
+
   " special core dump handler
   if a:fname =~ '/core\(\.\d\+\)\=$'
    if exists("g:Netrw_corehandler")
@@ -4667,7 +4913,8 @@ fun! netrw#NetrwBrowseX(fname,remote)
     endif
     call netrw#RestorePosn(screenposn)
     let @@= ykeep
-"    call Dret("NetrwBrowseX : coredump handler invoked")
+    let &aw= awkeep
+"    call Dret("netrw#BrowseX : coredump handler invoked")
     return
    endif
   endif
@@ -4680,21 +4927,6 @@ fun! netrw#NetrwBrowseX(fname,remote)
   endif
 "  call Decho("exten<".exten.">")
 
-  " seems kde systems often have gnome-open due to dependencies, even though
-  " gnome-open's subsidiary display tools are largely absent.  Kde systems
-  " usually have "kdeinit" running, though...  (tnx Mikolaj Machowski)
-  if !exists("s:haskdeinit")
-   if has("unix") && executable("ps") && !has("win32unix")
-    let s:haskdeinit= system("ps -e") =~ 'kdeinit' 
-    if v:shell_error
-     let s:haskdeinit = 0
-    endif
-   else
-    let s:haskdeinit= 0
-   endif
-"   call Decho("setting s:haskdeinit=".s:haskdeinit)
-  endif
-
   if a:remote == 1
    " create a local copy
 "   call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">")
@@ -4769,18 +5001,15 @@ fun! netrw#NetrwBrowseX(fname,remote)
 
   elseif exists("g:netrw_browsex_viewer") && executable(viewer)
 "   call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
-"   call Decho("exe sil !".viewer." ".viewopt.shellescape(fname,1).redir)
-   exe "sil !".viewer." ".viewopt.shellescape(fname,1).redir
+   call s:NetrwExe("sil !".viewer." ".viewopt.shellescape(fname,1).redir)
    let ret= v:shell_error
 
   elseif has("win32") || has("win64")
 "   call Decho("windows")
    if executable("start")
-"    call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
-    exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)
+    call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
    elseif executable("rundll32")
-"    call Decho('exe sil !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
-    exe 'sil !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1)
+    call s:NetrwExe('sil! !rundll32 url.dll,FileProtocolHandler '.shellescape(fname,1))
    else
     call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
    endif
@@ -4791,33 +5020,30 @@ fun! netrw#NetrwBrowseX(fname,remote)
    let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g')
 "   call Decho("cygwin: winfname<".shellescape(winfname,1).">")
    if executable("start")
-"    call Decho('exe sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
-    exe 'sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)
+    call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
    elseif executable("rundll32")
-"    call Decho('exe sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
-    exe 'sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1)
+    call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.shellescape(winfname,1))
+   elseif executable("cygstart")
+    call s:NetrwExe('sil !cygstart '.shellescape(fname,1))
    else
     call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74)
    endif
    call inputsave()|call input("Press <cr> to continue")|call inputrestore()
    let ret= v:shell_error
 
-  elseif has("unix") && executable("xdg-open") && !s:haskdeinit
+  elseif has("unix") && executable("xdg-open") && !s:CheckIfKde()
 "   call Decho("unix and xdg-open")
-"   call Decho("exe sil !xdg-open ".shellescape(fname,1)." ".redir)
-   exe "sil !xdg-open ".shellescape(fname,1).redir
+   call s:NetrwExe("sil !xdg-open ".shellescape(fname,1).redir)
    let ret= v:shell_error
 
-  elseif has("unix") && executable("kfmclient") && s:haskdeinit
+  elseif has("unix") && executable("kfmclient") && s:CheckIfKde()
 "   call Decho("unix and kfmclient")
-"   call Decho("exe sil !kfmclient exec ".shellescape(fname,1)." ".redir)
-   exe "sil !kfmclient exec ".shellescape(fname,1)." ".redir
+   call s:NetrwExe("sil !kfmclient exec ".shellescape(fname,1)." ".redir)
    let ret= v:shell_error
 
   elseif has("macunix") && executable("open")
 "   call Decho("macunix and open")
-"   call Decho("exe sil !open ".shellescape(fname,1)." ".redir)
-   exe "sil !open ".shellescape(fname,1)." ".redir
+   call s:NetrwExe("sil !open ".shellescape(fname,1)." ".redir)
    let ret= v:shell_error
 
   else
@@ -4848,13 +5074,39 @@ fun! netrw#NetrwBrowseX(fname,remote)
    if g:netrw_use_noswf
     setl noswf
    endif
-   exe "sil! keepj norm! \<c-o>"
+   exe "sil! NetrwKeepj norm! \<c-o>"
 "   redraw!
   endif
   call netrw#RestorePosn(screenposn)
-  let @@= ykeep
+  let @@ = ykeep
+  let &aw= awkeep
 
-"  call Dret("NetrwBrowseX")
+"  call Dret("netrw#BrowseX")
+endfun
+
+" ---------------------------------------------------------------------
+" netrw#BrowseXVis: used by gx in visual mode to select a file for browsing {{{2
+fun! netrw#BrowseXVis()
+"  call Dfunc("netrw#BrowseXVis()")
+  let atkeep = @@
+  norm! gvy
+"  call Decho("@@<".@@.">")
+  call netrw#BrowseX(@@,netrw#CheckIfRemote())
+  let @@     = atkeep
+"  call Dret("netrw#BrowseXVis")
+endfun
+
+" ---------------------------------------------------------------------
+" netrw#CheckIfRemote: returns 1 if current file looks like an url, 0 else {{{2
+fun! netrw#CheckIfRemote()
+"  call Dfunc("netrw#CheckIfRemote()")
+  if expand("%") =~ '^\a\+://'
+"   call Dret("netrw#CheckIfRemote 1")
+   return 1
+  else
+"   call Dret("netrw#CheckIfRemote 0")
+   return 0
+  endif
 endfun
 
 " ---------------------------------------------------------------------
@@ -4870,15 +5122,40 @@ fun! s:NetrwChgPerm(islocal,curdir)
 "  call Decho("chgperm<".chgperm.">")
   call system(chgperm)
   if v:shell_error != 0
-   keepj call netrw#ErrorMsg(1,"changing permission on file<".expand("<cfile>")."> seems to have failed",75)
+   NetrwKeepj call netrw#ErrorMsg(1,"changing permission on file<".expand("<cfile>")."> seems to have failed",75)
   endif
   if a:islocal
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
   endif
   let @@= ykeep
 "  call Dret("s:NetrwChgPerm")
 endfun
 
+" ---------------------------------------------------------------------
+" s:CheckIfKde: checks if kdeinit is running {{{2
+"    Returns 0: kdeinit not running
+"            1: kdeinit is  running
+fun! s:CheckIfKde()
+"  call Dfunc("s:CheckIfKde()")
+  " seems kde systems often have gnome-open due to dependencies, even though
+  " gnome-open's subsidiary display tools are largely absent.  Kde systems
+  " usually have "kdeinit" running, though...  (tnx Mikolaj Machowski)
+  if !exists("s:haskdeinit")
+   if has("unix") && executable("ps") && !has("win32unix")
+    let s:haskdeinit= system("ps -e") =~ '\<kdeinit' 
+    if v:shell_error
+     let s:haskdeinit = 0
+    endif
+   else
+    let s:haskdeinit= 0
+   endif
+"   call Decho("setting s:haskdeinit=".s:haskdeinit)
+  endif
+
+"  call Dret("s:CheckIfKde ".s:haskdeinit)
+  return s:haskdeinit
+endfun
+
 " ---------------------------------------------------------------------
 " s:NetrwClearExplore: clear explore variables (if any) {{{2
 fun! s:NetrwClearExplore()
@@ -4994,24 +5271,24 @@ fun! s:NetrwHide(islocal)
 "     call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">")
     endif
    endfor
-   keepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
+   NetrwKeepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir)
    let g:netrw_hide= 1
 
   else
 
    " switch between show-all/show-not-hidden/show-hidden
    let g:netrw_hide=(g:netrw_hide+1)%3
-   exe "keepj norm! 0"
+   exe "NetrwKeepj norm! 0"
    if g:netrw_hide && g:netrw_list_hide == ""
-    keepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
+    NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
     let @@= ykeep
 "    call Dret("NetrwHide")
     return
    endif
   endif
 
-  keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
   let @@= ykeep
 "  call Dret("NetrwHide")
 endfun
@@ -5034,8 +5311,8 @@ fun! s:NetrwHidden(islocal)
   endif
 
   " refresh screen and return to saved position
-  keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
   let @@= ykeep
 "  call Dret("s:NetrwHidden")
 endfun
@@ -5101,28 +5378,152 @@ fun! s:NetrwLeftmouse(islocal)
 "   call Dret("s:NetrwLeftmouse : detected a status bar leftmouse click")
    return
   endif
-   " NOTE: following test is preventing leftmouse selection/deselection of directories and files in treelist mode (Dec 04, 2013)
+   " Dec 04, 2013: following test prevents leftmouse selection/deselection of directories and files in treelist mode
    " Windows are separated by vertical separator bars - but the mouse seems to be doing what it should when dragging that bar
-   " without this test.
-"  if v:mouse_col != col('.')
-"   let @@= ykeep
-"   call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click")
-"   return
-"  endif
+   " without this test when its disabled.
+   " May 26, 2014: edit file, :Lex, resize window -- causes refresh.  Reinstated a modified test.  See if problems develop.
+"   call Decho("v:mouse_col=".v:mouse_col." col#".col('.')." virtcol#".virtcol('.')." col($)#".col("$")." virtcol($)#".virtcol("$"))
+   if v:mouse_col > virtcol('.')
+    let @@= ykeep
+"    call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click")
+    return
+   endif
 
   if a:islocal
    if exists("b:netrw_curdir")
-    keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+    NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
    endif
   else
    if exists("b:netrw_curdir")
-    keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+    NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
    endif
   endif
   let @@= ykeep
 "  call Dret("s:NetrwLeftmouse")
 endfun
 
+" ---------------------------------------------------------------------
+" s:NetrwServerEdit: edit file in a server gvim, usually NETRWSERVER  (implements <c-r>){{{2
+"   a:islocal=0 : <c-r> not used, remote
+"   a:islocal=1 : <c-r> no  used, local
+"   a:islocal=2 : <c-r>     used, remote
+"   a:islocal=3 : <c-r>     used, local
+fun! s:NetrwServerEdit(islocal,fname)
+"  call Dfunc("s:NetrwServerEdit(islocal=".a:islocal.",fname<".a:fname.">)")
+  let islocal = a:islocal%2      " =0: remote           =1: local
+  let ctrlr   = a:islocal >= 2   " =0: <c-r> not used   =1: <c-r> used
+
+  if (islocal && isdirectory(a:fname)) || (!islocal && a:fname =~ '/$')
+   " handle directories in the local window -- not in the remote vim server
+   " user must have closed the NETRWSERVER window.  Treat as a normal editing from netrw.
+   let g:netrw_browse_split= 0
+   if exists("s:netrw_browse_split_".winnr())
+    let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
+    unlet s:netrw_browse_split_{winnr()}
+   endif
+   call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname))
+"   call Dret("s:NetrwServerEdit")
+   return
+  endif
+
+  if has("clientserver") && executable("gvim")
+"   call Decho("has clientserver and gvim")
+
+    if exists("g:netrw_browse_split") && type(g:netrw_browse_split) == 3
+"     call Decho("g:netrw_browse_split=".string(g:netrw_browse_split))
+     let srvrname = g:netrw_browse_split[0]
+     let tabnum   = g:netrw_browse_split[1]
+     let winnum   = g:netrw_browse_split[2]
+
+     if serverlist() !~ '\<'.srvrname.'\>'
+"      call Decho("server not available; ctrlr=".ctrlr)
+
+      if !ctrlr
+       " user must have closed the server window and the user did not use <c-r>, but
+       " used something like <cr>.
+"       call Decho("user must have closed server AND did not use ctrl-r")
+       if exists("g:netrw_browse_split")
+	unlet g:netrw_browse_split
+       endif
+       let g:netrw_browse_split= 0
+       if exists("s:netrw_browse_split_".winnr())
+        let g:netrw_browse_split= s:netrw_browse_split_{winnr()}
+       endif
+       call s:NetrwBrowseChgDir(islocal,a:fname)
+"       call Dret("s:NetrwServerEdit")
+       return
+
+      elseif has("win32") && executable("start")
+       " start up remote netrw server under windows
+"       call Decho("starting up gvim server<".srvrname."> for windows")
+       call system("start gvim --servername ".srvrname)
+
+      else
+       " start up remote netrw server under linux
+"       call Decho("starting up gvim server<".srvrname.">")
+       call system("gvim --servername ".srvrname)
+      endif
+     endif
+
+"     call Decho("srvrname<".srvrname."> tabnum=".tabnum." winnum=".winnum." server-editing<".a:fname.">")
+     call remote_send(srvrname,":tabn ".tabnum."\<cr>")
+     call remote_send(srvrname,":".winnum."wincmd w\<cr>")
+     call remote_send(srvrname,":e ".fnameescape(a:fname)."\<cr>")
+
+    else
+
+     if serverlist() !~ '\<'.g:netrw_servername.'\>'
+
+      if !ctrlr
+"       call Decho("server<".g:netrw_servername."> not available and ctrl-r not used")
+       if exists("g:netrw_browse_split")
+	unlet g:netrw_browse_split
+       endif
+       let g:netrw_browse_split= 0
+       call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname))
+"       call Dret("s:NetrwServerEdit")
+       return
+
+      else
+"       call Decho("server<".g:netrw_servername."> not available but ctrl-r used")
+       if has("win32") && executable("start")
+        " start up remote netrw server under windows
+"        call Decho("starting up gvim server<".g:netrw_servername."> for windows")
+        call system("start gvim --servername ".g:netrw_servername)
+       else
+        " start up remote netrw server under linux
+"        call Decho("starting up gvim server<".g:netrw_servername.">")
+        call system("gvim --servername ".g:netrw_servername)
+       endif
+      endif
+     endif
+
+     while 1
+      try
+"       call Decho("remote-send: e ".a:fname)
+       call remote_send(g:netrw_servername,":e ".fnameescape(a:fname)."\<cr>")
+       break
+      catch /^Vim\%((\a\+)\)\=:E241/
+       sleep 200m
+      endtry
+     endwhile
+
+     if exists("g:netrw_browse_split")
+      if type(g:netrw_browse_split) != 3
+        let s:netrw_browse_split_{winnr()}= g:netrw_browse_split
+       endif
+      unlet g:netrw_browse_split
+     endif
+     let g:netrw_browse_split= [g:netrw_servername,1,1]
+    endif
+
+   else
+    call netrw#ErrorMsg(s:ERROR,"you need a gui-capable vim and client-server to use <ctrl-r>",98)
+   endif
+
+"  call Dret("s:NetrwServerEdit")
+endfun
+
 " ---------------------------------------------------------------------
 " s:NetrwSLeftmouse: marks the file under the cursor.  May be dragged to select additional files {{{2
 fun! s:NetrwSLeftmouse(islocal)
@@ -5177,7 +5578,7 @@ endfun
 " s:NetrwListHide: uses [range]g~...~d to delete files that match comma {{{2
 " separated patterns given in g:netrw_list_hide
 fun! s:NetrwListHide()
-"  call Dfunc("NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
+"  call Dfunc("s:NetrwListHide() g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
   let ykeep= @@
 
   " find a character not in the "hide" string to use as a separator for :g and :v commands
@@ -5200,23 +5601,23 @@ fun! s:NetrwListHide()
    " Prune the list by hiding any files which match
    if g:netrw_hide == 1
 "    call Decho("hiding<".hide."> listhide<".listhide.">")
-    exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
+    exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
    elseif g:netrw_hide == 2
 "    call Decho("showing<".hide."> listhide<".listhide.">")
-    exe 'sil! keepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
+    exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
    endif
   endwhile
   if g:netrw_hide == 2
-   exe 'sil! keepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
-   exe 'sil! keepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
+   exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
+   exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
   endif
 
   " remove any blank lines that have somehow remained.
   " This seems to happen under Windows.
-  exe 'sil! keepj 1,$g@^\s*$@d'
+  exe 'sil! NetrwKeepj 1,$g@^\s*$@d'
 
   let @@= ykeep
-"  call Dret("NetrwListHide")
+"  call Dret("s:NetrwListHide")
 endfun
 
 " ---------------------------------------------------------------------
@@ -5236,7 +5637,7 @@ fun! s:NetrwHideEdit(islocal)
 "  call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">")
 
   " refresh the listing
-  sil keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
+  sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
 
   " restore cursor position
   call netrw#RestorePosn(svpos)
@@ -5258,8 +5659,8 @@ fun! s:NetSortSequence(islocal)
 
   " refresh the listing
   let g:netrw_sort_sequence= newsortseq
-  keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
   let @@= ykeep
 
 "  call Dret("NetSortSequence")
@@ -5267,6 +5668,7 @@ endfun
 
 " ---------------------------------------------------------------------
 " s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2
+"                 implements the "d" mapping.
 fun! s:NetrwMakeDir(usrhost)
 "  call Dfunc("s:NetrwMakeDir(usrhost<".a:usrhost.">)")
 
@@ -5294,7 +5696,7 @@ fun! s:NetrwMakeDir(usrhost)
 "   call Decho("fullnewdir<".fullnewdir.">")
    if isdirectory(fullnewdir)
     if !exists("g:netrw_quiet")
-     keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
+     NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
     endif
     let @@= ykeep
 "    call Dret("s:NetrwMakeDir : directory<".newdirname."> exists previously")
@@ -5302,7 +5704,7 @@ fun! s:NetrwMakeDir(usrhost)
    endif
    if s:FileReadable(fullnewdir)
     if !exists("g:netrw_quiet")
-     keepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
+     NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
     endif
     let @@= ykeep
 "    call Dret("s:NetrwMakeDir : file<".newdirname."> exists previously")
@@ -5321,8 +5723,7 @@ fun! s:NetrwMakeDir(usrhost)
     let netrw_origdir= s:NetrwGetcwd(1)
     call s:NetrwLcd(b:netrw_curdir)
 "    call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">")
-"    call Decho("exe sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
-    exe "sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1)
+    call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(newdirname,1))
     if v:shell_error != 0
      let @@= ykeep
      call netrw#ErrorMsg(s:ERROR,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
@@ -5351,15 +5752,14 @@ fun! s:NetrwMakeDir(usrhost)
 "   call Decho("remote mkdir")
    let mkdircmd  = s:MakeSshCmd(g:netrw_mkdir_cmd)
    let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname
-"   call Decho("exe sil! !".mkdircmd." ".shellescape(newdirname,1))
-   exe "sil! !".mkdircmd." ".shellescape(newdirname,1)
+   call s:NetrwExe("sil! !".mkdircmd." ".shellescape(newdirname,1))
    if v:shell_error == 0
     " refresh listing
     let svpos= netrw#SavePosn()
-    keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
-    keepj call netrw#RestorePosn(svpos)
+    NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+    NetrwKeepj call netrw#RestorePosn(svpos)
    elseif !exists("g:netrw_quiet")
-    keepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
+    NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
    endif
 "   redraw!
 
@@ -5374,8 +5774,8 @@ fun! s:NetrwMakeDir(usrhost)
     let remotepath= ""
    endif
    call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
-   keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
 
   elseif b:netrw_method == 3
    " Remote mkdir: using ftp + machine, id, passwd, and fname (ie. no .netrc)
@@ -5388,8 +5788,8 @@ fun! s:NetrwMakeDir(usrhost)
     let remotepath= ""
    endif
    call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"')
-   keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   endif
 
   let @@= ykeep
@@ -5452,6 +5852,7 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> C		:<c-u>call <SID>NetrwSetChgwin()<cr>
    nnoremap <buffer> <silent> <cr>	:call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
    nnoremap <buffer> <silent> <s-cr>	:call <SID>TreeSqueezeDir(1)<cr>
+   nnoremap <buffer> <silent> <c-r>	:call <SID>NetrwServerEdit(3,<SID>NetrwGetWord())<cr>
    nnoremap <buffer> <silent> d		:call <SID>NetrwMakeDir("")<cr>
    nnoremap <buffer> <silent> -		:call <SID>NetrwBrowseUpDir(1)<cr>
    nnoremap <buffer> <silent> gb	:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
@@ -5477,8 +5878,9 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> mt	:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
    nnoremap <buffer> <silent> mT	:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
    nnoremap <buffer> <silent> mu	:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
-   nnoremap <buffer> <silent> mx	:<c-u>call <SID>NetrwMarkFileExe(1)<cr>
-   nnoremap <buffer> <silent> mX	:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+   nnoremap <buffer> <silent> mv	:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+   nnoremap <buffer> <silent> mx	:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+   nnoremap <buffer> <silent> mX	:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
    nnoremap <buffer> <silent> mz	:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
    nnoremap <buffer> <silent> O		:call <SID>NetrwObtain(1)<cr>
    nnoremap <buffer> <silent> o		:call <SID>NetrwSplit(3)<cr>
@@ -5496,11 +5898,11 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> u		:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
    nnoremap <buffer> <silent> U		:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
    nnoremap <buffer> <silent> v		:call <SID>NetrwSplit(5)<cr>
-   nnoremap <buffer> <silent> x		:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+   nnoremap <buffer> <silent> x		:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
    nnoremap <buffer> <silent> X		:call <SID>NetrwLocalExecute(expand("<cword>"))"<cr>
    " local insert-mode maps
    inoremap <buffer> <silent> a		<c-o>:call <SID>NetrwHide(1)<cr>
-   inoremap <buffer> <silent> c		<c-o>:exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr>
+   inoremap <buffer> <silent> c		<c-o>:exe "NetrwKeepj lcd ".fnameescape(b:netrw_curdir)<cr>
    inoremap <buffer> <silent> c		<c-o>:call <SID>NetrwLcd(b:netrw_curdir)<cr>
    inoremap <buffer> <silent> C		<c-o>:call <SID>NetrwSetChgwin()<cr>
    inoremap <buffer> <silent> %		<c-o>:call <SID>NetrwOpenFile(1)<cr>
@@ -5528,8 +5930,9 @@ fun! s:NetrwMaps(islocal)
    inoremap <buffer> <silent> mT	<c-o>:<c-u>call <SID>NetrwMarkFileTag(1)<cr>
    inoremap <buffer> <silent> mt	<c-o>:<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
    inoremap <buffer> <silent> mu	<c-o>:<c-u>call <SID>NetrwUnMarkFile(1)<cr>
-   inoremap <buffer> <silent> mx	<c-o>:<c-u>call <SID>NetrwMarkFileExe(1)<cr>
-   inoremap <buffer> <silent> mX	<c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+   inoremap <buffer> <silent> mv	<c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+   inoremap <buffer> <silent> mx	<c-o>:<c-u>call <SID>NetrwMarkFileExe(1,0)<cr>
+   inoremap <buffer> <silent> mX	<c-o>:<c-u>call <SID>NetrwMarkFileExe(1,1)<cr>
    inoremap <buffer> <silent> mz	<c-o>:<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
    inoremap <buffer> <silent> O		<c-o>:call <SID>NetrwObtain(1)<cr>
    inoremap <buffer> <silent> o		<c-o>:call <SID>NetrwSplit(3)<cr>
@@ -5547,7 +5950,7 @@ fun! s:NetrwMaps(islocal)
    inoremap <buffer> <silent> u		<c-o>:<c-u>call <SID>NetrwBookHistHandler(4,expand("%"))<cr>
    inoremap <buffer> <silent> U		<c-o>:<c-u>call <SID>NetrwBookHistHandler(5,expand("%"))<cr>
    inoremap <buffer> <silent> v		<c-o>:call <SID>NetrwSplit(5)<cr>
-   inoremap <buffer> <silent> x		<c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+   inoremap <buffer> <silent> x		<c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
    if !hasmapto('<Plug>NetrwHideEdit')
     nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
     imap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
@@ -5608,6 +6011,7 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> <cr>	:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
    nnoremap <buffer> <silent> <s-cr>	:call <SID>TreeSqueezeDir(0)<cr>
    nnoremap <buffer> <silent> <c-l>	:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+   nnoremap <buffer> <silent> <c-r>	:call <SID>NetrwServerEdit(2,<SID>NetrwGetWord())<cr>
    nnoremap <buffer> <silent> -		:call <SID>NetrwBrowseUpDir(0)<cr>
    nnoremap <buffer> <silent> a		:call <SID>NetrwHide(0)<cr>
    nnoremap <buffer> <silent> mb	:<c-u>call <SID>NetrwBookHistHandler(0,b:netrw_curdir)<cr>
@@ -5625,8 +6029,9 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> mt	:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
    nnoremap <buffer> <silent> mT	:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
    nnoremap <buffer> <silent> mu	:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
-   nnoremap <buffer> <silent> mx	:<c-u>call <SID>NetrwMarkFileExe(0)<cr>
-   nnoremap <buffer> <silent> mX	:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+   nnoremap <buffer> <silent> mv	:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+   nnoremap <buffer> <silent> mx	:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+   nnoremap <buffer> <silent> mX	:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
    nnoremap <buffer> <silent> mz	:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
    nnoremap <buffer> <silent> gb	:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
    nnoremap <buffer> <silent> gd	:<c-u>call <SID>NetrwForceChgDir(0,<SID>NetrwGetWord())<cr>
@@ -5653,7 +6058,7 @@ fun! s:NetrwMaps(islocal)
    nnoremap <buffer> <silent> u		:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
    nnoremap <buffer> <silent> U		:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
    nnoremap <buffer> <silent> v		:call <SID>NetrwSplit(2)<cr>
-   nnoremap <buffer> <silent> x		:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+   nnoremap <buffer> <silent> x		:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
    nnoremap <buffer> <silent> %		:call <SID>NetrwOpenFile(0)<cr>
    " remote insert-mode maps
    inoremap <buffer> <silent> <cr>	<c-o>:call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
@@ -5675,8 +6080,10 @@ fun! s:NetrwMaps(islocal)
    inoremap <buffer> <silent> mt	<c-o>:<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
    inoremap <buffer> <silent> mT	<c-o>:<c-u>call <SID>NetrwMarkFileTag(0)<cr>
    inoremap <buffer> <silent> mu	<c-o>:<c-u>call <SID>NetrwUnMarkFile(0)<cr>
-   inoremap <buffer> <silent> mx	<c-o>:<c-u>call <SID>NetrwMarkFileExe(0)<cr>
-   inoremap <buffer> <silent> mX	<c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
+   nnoremap <buffer> <silent> mv	:<c-u>call <SID>NetrwMarkFileVimCmd(1)<cr>
+   inoremap <buffer> <silent> mx	<c-o>:<c-u>call <SID>NetrwMarkFileExe(0,0)<cr>
+   inoremap <buffer> <silent> mX	<c-o>:<c-u>call <SID>NetrwMarkFileExe(0,1)<cr>
+   inoremap <buffer> <silent> mv	<c-o>:<c-u>call <SID>NetrwMarkFileVimCmd(0)<cr>
    inoremap <buffer> <silent> mz	<c-o>:<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
    inoremap <buffer> <silent> gb	<c-o>:<c-u>call <SID>NetrwBookHistHandler(1,b:netrw_curdir)<cr>
    inoremap <buffer> <silent> gh	<c-o>:<c-u>call <SID>NetrwHidden(0)<cr>
@@ -5701,7 +6108,7 @@ fun! s:NetrwMaps(islocal)
    inoremap <buffer> <silent> u		<c-o>:<c-u>call <SID>NetrwBookHistHandler(4,b:netrw_curdir)<cr>
    inoremap <buffer> <silent> U		<c-o>:<c-u>call <SID>NetrwBookHistHandler(5,b:netrw_curdir)<cr>
    inoremap <buffer> <silent> v		<c-o>:call <SID>NetrwSplit(2)<cr>
-   inoremap <buffer> <silent> x		<c-o>:call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+   inoremap <buffer> <silent> x		<c-o>:call netrw#BrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
    inoremap <buffer> <silent> %		<c-o>:call <SID>NetrwOpenFile(0)<cr>
    if !hasmapto('<Plug>NetrwHideEdit')
     nmap <buffer> <c-h> <Plug>NetrwHideEdit
@@ -5714,7 +6121,7 @@ fun! s:NetrwMaps(islocal)
    endif
 
    let mapsafepath     = escape(s:path, s:netrw_map_escape)
-   let mapsafeusermach = escape(s:user.s:machine, s:netrw_map_escape)
+   let mapsafeusermach = escape(((s:user == "")? "" : s:user."@").s:machine, s:netrw_map_escape)
 
    nnoremap <buffer> <silent> <Plug>NetrwRefresh	:call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
    if g:netrw_mousemaps == 1
@@ -5755,23 +6162,31 @@ fun! s:NetrwMaps(islocal)
    inoremap <buffer> <F1>			<c-o>:he netrw-quickhelp<cr>
   endif
 
-  keepj call s:SetRexDir(a:islocal,b:netrw_curdir)
+  NetrwKeepj call s:SetRexDir(a:islocal,b:netrw_curdir)
 
 "  call Dret("s:NetrwMaps")
 endfun
 
 " ---------------------------------------------------------------------
-" s:NetrwCommands: sets up commands available only in the netrw buffer windows {{{2
+" s:NetrwCommands: sets up commands 				{{{2
+"  If -buffer, the command is only available from within netrw buffers
+"  Otherwise, the command is available from any window, so long as netrw
+"  has been used at least once in the session.
 fun! s:NetrwCommands(islocal)
 "  call Dfunc("s:NetrwCommands(islocal=".a:islocal.")")
 
+  com! -nargs=* -complete=file -bang	NetrwMB	call s:NetrwBookmark(<bang>0,<f-args>)
+  com! -nargs=*			    	NetrwC	call s:NetrwSetChgwin(<q-args>)
   com! Rexplore if exists("w:netrw_rexlocal")|call s:NetrwRexplore(w:netrw_rexlocal,exists("w:netrw_rexdir")? w:netrw_rexdir : ".")|else|call netrw#ErrorMsg(s:WARNING,"not a former netrw window",79)|endif
   if a:islocal
-   com! -buffer -nargs=+ -complete=file MF	call s:NetrwMarkFiles(1,<f-args>)
+   com! -buffer -nargs=+ -complete=file	MF	call s:NetrwMarkFiles(1,<f-args>)
   else
-   com! -buffer -nargs=+ -complete=file MF	call s:NetrwMarkFiles(0,<f-args>)
+   com! -buffer -nargs=+ -complete=file	MF	call s:NetrwMarkFiles(0,<f-args>)
   endif
-  com! -buffer -nargs=? -complete=file MT	call s:NetrwMarkTarget(<q-args>)
+  com! -buffer -nargs=? -complete=file	MT	call s:NetrwMarkTarget(<q-args>)
+  " the following two commands are intended to be used for testing only, so I'm not advertising them in the manual
+  com! -buffer -nargs=0			CRL	call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+  com! -buffer -nargs=0			CRR	call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))
 
 "  call Dret("s:NetrwCommands")
 endfun
@@ -5964,7 +6379,7 @@ fun! s:NetrwMarkFileCompress(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileCompress")
    return
   endif
@@ -5992,10 +6407,10 @@ fun! s:NetrwMarkFileCompress(islocal)
       if a:islocal
        call system(exe." ".fname)
       else
-       keepj call s:RemoteSystem(exe." ".fname)
+       NetrwKeepj call s:RemoteSystem(exe." ".fname)
       endif
      else
-      keepj call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50)
+      NetrwKeepj call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50)
      endif
     endif
     unlet sfx
@@ -6007,13 +6422,13 @@ fun! s:NetrwMarkFileCompress(islocal)
      call system(netrw#WinPath(g:netrw_compress)." ".shellescape(s:ComposePath(b:netrw_curdir,fname)))
     else
      " fname not a compressed file, so compress it
-     keepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname))
+     NetrwKeepj call s:RemoteSystem(netrw#WinPath(g:netrw_compress)." ".shellescape(fname))
     endif
    endfor	" for every file in the marked list
 
    call s:NetrwUnmarkList(curbufnr,curdir)
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   endif
 "  call Dret("s:NetrwMarkFileCompress")
 endfun
@@ -6037,14 +6452,14 @@ fun! s:NetrwMarkFileCopy(islocal,...)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileCopy")
    return
   endif
 "  call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
 
   if !exists("s:netrwmftgt")
-   keepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your marked file target is empty! (:help netrw-mt)",67)
 "   call Dret("s:NetrwMarkFileCopy 0")
    return 0
   endif
@@ -6063,14 +6478,17 @@ fun! s:NetrwMarkFileCopy(islocal,...)
    if simplify(s:netrwmftgt) == simplify(b:netrw_curdir)
     if len(s:netrwmarkfilelist_{bufnr('%')}) == 1
      " only one marked file
+"     call Decho("case: only one marked file")
      let args    = shellescape(b:netrw_curdir."/".s:netrwmarkfilelist_{bufnr('%')}[0])
      let oldname = s:netrwmarkfilelist_{bufnr('%')}[0]
     elseif a:0 == 1
+"     call Decho("case: handling one input argument")
      " this happens when the next case was used to recursively call s:NetrwMarkFileCopy()
      let args    = shellescape(b:netrw_curdir."/".a:1)
      let oldname = a:1
     else
      " copy multiple marked files inside the same directory
+"     call Decho("case: handling a multiple marked files")
      let s:recursive= 1
      for oldname in s:netrwmarkfilelist_{bufnr("%")}
       let ret= s:NetrwMarkFileCopy(a:islocal,oldname)
@@ -6101,18 +6519,34 @@ fun! s:NetrwMarkFileCopy(islocal,...)
     let args= substitute(args,'/','\\','g')
     let tgt = substitute(tgt, '/','\\','g')
    endif
+   if args =~ "'"|let args= substitute(args,"'\\(.*\\)'",'\1','')|endif
+   if tgt  =~ "'"|let tgt = substitute(tgt,"'\\(.*\\)'",'\1','') |endif
+   if isdirectory(args)
+"    call Decho("args<".args."> is a directory")
+    let copycmd= g:netrw_localcopydircmd
+"    call Decho("using copydircmd<".copycmd.">")
+    if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+     " window's xcopy doesn't copy a directory to a target properly.  Instead, it copies a directory's
+     " contents to a target.  One must append the source directory name to the target to get xcopy to
+     " do the right thing.
+     let tgt= tgt.'\'.substitute(a:1,'^.*[\\/]','','')
+"     call Decho("modified tgt for xcopy")
+    endif
+   else
+    let copycmd= g:netrw_localcopycmd
+   endif
    if g:netrw_localcopycmd =~ '\s'
-    let copycmd     = substitute(g:netrw_localcopycmd,'\s.*$','','')
-    let copycmdargs = substitute(g:netrw_localcopycmd,'^.\{-}\(\s.*\)$','\1','')
+    let copycmd     = substitute(copycmd,'\s.*$','','')
+    let copycmdargs = substitute(copycmd,'^.\{-}\(\s.*\)$','\1','')
     let copycmd     = netrw#WinPath(copycmd).copycmdargs
    else
-    let copycmd = netrw#WinPath(g:netrw_localcopycmd)
+    let copycmd = netrw#WinPath(copycmd)
    endif
 "   call Decho("args   <".args.">")
 "   call Decho("tgt    <".tgt.">")
 "   call Decho("copycmd<".copycmd.">")
-"   call Decho("system(".copycmd." ".args." ".tgt.")")
-   call system(copycmd." ".args." ".tgt)
+"   call Decho("system(".copycmd." '".args."' '".tgt."')")
+   call system(copycmd." '".args."' '".tgt."'")
    if v:shell_error != 0
     call netrw#ErrorMsg(s:ERROR,"tried using g:netrw_localcopycmd<".g:netrw_localcopycmd.">; it doesn't work!",80)
 "    call Dret("s:NetrwMarkFileCopy 0 : failed: system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt))
@@ -6122,12 +6556,12 @@ fun! s:NetrwMarkFileCopy(islocal,...)
   elseif  a:islocal && !s:netrwmftgt_islocal
    " Copy marked files, local directory to remote directory
 "   call Decho("copy from local to remote")
-   keepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+   NetrwKeepj call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
 
   elseif !a:islocal &&  s:netrwmftgt_islocal
    " Copy marked files, remote directory to local directory
 "   call Decho("copy from remote to local")
-   keepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+   NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
 
   elseif !a:islocal && !s:netrwmftgt_islocal
    " Copy marked files, remote directory to remote directory
@@ -6140,7 +6574,7 @@ fun! s:NetrwMarkFileCopy(islocal,...)
    if exists("*mkdir")
     call mkdir(tmpdir)
    else
-    exe "sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1)
+    call s:NetrwExe("sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1))
     if v:shell_error != 0
      call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80)
 "     call Dret("s:NetrwMarkFileCopy : failed: sil! !".g:netrw_localmkdir.' '.shellescape(tmpdir,1) )
@@ -6149,15 +6583,15 @@ fun! s:NetrwMarkFileCopy(islocal,...)
    endif
    if isdirectory(tmpdir)
     call s:NetrwLcd(tmpdir)
-    keepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
+    NetrwKeepj call netrw#Obtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
     let localfiles= map(deepcopy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")')
-    keepj call s:NetrwUpload(localfiles,s:netrwmftgt)
+    NetrwKeepj call s:NetrwUpload(localfiles,s:netrwmftgt)
     if getcwd() == tmpdir
      for fname in s:netrwmarkfilelist_{bufnr('%')}
-      keepj call s:NetrwDelete(fname)
+      NetrwKeepj call s:NetrwDelete(fname)
      endfor
      call s:NetrwLcd(curdir)
-     exe "sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1)
+     call s:NetrwExe("sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1))
      if v:shell_error != 0
       call netrw#ErrorMsg(s:WARNING,"consider setting g:netrw_localrmdir<".g:netrw_localrmdir."> to something that works",80)
 "      call Dret("s:NetrwMarkFileCopy : failed: sil !".g:netrw_localrmdir." ".shellescape(tmpdir,1) )
@@ -6183,10 +6617,10 @@ fun! s:NetrwMarkFileCopy(islocal,...)
    call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
   endif
   if a:islocal
-   keepj call s:NetrwRefreshDir(a:islocal,curdir)
+   NetrwKeepj call s:NetrwRefreshDir(a:islocal,curdir)
   endif
   if g:netrw_fastbrowse <= 1
-   keepj call s:LocalBrowseRefresh()
+   NetrwKeepj call s:LocalBrowseRefresh()
   endif
   
 "  call Dret("s:NetrwMarkFileCopy 1")
@@ -6204,7 +6638,7 @@ fun! s:NetrwMarkFileDiff(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileDiff")
    return
   endif
@@ -6217,13 +6651,13 @@ fun! s:NetrwMarkFileDiff(islocal)
     let cnt= cnt + 1
     if cnt == 1
 "     call Decho("diffthis: fname<".fname.">")
-     exe "e ".fnameescape(fname)
+     exe "NetrwKeepj e ".fnameescape(fname)
      diffthis
     elseif cnt == 2 || cnt == 3
      vsplit
      wincmd l
 "     call Decho("diffthis: ".fname)
-     exe "e ".fnameescape(fname)
+     exe "NetrwKeepj e ".fnameescape(fname)
      diffthis
     else
      break
@@ -6246,7 +6680,7 @@ fun! s:NetrwMarkFileEdit(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileEdit")
    return
   endif
@@ -6298,72 +6732,106 @@ fun! s:NetrwMarkFileQFEL(islocal,qfel)
 endfun
 
 " ---------------------------------------------------------------------
-" s:NetrwMarkFileExe: (invoked by mx) execute arbitrary system command on marked files, one at a time {{{2
-"                     Uses the local marked-file list.
-fun! s:NetrwMarkFileExe(islocal)
-"  call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.")")
+" s:NetrwMarkFileExe: (invoked by mx and mX) execute arbitrary system command on marked files {{{2
+"                     mx enbloc=0: Uses the local marked-file list, applies command to each file individually
+"                     mX enbloc=1: Uses the global marked-file list, applies command to entire list
+fun! s:NetrwMarkFileExe(islocal,enbloc)
+"  call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.",enbloc=".a:enbloc.")")
   let svpos    = netrw#SavePosn()
   let curdir   = b:netrw_curdir
   let curbufnr = bufnr("%")
 
-  " sanity check
-  if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
-"   call Dret("s:NetrwMarkFileExe")
-   return
-  endif
-"  call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
-
-  if exists("s:netrwmarkfilelist_{curbufnr}")
-   " get the command
-   call inputsave()
-   let cmd= input("Enter command: ","","file")
-   call inputrestore()
-"   call Decho("cmd<".cmd.">")
-   if cmd == ""
-"    "   call Dret("s:NetrwMarkFileExe : early exit, empty command")
-    return
-   endif
+  if a:enbloc == 0
+   " individually apply command to files, one at a time
+    " sanity check
+    if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
+     NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+"     call Dret("s:NetrwMarkFileExe")
+     return
+    endif
+"    call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
 
-   " apply command to marked files.  Substitute: filename -> %
-   " If no %, then append a space and the filename to the command
-   for fname in s:netrwmarkfilelist_{curbufnr}
-    if a:islocal
-     if g:netrw_keepdir
-      let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname)))
+    if exists("s:netrwmarkfilelist_{curbufnr}")
+     " get the command
+     call inputsave()
+     let cmd= input("Enter command: ","","file")
+     call inputrestore()
+"     call Decho("cmd<".cmd.">")
+     if cmd == ""
+"      call Dret("s:NetrwMarkFileExe : early exit, empty command")
+      return
      endif
-    else
-     let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname))
-    endif
-    if cmd =~ '%'
-     let xcmd= substitute(cmd,'%',fname,'g')
-    else
-     let xcmd= cmd.' '.fname
-    endif
-    if a:islocal
-"     call Decho("local: xcmd<".xcmd.">")
-     let ret= system(xcmd)
-    else
-"     call Decho("remote: xcmd<".xcmd.">")
-     let ret= s:RemoteSystem(xcmd)
-    endif
-    if v:shell_error < 0
-     keepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
-     break
-    else
-     echo ret
-    endif
-   endfor
+
+     " apply command to marked files, individually.  Substitute: filename -> %
+     " If no %, then append a space and the filename to the command
+     for fname in s:netrwmarkfilelist_{curbufnr}
+      if a:islocal
+       if g:netrw_keepdir
+	let fname= shellescape(netrw#WinPath(s:ComposePath(curdir,fname)))
+       endif
+      else
+       let fname= shellescape(netrw#WinPath(b:netrw_curdir.fname))
+      endif
+      if cmd =~ '%'
+       let xcmd= substitute(cmd,'%',fname,'g')
+      else
+       let xcmd= cmd.' '.fname
+      endif
+      if a:islocal
+"       call Decho("local: xcmd<".xcmd.">")
+       let ret= system(xcmd)
+      else
+"       call Decho("remote: xcmd<".xcmd.">")
+       let ret= s:RemoteSystem(xcmd)
+      endif
+      if v:shell_error < 0
+       NetrwKeepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
+       break
+      else
+       echo ret
+      endif
+     endfor
 
    " unmark marked file list
    call s:NetrwUnmarkList(curbufnr,curdir)
 
    " refresh the listing
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   else
-   keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
   endif
+
+ else " apply command to global list of files, en bloc
+
+  call inputsave()
+  let cmd= input("Enter command: ","","file")
+  call inputrestore()
+"  call Decho("cmd<".cmd.">")
+  if cmd == ""
+"   call Dret("s:NetrwMarkFileExe : early exit, empty command")
+   return
+  endif
+  if cmd =~ '%'
+   let cmd= substitute(cmd,'%',join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' '),'g')
+  else
+   let cmd= cmd.' '.join(map(s:netrwmarkfilelist,'shellescape(v:val)'),' ')
+  endif
+  if a:islocal
+   call system(cmd)
+   if v:shell_error < 0
+    NetrwKeepj call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
+   endif
+  else
+   let ret= s:RemoteSystem(cmd)
+  endif
+  call s:NetrwUnmarkAll()
+
+  " refresh the listing
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
+
+ endif
   
 "  call Dret("s:NetrwMarkFileExe")
 endfun
@@ -6416,17 +6884,17 @@ fun! s:NetrwMarkHideSfx(islocal)
     endfor
 
    " refresh the listing
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   else
-   keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
   endif
 
 "  call Dret("s:NetrwMarkHideSfx")
 endfun
 
 " ---------------------------------------------------------------------
-" s:NetrwMarkFileVimCmd: (invoked by mX) execute arbitrary vim command on marked files, one at a time {{{2
+" s:NetrwMarkFileVimCmd: (invoked by mv) execute arbitrary vim command on marked files, one at a time {{{2
 "                     Uses the local marked-file list.
 fun! s:NetrwMarkFileVimCmd(islocal)
 "  call Dfunc("s:NetrwMarkFileVimCmd(islocal=".a:islocal.")")
@@ -6436,7 +6904,7 @@ fun! s:NetrwMarkFileVimCmd(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileVimCmd")
    return
   endif
@@ -6459,13 +6927,13 @@ fun! s:NetrwMarkFileVimCmd(islocal)
 "    call Decho("fname<".fname.">")
     if a:islocal
      1split
-     exe "sil! keepalt e ".fnameescape(fname)
+     exe "sil! NetrwKeepj keepalt e ".fnameescape(fname)
 "     call Decho("local<".fname.">: exe ".cmd)
      exe cmd
      exe "sil! keepalt wq!"
     else
 "     call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET")
-     echo "sorry, \"mX\" not supported yet for remote files"
+     echo "sorry, \"mv\" not supported yet for remote files"
     endif
    endfor
 
@@ -6473,10 +6941,10 @@ fun! s:NetrwMarkFileVimCmd(islocal)
    call s:NetrwUnmarkList(curbufnr,curdir)
 
    " refresh the listing
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   else
-   keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
   endif
   
 "  call Dret("s:NetrwMarkFileVimCmd")
@@ -6530,10 +6998,10 @@ fun! s:NetrwMarkHideSfx(islocal)
     endfor
 
    " refresh the listing
-   keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   else
-   keepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
   endif
 
 "  call Dret("s:NetrwMarkHideSfx")
@@ -6575,16 +7043,16 @@ fun! s:NetrwMarkFileGrep(islocal)
   " use vimgrep for both local and remote
 "  call Decho("exe vimgrep".patbang." ".pat." ".netrwmarkfilelist)
   try
-   exe "keepj noautocmd vimgrep".patbang." ".pat." ".netrwmarkfilelist
+   exe "NetrwKeepj noautocmd vimgrep".patbang." ".pat." ".netrwmarkfilelist
   catch /^Vim\%((\a\+)\)\=:E480/
-   keepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pat.">",76)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pat.">",76)
 "   call Dret("s:NetrwMarkFileGrep : unable to find pattern<".pat.">")
    return
   endtry
   echo "(use :cn, :cp to navigate, :Rex to return)"
 
   2match none
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call netrw#RestorePosn(svpos)
 
   if exists("nonisi")
    " original, user-supplied pattern did not begin with a character from isident
@@ -6609,14 +7077,14 @@ fun! s:NetrwMarkFileMove(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileMove")
    return
   endif
 "  call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}))
 
   if !exists("s:netrwmftgt")
-   keepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
+   NetrwKeepj call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
 "   call Dret("s:NetrwMarkFileCopy 0")
    return 0
   endif
@@ -6666,7 +7134,7 @@ fun! s:NetrwMarkFileMove(islocal)
 "   call Decho("move from local to remote")
 "   call Decho("copy")
    let mflist= s:netrwmarkfilelist_{bufnr("%")}
-   keepj call s:NetrwMarkFileCopy(a:islocal)
+   NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
 "   call Decho("remove")
    for fname in mflist
     let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6679,7 +7147,7 @@ fun! s:NetrwMarkFileMove(islocal)
 "   call Decho("move from remote to local")
 "   call Decho("copy")
    let mflist= s:netrwmarkfilelist_{bufnr("%")}
-   keepj call s:NetrwMarkFileCopy(a:islocal)
+   NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
 "   call Decho("remove")
    for fname in mflist
     let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6692,7 +7160,7 @@ fun! s:NetrwMarkFileMove(islocal)
 "   call Decho("move from remote to remote")
 "   call Decho("copy")
    let mflist= s:netrwmarkfilelist_{bufnr("%")}
-   keepj call s:NetrwMarkFileCopy(a:islocal)
+   NetrwKeepj call s:NetrwMarkFileCopy(a:islocal)
 "   call Decho("remove")
    for fname in mflist
     let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
@@ -6712,15 +7180,15 @@ fun! s:NetrwMarkFileMove(islocal)
   " refresh buffers
   if !s:netrwmftgt_islocal
 "   call Decho("refresh netrwmftgt<".s:netrwmftgt.">")
-   keepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
+   NetrwKeepj call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
   endif
   if a:islocal
 "   call Decho("refresh b:netrw_curdir<".b:netrw_curdir.">")
-   keepj call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
+   NetrwKeepj call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
   endif
   if g:netrw_fastbrowse <= 1
 "   call Decho("since g:netrw_fastbrowse=".g:netrw_fastbrowse.", perform shell cmd refresh")
-   keepj call s:LocalBrowseRefresh()
+   NetrwKeepj call s:LocalBrowseRefresh()
   endif
   
 "  call Dret("s:NetrwMarkFileMove")
@@ -6735,7 +7203,7 @@ fun! s:NetrwMarkFilePrint(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFilePrint")
    return
   endif
@@ -6755,7 +7223,7 @@ fun! s:NetrwMarkFilePrint(islocal)
     1split
     " the autocmds will handle both local and remote files
 "    call Decho("exe sil e ".escape(fname,' '))
-    exe "sil e ".fnameescape(fname)
+    exe "sil NetrwKeepj e ".fnameescape(fname)
 "    call Decho("hardcopy")
     hardcopy
     q
@@ -6788,7 +7256,7 @@ fun! s:NetrwMarkFileRegexp(islocal)
   " mark the list of files
   for fname in filelist
 "   call Decho("fname<".fname.">")
-   keepj call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','',''))
+   NetrwKeepj call s:NetrwMarkFile(a:islocal,substitute(fname,'^.*/','',''))
   endfor
 
   else
@@ -6797,38 +7265,38 @@ fun! s:NetrwMarkFileRegexp(islocal)
    " convert displayed listing into a filelist
    let eikeep = &ei
    let areg   = @a
-   sil keepj %y a
+   sil NetrwKeepj %y a
    setl ei=all ma
 "   call Decho("setl ei=all ma")
    1split
-   keepj call s:NetrwEnew()
-   keepj call s:NetrwSafeOptions()
-   sil keepj norm! "ap
-   keepj 2
+   NetrwKeepj call s:NetrwEnew()
+   NetrwKeepj call s:NetrwSafeOptions()
+   sil NetrwKeepj norm! "ap
+   NetrwKeepj 2
    let bannercnt= search('^" =====','W')
-   exe "sil keepj 1,".bannercnt."d"
+   exe "sil NetrwKeepj 1,".bannercnt."d"
    setl bt=nofile
    if     g:netrw_liststyle == s:LONGLIST
-    sil keepj %s/\s\{2,}\S.*$//e
+    sil NetrwKeepj %s/\s\{2,}\S.*$//e
     call histdel("/",-1)
    elseif g:netrw_liststyle == s:WIDELIST
-    sil keepj %s/\s\{2,}/\r/ge
+    sil NetrwKeepj %s/\s\{2,}/\r/ge
     call histdel("/",-1)
    elseif g:netrw_liststyle == s:TREELIST
-    exe 'sil keepj %s/^'.s:treedepthstring.' //e'
-    sil! keepj g/^ .*$/d
+    exe 'sil NetrwKeepj %s/^'.s:treedepthstring.' //e'
+    sil! NetrwKeepj g/^ .*$/d
     call histdel("/",-1)
     call histdel("/",-1)
    endif
    " convert regexp into the more usual glob-style format
    let regexp= substitute(regexp,'\*','.*','g')
 "   call Decho("regexp<".regexp.">")
-   exe "sil! keepj v/".escape(regexp,'/')."/d"
+   exe "sil! NetrwKeepj v/".escape(regexp,'/')."/d"
    call histdel("/",-1)
    let filelist= getline(1,line("$"))
    q!
    for filename in filelist
-    keepj call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
+    NetrwKeepj call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
    endfor
    unlet filelist
    let @a  = areg
@@ -6848,7 +7316,7 @@ fun! s:NetrwMarkFileSource(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileSource")
    return
   endif
@@ -6885,7 +7353,7 @@ fun! s:NetrwMarkFileTag(islocal)
 
   " sanity check
   if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr})
-   keepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+   NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
 "   call Dret("s:NetrwMarkFileTag")
    return
   endif
@@ -6908,10 +7376,10 @@ fun! s:NetrwMarkFileTag(islocal)
     call netrw#Obtain(a:islocal,"tags")
     let curdir= b:netrw_curdir
     1split
-    e tags
+    NetrwKeepj e tags
     let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','')
 "    call Decho("curdir<".curdir."> path<".path.">")
-    exe 'keepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e'
+    exe 'NetrwKeepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e'
     call histdel("/",-1)
     wq!
    endif
@@ -6990,7 +7458,7 @@ fun! s:NetrwMarkFileTgt(islocal)
   call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
   call netrw#RestorePosn(svpos)
   if !hadtgt
-   sil! keepj norm! j
+   sil! NetrwKeepj norm! j
   endif
 
 "  call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">")
@@ -7011,7 +7479,7 @@ fun! s:NetrwOpenFile(islocal)
     endif
     let g:netrw_quiet    = 1
     if b:netrw_curdir =~ '/$'
-     exe "e ".fnameescape(b:netrw_curdir.fname)
+     exe "NetrwKeepj e ".fnameescape(b:netrw_curdir.fname)
     else
      exe "e ".fnameescape(b:netrw_curdir."/".fname)
     endif
@@ -7022,7 +7490,7 @@ fun! s:NetrwOpenFile(islocal)
     endif
    endif
   else
-   exe "e ".fnameescape(fname)
+   exe "NetrwKeepj e ".fnameescape(fname)
   endif
   let @@= ykeep
 "  call Dret("s:NetrwOpenFile")
@@ -7149,6 +7617,7 @@ fun! s:NetrwMenu(domenu)
     exe 'sil! menu '.g:NetrwMenuPriority.'.11.2   '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directory<tab>p	p'
     exe 'sil! menu '.g:NetrwMenuPriority.'.11.3   '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ Window<tab>P	P'
     exe 'sil! menu '.g:NetrwMenuPriority.'.11.4   '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Window<tab>o	o'
+    exe 'sil! menu '.g:NetrwMenuPriority.'.11.5   '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Tab<tab>t	t'
     exe 'sil! menu '.g:NetrwMenuPriority.'.11.5   '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Window<tab>v	v'
     exe 'sil! menu '.g:NetrwMenuPriority.'.12.1   '.g:NetrwTopLvlMenu.'Explore.Directory\ Name	:Explore '
     exe 'sil! menu '.g:NetrwMenuPriority.'.12.2   '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only)<tab>:Explore\ */	:Explore */'
@@ -7249,7 +7718,7 @@ fun! s:NetrwPrevWinOpen(islocal)
   let lastwinnr = winnr("$")
   let curword   = s:NetrwGetWord()
   let choice    = 0
-  let s:treedir = s:NetrwTreeDir()
+  let s:treedir = s:NetrwTreeDir(a:islocal)
   let curdir    = s:treedir
 "  call Decho("winnr($)#".lastwinnr." curword<".curword.">")
 
@@ -7258,10 +7727,12 @@ fun! s:NetrwPrevWinOpen(islocal)
    " if only one window, open a new one first
 "   call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
    if g:netrw_preview
+    " vertically split preview window
     let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize
 "    call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s")
     exe (g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s"
    else
+    " horizontally split preview window
     let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize
 "    call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
     exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
@@ -7270,7 +7741,7 @@ fun! s:NetrwPrevWinOpen(islocal)
 "   call Decho("did split")
 
   else
-   keepj call s:SaveBufVars()
+   NetrwKeepj call s:SaveBufVars()
    let eikeep= &ei
    setl ei=all
    wincmd p
@@ -7284,7 +7755,7 @@ fun! s:NetrwPrevWinOpen(islocal)
    let prevbufname = bufname("%")
    let prevmod     = &mod
    let bnrcnt      = 0
-   keepj call s:RestoreBufVars()
+   NetrwKeepj call s:RestoreBufVars()
 "   call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr)
 
    " if the previous window's buffer has been changed (ie. its modified flag is set),
@@ -7376,7 +7847,7 @@ fun! s:NetrwUpload(fname,tgt,...)
 "   call Decho("handle uploading a single file via NetWrite")
    1split
 "   call Decho("exe e ".fnameescape(a:fname))
-   exe "e ".fnameescape(a:fname)
+   exe "NetrwKeepj e ".fnameescape(a:fname)
 "   call Decho("now locally editing<".expand("%").">, has ".line("$")." lines")
    if a:tgt =~ '/$'
     let wfname= substitute(a:fname,'^.*/','','')
@@ -7404,8 +7875,7 @@ fun! s:NetrwUpload(fname,tgt,...)
     endif
     let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','')
     let tgt     = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','')
-"    call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1))
-    exe s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1)
+    call s:NetrwExe(s:netrw_silentxfer."!".g:netrw_scp_cmd.shellescape(useport,1)." ".args." ".shellescape(machine.":".tgt,1))
     call s:NetrwLcd(curdir)
 
    elseif a:tgt =~ '^ftp:'
@@ -7414,41 +7884,39 @@ fun! s:NetrwUpload(fname,tgt,...)
     if b:netrw_method == 2
      " handle uploading a list of files via ftp+.netrc
      let netrw_fname = b:netrw_fname
-     sil keepj new
+     sil NetrwKeepj new
 "     call Decho("filter input window#".winnr())
 
-     keepj put =g:netrw_ftpmode
+     NetrwKeepj put =g:netrw_ftpmode
 "     call Decho("filter input: ".getline('$'))
 
      if exists("g:netrw_ftpextracmd")
-      keepj put =g:netrw_ftpextracmd
+      NetrwKeepj put =g:netrw_ftpextracmd
 "      call Decho("filter input: ".getline('$'))
      endif
 
-     keepj call setline(line("$")+1,'lcd "'.fromdir.'"')
+     NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
 "     call Decho("filter input: ".getline('$'))
 
      if tgtdir == ""
       let tgtdir= '/'
      endif
-     keepj call setline(line("$")+1,'cd "'.tgtdir.'"')
+     NetrwKeepj call setline(line("$")+1,'cd "'.tgtdir.'"')
 "     call Decho("filter input: ".getline('$'))
 
      for fname in a:fname
-      keepj call setline(line("$")+1,'put "'.fname.'"')
+      NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
 "      call Decho("filter input: ".getline('$'))
      endfor
 
      if exists("g:netrw_port") && g:netrw_port != ""
-"      call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
      else
 "      call Decho("filter input window#".winnr())
-"      call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
-      exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+      call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
      endif
      " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
-     sil keepj g/Local directory now/d
+     sil NetrwKeepj g/Local directory now/d
      call histdel("/",-1)
      if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
       call netrw#ErrorMsg(s:ERROR,getline(1),14)
@@ -7459,47 +7927,47 @@ fun! s:NetrwUpload(fname,tgt,...)
     elseif b:netrw_method == 3
      " upload with ftp + machine, id, passwd, and fname (ie. no .netrc)
      let netrw_fname= b:netrw_fname
-     keepj call s:SaveBufVars()|sil keepj new|keepj call s:RestoreBufVars()
+     NetrwKeepj call s:SaveBufVars()|sil NetrwKeepj new|NetrwKeepj call s:RestoreBufVars()
      let tmpbufnr= bufnr("%")
      setl ff=unix
 
      if exists("g:netrw_port") && g:netrw_port != ""
-      keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+      NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
 "      call Decho("filter input: ".getline('$'))
      else
-      keepj put ='open '.g:netrw_machine
+      NetrwKeepj put ='open '.g:netrw_machine
 "      call Decho("filter input: ".getline('$'))
      endif
 
      if exists("g:netrw_uid") && g:netrw_uid != ""
       if exists("g:netrw_ftp") && g:netrw_ftp == 1
-       keepj put =g:netrw_uid
+       NetrwKeepj put =g:netrw_uid
 "       call Decho("filter input: ".getline('$'))
        if exists("s:netrw_passwd")
-        keepj call setline(line("$")+1,'"'.s:netrw_passwd.'"')
+        NetrwKeepj call setline(line("$")+1,'"'.s:netrw_passwd.'"')
        endif
 "       call Decho("filter input: ".getline('$'))
       elseif exists("s:netrw_passwd")
-       keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+       NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
 "       call Decho("filter input: ".getline('$'))
       endif
      endif
 
-     keepj call setline(line("$")+1,'lcd "'.fromdir.'"')
+     NetrwKeepj call setline(line("$")+1,'lcd "'.fromdir.'"')
 "     call Decho("filter input: ".getline('$'))
 
      if exists("b:netrw_fname") && b:netrw_fname != ""
-      keepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+      NetrwKeepj call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
 "      call Decho("filter input: ".getline('$'))
      endif
 
      if exists("g:netrw_ftpextracmd")
-      keepj put =g:netrw_ftpextracmd
+      NetrwKeepj put =g:netrw_ftpextracmd
 "      call Decho("filter input: ".getline('$'))
      endif
 
      for fname in a:fname
-      keepj call setline(line("$")+1,'put "'.fname.'"')
+      NetrwKeepj call setline(line("$")+1,'put "'.fname.'"')
 "      call Decho("filter input: ".getline('$'))
      endfor
 
@@ -7507,11 +7975,10 @@ fun! s:NetrwUpload(fname,tgt,...)
      " -i       : turns off interactive prompting from ftp
      " -n  unix : DON'T use <.netrc>, even though it exists
      " -n  win32: quit being obnoxious about password
-     keepj norm! 1Gdd
-"     call Decho("executing: ".s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
-     exe s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+     NetrwKeepj norm! 1Gdd
+     call s:NetrwExe(s:netrw_silentxfer."%!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
      " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
-     sil keepj g/Local directory now/d
+     sil NetrwKeepj g/Local directory now/d
      call histdel("/",-1)
      if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
       let debugkeep= &debug
@@ -7539,8 +8006,8 @@ endfun
 fun! s:NetrwPreview(path) range
 "  call Dfunc("NetrwPreview(path<".a:path.">)")
   let ykeep= @@
-  keepj call s:NetrwOptionSave("s:")
-  keepj call s:NetrwSafeOptions()
+  NetrwKeepj call s:NetrwOptionSave("s:")
+  NetrwKeepj call s:NetrwSafeOptions()
   if has("quickfix")
    if !isdirectory(a:path)
     if g:netrw_preview && !g:netrw_alto
@@ -7553,12 +8020,12 @@ fun! s:NetrwPreview(path) range
      let &pvh= pvhkeep
     endif
    elseif !exists("g:netrw_quiet")
-    keepj call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
+    NetrwKeepj call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
    endif
   elseif !exists("g:netrw_quiet")
-   keepj call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
   endif
-  keepj call s:NetrwOptionRestore("s:")
+  NetrwKeepj call s:NetrwOptionRestore("s:")
   let @@= ykeep
 "  call Dret("NetrwPreview")
 endfun
@@ -7566,7 +8033,7 @@ endfun
 " ---------------------------------------------------------------------
 " s:NetrwRefresh: {{{2
 fun! s:NetrwRefresh(islocal,dirname)
-"  call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
+"  call Dfunc("s:NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
   " at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first.
   setl ma noro
 "  call Decho("setl ma noro")
@@ -7577,15 +8044,15 @@ fun! s:NetrwRefresh(islocal,dirname)
   let screenposn = netrw#SavePosn()
 "  call Decho("win#".winnr().": ".winheight(0)."x".winwidth(0)." curfile<".expand("%").">")
 "  call Decho("clearing buffer prior to refresh")
-  sil! keepj %d
+  sil! NetrwKeepj %d
   if a:islocal
-   keepj call netrw#LocalBrowseCheck(a:dirname)
+   NetrwKeepj call netrw#LocalBrowseCheck(a:dirname)
   else
-   keepj call s:NetrwBrowse(a:islocal,a:dirname)
+   NetrwKeepj call s:NetrwBrowse(a:islocal,a:dirname)
   endif
 
   " restore position
-  keepj call netrw#RestorePosn(screenposn)
+  NetrwKeepj call netrw#RestorePosn(screenposn)
 
   " restore file marks
   if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
@@ -7598,7 +8065,7 @@ fun! s:NetrwRefresh(islocal,dirname)
 
 "  restore
   let @@= ykeep
-"  call Dret("NetrwRefresh")
+"  call Dret("s:NetrwRefresh")
 endfun
 
 " ---------------------------------------------------------------------
@@ -7618,7 +8085,7 @@ fun! s:NetrwRefreshDir(islocal,dirname)
     let curwin= winnr()
 "    call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")")
     exe tgtwin."wincmd w"
-    keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) 
+    NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) 
     exe curwin."wincmd w"
 
    elseif bufnr(a:dirname) > 0
@@ -7629,7 +8096,7 @@ fun! s:NetrwRefreshDir(islocal,dirname)
 
   elseif g:netrw_fastbrowse <= 1
 "   call Decho("medium-speed mode: refresh local buffers only")
-   keepj call s:LocalBrowseRefresh()
+   NetrwKeepj call s:LocalBrowseRefresh()
   endif
 "  call Dret("s:NetrwRefreshDir")
 endfun
@@ -7639,14 +8106,21 @@ endfun
 " window number to do its editing in.
 " Supports   [count]C  where the count, if present, is used to specify
 " a window to use for editing via the <cr> mapping.
-fun! s:NetrwSetChgwin()
+fun! s:NetrwSetChgwin(...)
 "  call Dfunc("s:NetrwSetChgwin() v:count=".v:count)
-  if v:count > 0
+  if a:0 > 0
+"   call Decho("a:1<".a:1.">")
+   if a:1 == ""    " :NetrwC win#
+    let g:netrw_chgwin= winnr()
+   else              " :NetrwC
+    let g:netrw_chgwin= a:1
+   endif
+  elseif v:count > 0 " [count]C
    let g:netrw_chgwin= v:count
-  else
+  else               " C
    let g:netrw_chgwin= winnr()
   endif
-"  call Dret("s:NetrwSetChgwin")
+"  call Dret("s:NetrwSetChgwin : g:netrw_chgwin=".g:netrw_chgwin)
 endfun
 
 " ---------------------------------------------------------------------
@@ -7696,18 +8170,18 @@ fun! s:NetrwSetSort()
    if seq == '*'
     let starpriority= spriority
    else
-    exe 'sil keepj '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/'
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/'
     call histdel("/",-1)
     " sometimes multiple sorting patterns will match the same file or directory.
     " The following substitute is intended to remove the excess matches.
-    exe 'sil keepj '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e'
-    keepj call histdel("/",-1)
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^\d\{3}'.g:netrw_sepchr.'\d\{3}\//s/^\d\{3}'.g:netrw_sepchr.'\(\d\{3}\/\).\@=/\1/e'
+    NetrwKeepj call histdel("/",-1)
    endif
    let priority = priority + 1
   endwhile
   if exists("starpriority")
-   exe 'sil keepj '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/e'
-   keepj call histdel("/",-1)
+   exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$v/^\d\{3}'.g:netrw_sepchr.'/s/^/'.starpriority.'/e'
+   NetrwKeepj call histdel("/",-1)
   endif
 
   " Following line associated with priority -- items that satisfy a priority
@@ -7716,8 +8190,8 @@ fun! s:NetrwSetSort()
   " priority pattern needs to be retained.  So, at this point, these excess
   " priority prefixes need to be removed, but not directories that happen to
   " be just digits themselves.
-  exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e'
-  keepj call histdel("/",-1)
+  exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\d\{3}'.g:netrw_sepchr.'\)\%(\d\{3}'.g:netrw_sepchr.'\)\+\ze./\1/e'
+  NetrwKeepj call histdel("/",-1)
   let @@= ykeep
 
 "  call Dret("SetSort")
@@ -7758,13 +8232,13 @@ endfun
 " s:NetrwSortStyle: change sorting style (name - time - size) and refresh display {{{2
 fun! s:NetrwSortStyle(islocal)
 "  call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">")
-  keepj call s:NetrwSaveWordPosn()
+  NetrwKeepj call s:NetrwSaveWordPosn()
   let svpos= netrw#SavePosn()
 
   let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'
-  keepj norm! 0
-  keepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj norm! 0
+  NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
 
 "  call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">")
 endfun
@@ -7790,8 +8264,8 @@ fun! s:NetrwSplit(mode)
 "   call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
    exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
    let s:didsplit= 1
-   keepj call s:RestoreWinVars()
-   keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
    unlet s:didsplit
 
   elseif a:mode == 1
@@ -7800,8 +8274,8 @@ fun! s:NetrwSplit(mode)
 "   call Decho("tabnew")
    tabnew
    let s:didsplit= 1
-   keepj call s:RestoreWinVars()
-   keepj call s:NetrwBrowse(0,newdir)
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call s:NetrwBrowse(0,newdir)
    unlet s:didsplit
 
   elseif a:mode == 2
@@ -7811,8 +8285,8 @@ fun! s:NetrwSplit(mode)
 "   call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
    exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
    let s:didsplit= 1
-   keepj call s:RestoreWinVars()
-   keepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
    unlet s:didsplit
 
   elseif a:mode == 3
@@ -7822,8 +8296,8 @@ fun! s:NetrwSplit(mode)
 "   call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s")
    exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s"
    let s:didsplit= 1
-   keepj call s:RestoreWinVars()
-   keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
    unlet s:didsplit
 
   elseif a:mode == 4
@@ -7833,23 +8307,23 @@ fun! s:NetrwSplit(mode)
    let netrw_winnr = winnr()
    let netrw_line  = line(".")
    let netrw_col   = virtcol(".")
-   keepj norm! H0
+   NetrwKeepj norm! H0
    let netrw_hline = line(".")
    setl ei=all
-   exe "keepj norm! ".netrw_hline."G0z\<CR>"
-   exe "keepj norm! ".netrw_line."G0".netrw_col."\<bar>"
+   exe "NetrwKeepj norm! ".netrw_hline."G0z\<CR>"
+   exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\<bar>"
    let &ei= eikeep
-   let netrw_curdir= s:NetrwTreeDir()
+   let netrw_curdir= s:NetrwTreeDir(0)
 "   call Decho("tabnew")
    tabnew
    let b:netrw_curdir = netrw_curdir
    let s:didsplit     = 1
-   keepj call s:RestoreWinVars()
-   keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword))
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword))
    if &ft == "netrw"
     setl ei=all
-    exe "keepj norm! ".netrw_hline."G0z\<CR>"
-    exe "keepj norm! ".netrw_line."G0".netrw_col."\<bar>"
+    exe "NetrwKeepj norm! ".netrw_hline."G0z\<CR>"
+    exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\<bar>"
     let &ei= eikeep
    endif
    unlet s:didsplit
@@ -7861,12 +8335,13 @@ fun! s:NetrwSplit(mode)
 "   call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v")
    exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v"
    let s:didsplit= 1
-   keepj call s:RestoreWinVars()
-   keepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+   NetrwKeepj call s:RestoreWinVars()
+   NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+   "call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
    unlet s:didsplit
 
   else
-   keepj call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45)
   endif
 
   let @@= ykeep
@@ -7926,8 +8401,8 @@ endfun
 " ---------------------------------------------------------------------
 " s:NetrwTreeDir: determine tree directory given current cursor position {{{2
 " (full path directory with trailing slash returned)
-fun! s:NetrwTreeDir()
-"  call Dfunc("s:NetrwTreeDir() getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
+fun! s:NetrwTreeDir(islocal)
+"  call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft)
 
   if exists("s:treedir")
    " s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early
@@ -7948,7 +8423,8 @@ fun! s:NetrwTreeDir()
 "   call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">")
 
    " extract tree directory if on a line specifying a subdirectory (ie. ends with "/")
-   if getline('.') =~ '/$'
+   let curline= substitute(getline('.'),"\t -->.*$",'','')
+   if curline =~ '/$'
 "    call Decho("extract tree subdirectory from current line")
     let treedir= substitute(getline('.'),'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e')
 "    call Decho("treedir<".treedir.">")
@@ -7958,24 +8434,38 @@ fun! s:NetrwTreeDir()
    endif
 
    " detect user attempting to close treeroot
-"   call Decho("win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
-"   call Decho("getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring)
-   if getline('.') !~ '^'.s:treedepthstring && getline('.') != '..'
-"    call Decho("user may have attempted to close treeroot")
+"   call Decho("check if user is attempting to close treeroot")
+"   call Decho(".win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
+"   call Decho(".getline(".line(".").")<".getline('.').'> '.((getline('.') =~ '^'.s:treedepthstring)? '=~' : '!~').' ^'.s:treedepthstring)
+   if curline !~ '^'.s:treedepthstring && getline('.') != '..'
+"    call Decho(".user may have attempted to close treeroot")
     " now force a refresh
-"    call Decho("clear buffer<".expand("%")."> with :%d")
-    sil! keepj %d
+"    call Decho(".force refresh: clear buffer<".expand("%")."> with :%d")
+    sil! NetrwKeepj %d
 "    call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
     return b:netrw_curdir
 "   else " Decho
-"    call Decho("user did not attempt to close treeroot")
+"    call Decho(".user did not attempt to close treeroot")
    endif
 
-   let treedir = s:NetrwTreePath(w:netrw_treetop)
+"   call Decho("islocal=".a:islocal." curline<".curline.">")
+"   call Decho("after subst<".substitute(curline,'^'.s:treedepthstring.'\+ \(.*\)$','\1','').">")
+   let potentialdir= substitute(curline,'^'.s:treedepthstring.'* \(.*\)@$','\1','')
+"   call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(potentialdir))
+
+   if a:islocal && curline =~ '@$' && isdirectory(potentialdir)
+    let newdir          = w:netrw_treetop.'/'.potentialdir
+    let treedir         = s:NetrwTreePath(newdir)
+    let w:netrw_treetop = newdir
+"    call Decho("newdir <".newdir.">")
+   else
+    let treedir = s:NetrwTreePath(w:netrw_treetop)
+   endif
   endif
 
   " sanity maintenance: keep those //s away...
   let treedir= substitute(treedir,'//$','/','')
+"  call Decho("treedir<".treedir.">")
 
 "  call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
   return treedir
@@ -8022,13 +8512,13 @@ fun! s:NetrwTreeDisplay(dir,depth)
 "   call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">")
    if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
 "    call Decho("<".direntry."> is a key in treedict - display subtree for it")
-    keepj call s:NetrwTreeDisplay(direntry,depth)
+    NetrwKeepj call s:NetrwTreeDisplay(direntry,depth)
    elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/')
 "    call Decho("<".direntry."/> is a key in treedict - display subtree for it")
-    keepj call s:NetrwTreeDisplay(direntry.'/',depth)
+    NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth)
    else
 "    call Decho("<".entry."> is not a key in treedict (no subtree)")
-    sil! keepj call setline(line("$")+1,depth.entry)
+    sil! NetrwKeepj call setline(line("$")+1,depth.entry)
    endif
   endfor
 
@@ -8062,10 +8552,10 @@ fun! s:NetrwTreeListing(dirname)
    " update the directory listing for the current directory
 "   call Decho("updating dictionary with ".a:dirname.":[..directory listing..]")
 "   call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
-   exe "sil! keepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
    let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
 "   call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]))
-   exe "sil! keepj ".w:netrw_bannercnt.",$d"
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
 
    " if past banner, record word
    if exists("w:netrw_bannercnt") && line(".") > w:netrw_bannercnt
@@ -8077,7 +8567,7 @@ fun! s:NetrwTreeListing(dirname)
 "   call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
 
    " display from treetop on down
-   keepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
+   NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"")
 "   call Decho("s:NetrwTreeDisplay) setl noma nomod ro")
 
    " remove any blank line remaining as line#1 (happens in treelisting mode with banner suppressed)
@@ -8145,8 +8635,8 @@ fun! s:NetrwWideListing()
 "   call Decho("setl ma noro")
    let b:netrw_cpf= 0
    if line("$") >= w:netrw_bannercnt
-    exe 'sil keepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
-    keepj call histdel("/",-1)
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
+    NetrwKeepj call histdel("/",-1)
    else
 "    call Dret("NetrwWideListing")
     return
@@ -8162,8 +8652,8 @@ fun! s:NetrwWideListing()
 "   call Decho("fpl= [winwidth=".winwidth(0)."]/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
 
    " make wide display
-   exe 'sil keepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/'
-   keepj call histdel("/",-1)
+   exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",submatch(0)),"\\")/'
+   NetrwKeepj call histdel("/",-1)
    let fpc         = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl
    let newcolstart = w:netrw_bannercnt + fpc
    let newcolend   = newcolstart + fpc - 1
@@ -8176,20 +8666,20 @@ fun! s:NetrwWideListing()
     let newcolqty= newcolend - newcolstart
     exe newcolstart
     if newcolqty == 0
-     exe "sil! keepj norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
+     exe "sil! NetrwKeepj norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
     else
-     exe "sil! keepj norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
+     exe "sil! NetrwKeepj norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
     endif
-    exe "sil! keepj ".newcolstart.','.newcolend.'d'
-    exe 'sil! keepj '.w:netrw_bannercnt
+    exe "sil! NetrwKeepj ".newcolstart.','.newcolend.'d'
+    exe 'sil! NetrwKeepj '.w:netrw_bannercnt
    endwhile
    if has("clipboard")
     sil! let @*= keepregstar
    endif
-   exe "sil! keepj ".w:netrw_bannercnt.',$s/\s\+$//e'
-   keepj call histdel("/",-1)
-   exe "nmap <buffer> <silent> w	/^\\\\|\\s\\s\\zs\\S/\<cr>"
-   exe "nmap <buffer> <silent> b	?^\\\\|\\s\\s\\zs\\S?\<cr>"
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/\s\+$//e'
+   NetrwKeepj call histdel("/",-1)
+   exe 'nno <buffer> <silent> w	:call search(''^.\\|\s\s\zs\S'',''W'')'."\<cr>"
+   exe 'nno <buffer> <silent> b	:call search(''^.\\|\s\s\zs\S'',''bW'')'."\<cr>"
 "   call Decho("NetrwWideListing) setl noma nomod ro")
    exe "setl ".g:netrw_bufsettings
 "   call Decho("(NetrwWideListing) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -8213,18 +8703,10 @@ fun! s:PerformListing(islocal)
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (enter)")
 
   " set up syntax highlighting {{{3
-"  call Decho("set up syntax highlighting")
-  if has("syntax")
-   if !exists("g:syntax_on") || !g:syntax_on
-"    call Decho("but g:syntax_on".(exists("g:syntax_on")? "=".g:syntax_on : "<doesn't exist>"))
-    setl ft=
-   elseif &ft != "netrw"
-"    call Decho("setl ft=netrw")
-    setl ft=netrw
-   endif
-  endif
+"  call Decho("set up syntax highlighting (ie. setl ft=netrw)")
+  sil! setl ft=netrw
 
-  keepj call s:NetrwSafeOptions()
+  NetrwKeepj call s:NetrwSafeOptions()
   setl noro ma
 "  call Decho("setl noro ma bh=".&bh)
 
@@ -8236,26 +8718,26 @@ fun! s:PerformListing(islocal)
   if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
    " force a refresh for tree listings
 "   call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
-   sil! keepj %d
+   sil! NetrwKeepj %d
   endif
 
   " save current directory on directory history list
-  keepj call s:NetrwBookHistHandler(3,b:netrw_curdir)
+  NetrwKeepj call s:NetrwBookHistHandler(3,b:netrw_curdir)
 
   " Set up the banner {{{3
   if g:netrw_banner
 "   call Decho("set up banner")
-   keepj call setline(1,'" ============================================================================')
-   keepj call setline(2,'" Netrw Directory Listing                                        (netrw '.g:loaded_netrw.')')
+   NetrwKeepj call setline(1,'" ============================================================================')
+   NetrwKeepj call setline(2,'" Netrw Directory Listing                                        (netrw '.g:loaded_netrw.')')
    if exists("g:netrw_bannerbackslash") && g:netrw_bannerbackslash
-    keepj call setline(3,'"   '.substitute(b:netrw_curdir,'/','\\','g'))
+    NetrwKeepj call setline(3,'"   '.substitute(b:netrw_curdir,'/','\\','g'))
    else
-    keepj call setline(3,'"   '.b:netrw_curdir)
+    NetrwKeepj call setline(3,'"   '.b:netrw_curdir)
    endif
    let w:netrw_bannercnt= 3
-   keepj exe "sil! keepj ".w:netrw_bannercnt
+   NetrwKeepj exe "sil! NetrwKeepj ".w:netrw_bannercnt
   else
-   keepj 1
+   NetrwKeepj 1
    let w:netrw_bannercnt= 1
   endif
 "  call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." win#".winnr())
@@ -8271,16 +8753,16 @@ fun! s:PerformListing(islocal)
    if g:netrw_sort_by =~ "^n"
 "   call Decho("directories will be sorted by name")
     " sorted by name
-    keepj put ='\"   Sorted by      '.sortby
-    keepj put ='\"   Sort sequence: '.g:netrw_sort_sequence
+    NetrwKeepj put ='\"   Sorted by      '.sortby
+    NetrwKeepj put ='\"   Sort sequence: '.g:netrw_sort_sequence
     let w:netrw_bannercnt= w:netrw_bannercnt + 2
    else
 "   call Decho("directories will be sorted by size or time")
     " sorted by size or date
-    keepj put ='\"   Sorted by '.sortby
+    NetrwKeepj put ='\"   Sorted by '.sortby
     let w:netrw_bannercnt= w:netrw_bannercnt + 1
    endif
-   exe "sil! keepj ".w:netrw_bannercnt
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt
 "  else " Decho
 "   call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
   endif
@@ -8289,17 +8771,17 @@ fun! s:PerformListing(islocal)
   if g:netrw_banner
    if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal")
 "    call Decho("show copy/move target<".s:netrwmftgt.">")
-    keepj put =''
+    NetrwKeepj put =''
     if s:netrwmftgt_islocal
-     sil! keepj call setline(line("."),'"   Copy/Move Tgt: '.s:netrwmftgt.' (local)')
+     sil! NetrwKeepj call setline(line("."),'"   Copy/Move Tgt: '.s:netrwmftgt.' (local)')
     else
-     sil! keepj call setline(line("."),'"   Copy/Move Tgt: '.s:netrwmftgt.' (remote)')
+     sil! NetrwKeepj call setline(line("."),'"   Copy/Move Tgt: '.s:netrwmftgt.' (remote)')
     endif
     let w:netrw_bannercnt= w:netrw_bannercnt + 1
    else
 "    call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt")
    endif
-   exe "sil! keepj ".w:netrw_bannercnt
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt
   endif
 
   " Hiding...  -or-  Showing... {{{3
@@ -8307,20 +8789,20 @@ fun! s:PerformListing(islocal)
 "   call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)")
    if g:netrw_list_hide != "" && g:netrw_hide
     if g:netrw_hide == 1
-     keepj put ='\"   Hiding:        '.g:netrw_list_hide
+     NetrwKeepj put ='\"   Hiding:        '.g:netrw_list_hide
     else
-     keepj put ='\"   Showing:       '.g:netrw_list_hide
+     NetrwKeepj put ='\"   Showing:       '.g:netrw_list_hide
     endif
     let w:netrw_bannercnt= w:netrw_bannercnt + 1
    endif
-   exe "keepjumps ".w:netrw_bannercnt
+   exe "NetrwKeepj ".w:netrw_bannercnt
 
 "   call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
    let quickhelp   = g:netrw_quickhelp%len(s:QuickHelp)
 "   call Decho("quickhelp   =".quickhelp)
-   keepj put ='\"   Quick Help: <F1>:help  '.s:QuickHelp[quickhelp]
+   NetrwKeepj put ='\"   Quick Help: <F1>:help  '.s:QuickHelp[quickhelp]
 "   call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-   keepj put ='\" =============================================================================='
+   NetrwKeepj put ='\" =============================================================================='
    let w:netrw_bannercnt= w:netrw_bannercnt + 2
 "  else " Decho
 "   call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
@@ -8329,7 +8811,7 @@ fun! s:PerformListing(islocal)
   " bannercnt should index the line just after the banner
   if g:netrw_banner
    let w:netrw_bannercnt= w:netrw_bannercnt + 1
-   exe "sil! keepj ".w:netrw_bannercnt
+   exe "sil! NetrwKeepj ".w:netrw_bannercnt
 "   call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
 "  else " Decho
 "   call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")")
@@ -8338,9 +8820,9 @@ fun! s:PerformListing(islocal)
   " get list of files
 "  call Decho("Get list of files - islocal=".a:islocal)
   if a:islocal
-   keepj call s:LocalListing()
+   NetrwKeepj call s:LocalListing()
   else " remote
-   keepj let badresult= s:NetrwRemoteListing()
+   NetrwKeepj let badresult= s:NetrwRemoteListing()
    if badresult
 "    call Decho("w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
 "    call Dret("s:PerformListing : error detected by NetrwRemoteListing")
@@ -8359,49 +8841,49 @@ fun! s:PerformListing(islocal)
 "   call Decho("manipulate directory listing (hide)")
 "   call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
    if g:netrw_hide && g:netrw_list_hide != ""
-    keepj call s:NetrwListHide()
+    NetrwKeepj call s:NetrwListHide()
    endif
    if !g:netrw_banner || line("$") >= w:netrw_bannercnt
 "    call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">")
 
     if g:netrw_sort_by =~ "^n"
      " sort by name
-     keepj call s:NetrwSetSort()
+     NetrwKeepj call s:NetrwSetSort()
 
      if !g:netrw_banner || w:netrw_bannercnt < line("$")
 "      call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")")
       if g:netrw_sort_direction =~ 'n'
        " normal direction sorting
-       exe 'sil keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
+       exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
       else
        " reverse direction sorting
-       exe 'sil keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
+       exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
       endif
      endif
      " remove priority pattern prefix
 "     call Decho("remove priority pattern prefix")
-     exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e'
-     keepj call histdel("/",-1)
+     exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{3}'.g:netrw_sepchr.'//e'
+     NetrwKeepj call histdel("/",-1)
 
     elseif a:islocal
      if !g:netrw_banner || w:netrw_bannercnt < line("$")
 "      call Decho("g:netrw_sort_direction=".g:netrw_sort_direction)
       if g:netrw_sort_direction =~ 'n'
-"       call Decho('exe sil keepjumps '.w:netrw_bannercnt.',$sort')
-       exe 'sil! keepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
+"       call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort')
+       exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort'.' '.g:netrw_sort_options
       else
-"       call Decho('exe sil keepjumps '.w:netrw_bannercnt.',$sort!')
-       exe 'sil! keepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
+"       call Decho('exe sil NetrwKeepj '.w:netrw_bannercnt.',$sort!')
+       exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$sort!'.' '.g:netrw_sort_options
       endif
-     exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
-     keepj call histdel("/",-1)
+     exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
+     NetrwKeepj call histdel("/",-1)
      endif
     endif
 
    elseif g:netrw_sort_direction =~ 'r'
 "    call Decho('(s:PerformListing) reverse the sorted listing')
     if !g:netrw_banner || w:netrw_bannercnt < line('$')
-     exe 'sil! keepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt
+     exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$g/^/m '.w:netrw_bannercnt
      call histdel("/",-1)
     endif
    endif
@@ -8411,16 +8893,21 @@ fun! s:PerformListing(islocal)
   " convert to wide/tree listing {{{3
 "  call Decho("modify display if wide/tree listing style")
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#1)")
-  keepj call s:NetrwWideListing()
+  NetrwKeepj call s:NetrwWideListing()
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#2)")
-  keepj call s:NetrwTreeListing(b:netrw_curdir)
+  NetrwKeepj call s:NetrwTreeListing(b:netrw_curdir)
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#3)")
 
+  " resolve symbolic links if local and (thin or tree)
+  if a:islocal && (w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:TREELIST)
+    g/@$/call s:ShowLink()
+  endif
+
   if exists("w:netrw_bannercnt") && (line("$") > w:netrw_bannercnt || !g:netrw_banner)
    " place cursor on the top-left corner of the file listing
 "   call Decho("place cursor on top-left corner of file listing")
-   exe 'sil! keepj '.w:netrw_bannercnt
-   sil! keepj norm! 0
+   exe 'sil! NetrwKeepj '.w:netrw_bannercnt
+   sil! NetrwKeepj norm! 0
   endif
 
   " record previous current directory
@@ -8429,9 +8916,9 @@ fun! s:PerformListing(islocal)
 
   " save certain window-oriented variables into buffer-oriented variables {{{3
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#4)")
-  keepj call s:SetBufWinVars()
+  NetrwKeepj call s:SetBufWinVars()
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#5)")
-  keepj call s:NetrwOptionRestore("w:")
+  NetrwKeepj call s:NetrwOptionRestore("w:")
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#6)")
 
   " set display to netrw display settings
@@ -8445,7 +8932,7 @@ fun! s:PerformListing(islocal)
 
   if exists("s:treecurpos")
 "   call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo. " (internal#8)")
-   keepj call netrw#RestorePosn(s:treecurpos)
+   NetrwKeepj call netrw#RestorePosn(s:treecurpos)
    unlet s:treecurpos
   endif
 
@@ -8526,27 +9013,27 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
 
   " clear off any older non-banner lines	" {{{3
   " note that w:netrw_bannercnt indexes the line after the banner
-"  call Decho('exe sil! keepjumps '.w:netrw_bannercnt.",$d  (clear off old non-banner lines)")
-  exe "sil! keepjumps ".w:netrw_bannercnt.",$d"
+"  call Decho('exe sil! NetrwKeepj '.w:netrw_bannercnt.",$d  (clear off old non-banner lines)")
+  exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d"
 
   ".........................................
   if w:netrw_method == 2 || w:netrw_method == 5	" {{{3
    " ftp + <.netrc>:  Method #2
    if a:path != ""
-    keepj put ='cd \"'.a:path.'\"'
+    NetrwKeepj put ='cd \"'.a:path.'\"'
    endif
    if exists("g:netrw_ftpextracmd")
-    keepj put =g:netrw_ftpextracmd
+    NetrwKeepj put =g:netrw_ftpextracmd
 "    call Decho("filter input: ".getline('.'))
    endif
-   keepj call setline(line("$")+1,a:listcmd)
-"   exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+   NetrwKeepj call setline(line("$")+1,a:listcmd)
+"   exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
    if exists("g:netrw_port") && g:netrw_port != ""
 "    call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1))
-    exe s:netrw_silentxfer." keepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
+    exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)." ".shellescape(g:netrw_port,1)
    else
 "    call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1))
-    exe s:netrw_silentxfer." keepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
+    exe s:netrw_silentxfer." NetrwKeepj ".w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." -i ".shellescape(g:netrw_machine,1)
    endif
 
   ".........................................
@@ -8554,9 +9041,9 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
    " ftp + machine,id,passwd,filename:  Method #3
     setl ff=unix
     if exists("g:netrw_port") && g:netrw_port != ""
-     keepj put ='open '.g:netrw_machine.' '.g:netrw_port
+     NetrwKeepj put ='open '.g:netrw_machine.' '.g:netrw_port
     else
-     keepj put ='open '.g:netrw_machine
+     NetrwKeepj put ='open '.g:netrw_machine
     endif
 
     " handle userid and password
@@ -8567,23 +9054,23 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
     endif
     if exists("g:netrw_uid") && g:netrw_uid != ""
      if exists("g:netrw_ftp") && g:netrw_ftp == 1
-      keepj put =g:netrw_uid
+      NetrwKeepj put =g:netrw_uid
       if exists("s:netrw_passwd") && s:netrw_passwd != ""
-       keepj put ='\"'.s:netrw_passwd.'\"'
+       NetrwKeepj put ='\"'.s:netrw_passwd.'\"'
       endif
      elseif exists("s:netrw_passwd")
-      keepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+      NetrwKeepj put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
      endif
     endif
 
    if a:path != ""
-    keepj put ='cd \"'.a:path.'\"'
+    NetrwKeepj put ='cd \"'.a:path.'\"'
    endif
    if exists("g:netrw_ftpextracmd")
-    keepj put =g:netrw_ftpextracmd
+    NetrwKeepj put =g:netrw_ftpextracmd
 "    call Decho("filter input: ".getline('.'))
    endif
-   keepj call setline(line("$")+1,a:listcmd)
+   NetrwKeepj call setline(line("$")+1,a:listcmd)
 
    " perform ftp:
    " -i       : turns off interactive prompting from ftp
@@ -8591,11 +9078,10 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
    " -n  win32: quit being obnoxious about password
    if exists("w:netrw_bannercnt")
 "    exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
-"    call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
-    exe s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options
+    call s:NetrwExe(s:netrw_silentxfer.w:netrw_bannercnt.",$!".s:netrw_ftp_cmd." ".g:netrw_ftp_options)
 "   else " Decho
 "    call Decho("WARNING: w:netrw_bannercnt doesn't exist!")
-"    g/^./call Decho("SKIPPING ftp#".line(".").": ".getline(".")) " COMBAK
+"    g/^./call Decho("SKIPPING ftp#".line(".").": ".getline("."))
    endif
 
   ".........................................
@@ -8611,34 +9097,34 @@ fun! s:NetrwRemoteFtpCmd(path,listcmd)
 
   ".........................................
   else	" {{{3
-   keepj call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . bufname("%") . ">",23)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . bufname("%") . ">",23)
   endif
 
   " cleanup for Windows " {{{3
   if has("win32") || has("win95") || has("win64") || has("win16")
-   sil! keepj %s/\r$//e
-   keepj call histdel("/",-1)
+   sil! NetrwKeepj %s/\r$//e
+   NetrwKeepj call histdel("/",-1)
   endif
   if a:listcmd == "dir"
    " infer directory/link based on the file permission string
-   sil! keepj g/d\%([-r][-w][-x]\)\{3}/keepj s@$@/@e
-   sil! keepj g/l\%([-r][-w][-x]\)\{3}/keepj s/$/@/e
-   keepj call histdel("/",-1)
-   keepj call histdel("/",-1)
+   sil! NetrwKeepj g/d\%([-r][-w][-x]\)\{3}/NetrwKeepj s@$@/@e
+   sil! NetrwKeepj g/l\%([-r][-w][-x]\)\{3}/NetrwKeepj s/$/@/e
+   NetrwKeepj call histdel("/",-1)
+   NetrwKeepj call histdel("/",-1)
    if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
-    exe "sil! keepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
-    keepj call histdel("/",-1)
+    exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
+    NetrwKeepj call histdel("/",-1)
    endif
   endif
 
   " ftp's listing doesn't seem to include ./ or ../ " {{{3
   if !search('^\.\/$\|\s\.\/$','wn')
-   exe 'keepj '.w:netrw_bannercnt
-   keepj put ='./'
+   exe 'NetrwKeepj '.w:netrw_bannercnt
+   NetrwKeepj put ='./'
   endif
   if !search('^\.\.\/$\|\s\.\.\/$','wn')
-   exe 'keepj '.w:netrw_bannercnt
-   keepj put ='../'
+   exe 'NetrwKeepj '.w:netrw_bannercnt
+   NetrwKeepj put ='../'
   endif
 
   " restore settings " {{{3
@@ -8677,13 +9163,13 @@ fun! s:NetrwRemoteListing()
 "   call Decho("g:netrw_list_cmd<",(exists("g:netrw_list_cmd")? 'n/a' : "-empty-").">")
    if !exists("g:netrw_quiet")
     if g:netrw_list_cmd == ""
-     keepj call netrw#ErrorMsg(s:ERROR,"your g:netrw_list_cmd is empty; perhaps ".g:netrw_ssh_cmd." is not executable on your system",47)
+     NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your g:netrw_list_cmd is empty; perhaps ".g:netrw_ssh_cmd." is not executable on your system",47)
     else
-     keepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
+     NetrwKeepj call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
     endif
    endif
 
-   keepj call s:NetrwOptionRestore("w:")
+   NetrwKeepj call s:NetrwOptionRestore("w:")
 "   call Dret("s:NetrwRemoteListing -1")
    return -1
   endif  " (remote handling sanity check)
@@ -8706,7 +9192,7 @@ fun! s:NetrwRemoteListing()
    endif
 "   call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)")
    call s:NetrwRemoteFtpCmd(s:path,listcmd)
-"   exe "sil! keepalt keepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
+"   exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
 
    " report on missing file or directory messages
    if search('[Nn]o such file or directory\|Failed to change directory')
@@ -8716,7 +9202,7 @@ fun! s:NetrwRemoteListing()
      exe w:netrw_bannercnt.",$d"
      setl noma
     endif
-    keepj call s:NetrwOptionRestore("w:")
+    NetrwKeepj call s:NetrwOptionRestore("w:")
     call netrw#ErrorMsg(s:WARNING,mesg,96)
 "    call Dret("s:NetrwRemoteListing : -1")
     return -1
@@ -8725,41 +9211,41 @@ fun! s:NetrwRemoteListing()
    if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
     " shorten the listing
 "    call Decho("generate short listing")
-    exe "sil! keepalt keepj ".w:netrw_bannercnt
+    exe "sil! keepalt NetrwKeepj ".w:netrw_bannercnt
 
     " cleanup
     if g:netrw_ftp_browse_reject != ""
-     exe "sil! keepalt keepj g/".g:netrw_ftp_browse_reject."/keepj d"
-     keepj call histdel("/",-1)
+     exe "sil! keepalt NetrwKeepj g/".g:netrw_ftp_browse_reject."/NetrwKeepj d"
+     NetrwKeepj call histdel("/",-1)
     endif
-    sil! keepj %s/\r$//e
-    keepj call histdel("/",-1)
+    sil! NetrwKeepj %s/\r$//e
+    NetrwKeepj call histdel("/",-1)
 
     " if there's no ../ listed, then put ../ in
     let line1= line(".")
-    exe "sil! keepj ".w:netrw_bannercnt
+    exe "sil! NetrwKeepj ".w:netrw_bannercnt
     let line2= search('\.\.\/\%(\s\|$\)','cnW')
 "    call Decho("search(".'\.\.\/\%(\s\|$\)'."','cnW')=".line2."  w:netrw_bannercnt=".w:netrw_bannercnt)
     if line2 == 0
 "     call Decho("netrw is putting ../ into listing")
-     sil! keepj put='../'
+     sil! NetrwKeepj put='../'
     endif
-    exe "sil! keepj ".line1
-    sil! keepj norm! 0
+    exe "sil! NetrwKeepj ".line1
+    sil! NetrwKeepj norm! 0
 
 "    call Decho("line1=".line1." line2=".line2." line(.)=".line("."))
     if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
 "     call Decho("M$ ftp cleanup")
-     exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
-     keepj call histdel("/",-1)
+     exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
+     NetrwKeepj call histdel("/",-1)
     else " normal ftp cleanup
 "     call Decho("normal ftp cleanup")
-     exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
-     exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
-     exe "sil! keepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
-     keepj call histdel("/",-1)
-     keepj call histdel("/",-1)
-     keepj call histdel("/",-1)
+     exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
+     exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
+     exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
+     NetrwKeepj call histdel("/",-1)
+     NetrwKeepj call histdel("/",-1)
+     NetrwKeepj call histdel("/",-1)
     endif
    endif
 
@@ -8769,35 +9255,35 @@ fun! s:NetrwRemoteListing()
    let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
 "   call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)")
    if g:netrw_scp_cmd =~ '^pscp'
-"    call Decho("1: exe sil r! ".shellescape(listcmd.s:path, 1))
-    exe "sil! keepj r! ".listcmd.shellescape(s:path, 1)
+"    call Decho("1: exe r! ".shellescape(listcmd.s:path, 1))
+    exe "NetrwKeepj r! ".listcmd.shellescape(s:path, 1)
     " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like
-    sil! keepj g/^Listing directory/keepj d
-    sil! keepj g/^d[-rwx][-rwx][-rwx]/keepj s+$+/+e
-    sil! keepj g/^l[-rwx][-rwx][-rwx]/keepj s+$+@+e
-    keepj call histdel("/",-1)
-    keepj call histdel("/",-1)
-    keepj call histdel("/",-1)
+    sil! NetrwKeepj g/^Listing directory/NetrwKeepj d
+    sil! NetrwKeepj g/^d[-rwx][-rwx][-rwx]/NetrwKeepj s+$+/+e
+    sil! NetrwKeepj g/^l[-rwx][-rwx][-rwx]/NetrwKeepj s+$+@+e
+    NetrwKeepj call histdel("/",-1)
+    NetrwKeepj call histdel("/",-1)
+    NetrwKeepj call histdel("/",-1)
     if g:netrw_liststyle != s:LONGLIST
-     sil! keepj g/^[dlsp-][-rwx][-rwx][-rwx]/keepj s/^.*\s\(\S\+\)$/\1/e
-     keepj call histdel("/",-1)
+     sil! NetrwKeepj g/^[dlsp-][-rwx][-rwx][-rwx]/NetrwKeepj s/^.*\s\(\S\+\)$/\1/e
+     NetrwKeepj call histdel("/",-1)
     endif
    else
     if s:path == ""
-"     call Decho("2: exe sil r! ".listcmd)
-     exe "sil! keepj keepalt r! ".listcmd
+"     call Decho("2: exe r! ".listcmd)
+     exe "NetrwKeepj keepalt r! ".listcmd
     else
-"     call Decho("3: exe sil r! ".listcmd.' '.shellescape(fnameescape(s:path),1))
-     exe "sil! keepj keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1)
+"     call Decho("3: exe r! ".listcmd.' '.shellescape(fnameescape(s:path),1))
+     exe "NetrwKeepj keepalt r! ".listcmd.' '.shellescape(fnameescape(s:path),1)
 "     call Decho("listcmd<".listcmd."> path<".s:path.">")
     endif
    endif
 
    " cleanup
    if g:netrw_ssh_browse_reject != ""
-"    call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/keepjumps d")
-    exe "sil! g/".g:netrw_ssh_browse_reject."/keepj d"
-    keepj call histdel("/",-1)
+"    call Decho("cleanup: exe sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d")
+    exe "sil! g/".g:netrw_ssh_browse_reject."/NetrwKeepj d"
+    NetrwKeepj call histdel("/",-1)
    endif
   endif
 
@@ -8807,40 +9293,40 @@ fun! s:NetrwRemoteListing()
 
    if s:method == "ftp"
     " cleanup
-    exe "sil! keepj ".w:netrw_bannercnt
+    exe "sil! NetrwKeepj ".w:netrw_bannercnt
     while getline('.') =~ g:netrw_ftp_browse_reject
-     sil! keepj d
+     sil! NetrwKeepj d
     endwhile
     " if there's no ../ listed, then put ../ in
     let line1= line(".")
-    sil! keepj 1
-    sil! keepj call search('^\.\.\/\%(\s\|$\)','W')
+    sil! NetrwKeepj 1
+    sil! NetrwKeepj call search('^\.\.\/\%(\s\|$\)','W')
     let line2= line(".")
     if line2 == 0
      if b:netrw_curdir != '/'
-      exe 'sil! keepj '.w:netrw_bannercnt."put='../'"
+      exe 'sil! NetrwKeepj '.w:netrw_bannercnt."put='../'"
      endif
     endif
-    exe "sil! keepj ".line1
-    sil! keepj norm! 0
+    exe "sil! NetrwKeepj ".line1
+    sil! NetrwKeepj norm! 0
    endif
 
    if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
 "    call Decho("M$ ftp site listing cleanup")
-    exe 'sil! keepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
+    exe 'sil! NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
    elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$")
 "    call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
-    exe 'sil keepj '.w:netrw_bannercnt.',$s/ -> .*$//e'
-    exe 'sil keepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
-    exe 'sil keepj '.w:netrw_bannercnt
-    keepj call histdel("/",-1)
-    keepj call histdel("/",-1)
-    keepj call histdel("/",-1)
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/ -> .*$//e'
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
+    exe 'sil NetrwKeepj '.w:netrw_bannercnt
+    NetrwKeepj call histdel("/",-1)
+    NetrwKeepj call histdel("/",-1)
+    NetrwKeepj call histdel("/",-1)
    endif
   endif
 
 "  if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho
-"   exe "keepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
+"   exe "NetrwKeepj ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
 "  endif " Decho
 
 "  call Dret("s:NetrwRemoteListing 0")
@@ -8877,7 +9363,7 @@ fun! s:NetrwRemoteRm(usrhost,path) range
 
    " remove multiple files and directories
    while ctr <= a:lastline
-    exe "keepj ".ctr
+    exe "NetrwKeepj ".ctr
     let ok= s:NetrwRemoteRmFile(a:path,s:NetrwGetWord(),all)
     if ok =~ 'q\%[uit]'
      break
@@ -8890,8 +9376,8 @@ fun! s:NetrwRemoteRm(usrhost,path) range
 
   " refresh the (remote) directory listing
 "  call Decho("refresh remote directory listing")
-  keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
 
 "  call Dret("s:NetrwRemoteRm")
 endfun
@@ -8931,14 +9417,14 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
      if path =~ '^\a\+://'
       let path= substitute(path,'^\a\+://[^/]\+/','','')
      endif
-     sil! keepj .,$d
+     sil! NetrwKeepj .,$d
      call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"')
     else
 "     call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">")
      let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd)
 "     call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
      if !exists("b:netrw_curdir")
-      keepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+      NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
       let ok="q"
      else
       let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
@@ -8953,7 +9439,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
 "      call Decho("call system(".netrw_rm_cmd.")")
       let ret= system(netrw_rm_cmd)
       if ret != 0
-       keepj call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
+       NetrwKeepj call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
       endif
 "      call Decho("returned=".ret." errcode=".v:shell_error)
      endif
@@ -8980,7 +9466,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
 
    if all || ok =~ 'y\%[es]' || ok == ""
     if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
-     keepj call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
+     NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
     else
      let rmfile          = substitute(a:path.a:rmfile,'/$','','')
      let netrw_rmdir_cmd = s:MakeSshCmd(netrw#WinPath(g:netrw_rmdir_cmd)).' '.shellescape(netrw#WinPath(rmfile))
@@ -8996,7 +9482,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all)
 "      call Decho("returned=".ret." errcode=".v:shell_error)
 
       if v:shell_error != 0 && !exists("g:netrw_quiet")
-      	keepj call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
+      	NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
       endif
      endif
     endif
@@ -9040,7 +9526,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range
     endif
    
     if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
-     keepj call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
+     NetrwKeepj call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
     else
      let oldname= shellescape(a:path.oldname)
      let newname= shellescape(a:path.newname)
@@ -9055,7 +9541,7 @@ fun! s:NetrwRemoteRename(usrhost,path) range
 
   " attempt to rename files/directories
    while ctr <= a:lastline
-    exe "keepj ".ctr
+    exe "NetrwKeepj ".ctr
 
     let oldname= s:NetrwGetWord()
 "   call Decho("oldname<".oldname.">")
@@ -9078,8 +9564,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range
   endif
 
   " refresh the directory
-  keepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
 
 "  call Dret("NetrwRemoteRename")
 endfun
@@ -9127,10 +9613,10 @@ fun! netrw#FileUrlRead(fname)
 "  call Decho("fname2396<".fname2396.">")
 "  call Decho("plainfname<".plainfname.">")
   exe "sil doau BufReadPre ".fname2396e
-  exe 'keepj r '.plainfname
+  exe 'NetrwKeepj r '.plainfname
   exe 'sil! bdelete '.plainfname
   exe 'keepalt file! '.plainfname
-  keepj 1d
+  NetrwKeepj 1d
 "  call Decho("setl nomod")
   setl nomod
 "  call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
@@ -9152,26 +9638,28 @@ fun! netrw#LocalBrowseCheck(dirname)
 "  call Decho("isdir<".a:dirname.">=".isdirectory(a:dirname).((exists("s:treeforceredraw")? " treeforceredraw" : "")))
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
 "  call Dredir("ls!","ls!")
+  norm! m`
 
   let ykeep= @@
   if isdirectory(a:dirname)
 "   call Decho("is-directory ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$")." ft<".&ft."> g:netrw_fastbrowse=".g:netrw_fastbrowse)
    let svposn= netrw#SavePosn()
+
    if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname) || g:netrw_fastbrowse <= 1
 "    call Decho("case 1 : ft=".&ft)
-    sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
-    keepalt call netrw#RestorePosn(svposn)
+    sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+    NetrwKeepj keepalt call netrw#RestorePosn(svposn)
 
    elseif &ft == "netrw" && line("$") == 1
 "    call Decho("case 2 (ft≡netrw && line($)≡1)")
-    sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
-    keepalt call netrw#RestorePosn(svposn)
+    sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+    NetrwKeepj keepalt call netrw#RestorePosn(svposn)
 
    elseif exists("s:treeforceredraw")
 "    call Decho("case 3 (treeforceredraw)")
     unlet s:treeforceredraw
-    sil! keepj keepalt call s:NetrwBrowse(1,a:dirname)
-    keepalt call netrw#RestorePosn(svposn)
+    sil! NetrwKeepj keepalt call s:NetrwBrowse(1,a:dirname)
+    NetrwKeepj keepalt call netrw#RestorePosn(svposn)
    endif
 
 "   call Dret("netrw#LocalBrowseCheck")
@@ -9257,7 +9745,7 @@ fun! s:LocalBrowseRefresh()
      let g:netrw_quickhelp= g:netrw_quickhelp - 1
     endif
 "    call Decho("#3: quickhelp=".g:netrw_quickhelp)
-    keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+    NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
    endif
    let ibl= ibl + 1
   endfor
@@ -9353,7 +9841,7 @@ fun! s:LocalListing()
   let dirnamelen = strlen(b:netrw_curdir)
   let filelist   = glob(s:ComposePath(dirname,"*"),0,1)
   let filelist   = filelist + glob(s:ComposePath(dirname,".*"),0,1)
-"  call Decho("filelist=".filelist)
+"  call Decho("filelist=".string(filelist))
 
   if g:netrw_cygwin == 0 && (has("win32") || has("win95") || has("win64") || has("win16"))
 "   call Decho("filelist=".string(filelist))
@@ -9446,29 +9934,29 @@ fun! s:LocalListing()
 "    call Decho("getftime(".filename.")=".getftime(filename))
     let t  = getftime(filename)
     let ft = strpart("000000000000000000",1,18-strlen(t)).t
-"    call Decho("exe keepjumps put ='".ft.'/'.filename."'")
+"    call Decho("exe NetrwKeepj put ='".ft.'/'.filename."'")
     let ftpfile= ft.'/'.pfile
-    sil! keepj put=ftpfile
+    sil! NetrwKeepj put=ftpfile
 
    elseif g:netrw_sort_by =~ "^s"
     " sort by size (handles file sizes up to 1 quintillion bytes, US)
 "    call Decho("getfsize(".filename.")=".getfsize(filename))
     let sz   = getfsize(filename)
     let fsz  = strpart("000000000000000000",1,18-strlen(sz)).sz
-"    call Decho("exe keepj put ='".fsz.'/'.filename."'")
+"    call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'")
     let fszpfile= fsz.'/'.pfile
-    sil! keepj put =fszpfile
+    sil! NetrwKeepj put =fszpfile
 
    else
     " sort by name
-"    call Decho("exe keepjumps put ='".pfile."'")
-    sil! keepj put=pfile
+"    call Decho("exe NetrwKeepj put ='".pfile."'")
+    sil! NetrwKeepj put=pfile
    endif
   endfor
 
   " cleanup any windows mess at end-of-line
-  sil! keepj g/^$/d
-  sil! keepj %s/\r$//e
+  sil! NetrwKeepj g/^$/d
+  sil! NetrwKeepj %s/\r$//e
   call histdel("/",-1)
 "  call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1))
   exe "setl ts=".(g:netrw_maxfilenamelen+1)
@@ -9505,7 +9993,7 @@ fun! s:NetrwLocalExecute(cmd)
 endfun
 
 " ---------------------------------------------------------------------
-" s:NetrwLocalRename: rename a remote file or directory {{{2
+" s:NetrwLocalRename: rename a local file or directory {{{2
 fun! s:NetrwLocalRename(path) range
 "  call Dfunc("NetrwLocalRename(path<".a:path.">)")
 
@@ -9540,7 +10028,7 @@ fun! s:NetrwLocalRename(path) range
 
    " attempt to rename files/directories
    while ctr <= a:lastline
-    exe "keepj ".ctr
+    exe "NetrwKeepj ".ctr
 
     " sanity checks
     if line(".") < w:netrw_bannercnt
@@ -9553,7 +10041,7 @@ fun! s:NetrwLocalRename(path) range
      continue
     endif
 
-    keepj norm! 0
+    NetrwKeepj norm! 0
     let oldname= s:ComposePath(a:path,curword)
 "   call Decho("oldname<".oldname.">")
 
@@ -9570,8 +10058,8 @@ fun! s:NetrwLocalRename(path) range
 
   " refresh the directory
 "  call Decho("refresh the directory listing")
-  keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
-  keepj call netrw#RestorePosn(svpos)
+  NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+  NetrwKeepj call netrw#RestorePosn(svpos)
   let @@= ykeep
 
 "  call Dret("NetrwLocalRename")
@@ -9608,7 +10096,7 @@ fun! s:NetrwLocalRm(path) range
 
    let ctr = a:firstline
    while ctr <= a:lastline
-    exe "keepj ".ctr
+    exe "NetrwKeepj ".ctr
 
     " sanity checks
     if line(".") < w:netrw_bannercnt
@@ -9633,8 +10121,8 @@ fun! s:NetrwLocalRm(path) range
   " refresh the directory
 "  call Decho("bufname<".bufname("%").">")
   if bufname("%") != "NetrwMessage"
-   keepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
-   keepj call netrw#RestorePosn(svpos)
+   NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+   NetrwKeepj call netrw#RestorePosn(svpos)
   endif
   let @@= ykeep
 
@@ -9649,7 +10137,7 @@ fun! s:NetrwLocalRmFile(path,fname,all)
   
   let all= a:all
   let ok = ""
-  keepj norm! 0
+  NetrwKeepj norm! 0
   let rmfile= s:ComposePath(a:path,a:fname)
 "  call Decho("rmfile<".rmfile.">")
 
@@ -9745,7 +10233,7 @@ fun! netrw#Access(ilist)
 endfun
 
 " ------------------------------------------------------------------------
-" netrw#RestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2
+" netrw#RestorePosn: restores the cursor and file position as saved by netrw#SavePosn() {{{2
 fun! netrw#RestorePosn(...)
 "  call Dfunc("netrw#RestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1))
   let eikeep= &ei
@@ -9759,60 +10247,60 @@ fun! netrw#RestorePosn(...)
   if a:0 > 0
    exe "keepj ".a:1
   endif
-"  call Decho("a:1             = ".((a:0 > 0)?              a:1       : 'n/a'))
-"  call Decho("liststyle       = ".(exists("liststyle")?    liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+"  "call Decho("a:1             = ".((a:0 > 0)?              a:1       : 'n/a'))
+"  "call Decho("liststyle       = ".(exists("liststyle")?    liststyle : 'n/a'). " w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
   if exists("liststyle") && exists("w:netrw_liststyle") && liststyle != w:netrw_liststyle
    let usesrch= 1
   else
    let usesrch= 0
   endif
 
-"  call Decho("winh            = ".(exists("w:netrw_winh")?    w:netrw_winh    : -1))
-"  call Decho("winw            = ".(exists("w:netrw_winw")?    w:netrw_winw    : -1))
-"  call Decho("cur    winheight=".winheight(0)." winwidth=".winwidth(0))
-"  call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
+"  "call Decho("winh            = ".(exists("w:netrw_winh")?    w:netrw_winh    : -1))
+"  "call Decho("winw            = ".(exists("w:netrw_winw")?    w:netrw_winw    : -1))
+"  "call Decho("cur    winheight=".winheight(0)." winwidth=".winwidth(0))
+"  "call Decho("w:netrw_winfile = ".(exists("w:netrw_winfile")? w:netrw_winfile : 'n/a'))
 
   " restore window
   if exists("w:netrw_winnr")
-"   call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w")
+"   "call Decho("restore window: exe sil! ".w:netrw_winnr."wincmd w")
    exe "sil! ".w:netrw_winnr."wincmd w"
   endif
-  if v:shell_error == 0
+"  if v:shell_error == 0
    " as suggested by Bram M: redraw on no error
    " allows protocol error messages to remain visible
 "   redraw!
-  endif
+"  endif
 
   " restore top-of-screen line
   if exists("w:netrw_hline")
-"   call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z")
+"   "call Decho("restore topofscreen: exe keepj norm! ".w:netrw_hline."G0z")
    exe "keepj norm! ".w:netrw_hline."G0z\<CR>"
   endif
 
   " restore position
   " when the window's height x width has changed, the line,col is no longer useful
   if w:netrw_winh == winheight(0) && w:netrw_winw == winwidth(0) && exists("w:netrw_line") && exists("w:netrw_col") && !usesrch
-"   call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
+"   "call Decho("using posn: exe keepj norm! ".w:netrw_line."G0".w:netrw_col."|")
    exe "keepj norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
 
   elseif exists("w:netrw_winfile")
    if !search('\<'.escape(w:netrw_winfile,g:netrw_fname_escape),'cw')
     if exists("w:netrw_bannercnt")
-"     call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+"     "call Decho("using bannercnt: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
      exe "keepj ".w:netrw_bannercnt
      norm! 0
     else
      " go to upper left corner
-"     call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
+"     "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0)." w:netrw_winfile<".w:netrw_winfile.">")
      keepj 1
      norm! 0
     endif
    else
-"    call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
+"    "call Decho("used search: w:netrw_winfile<".w:netrw_winfile.">")
    endif
 
   else
-"   call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
+"   "call Decho("goto ulc: win#".winnr()." ".winheight(0)."x".winwidth(0))
    keepj 1
    norm! 0
   endif
@@ -9838,22 +10326,22 @@ fun! netrw#SavePosn()
   let w:netrw_winnr= winnr()
   let w:netrw_line = line(".")
   let w:netrw_col  = virtcol(".")
-"  call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
+"  "call Decho("currently, win#".w:netrw_winnr." line#".w:netrw_line." col#".w:netrw_col)
 
   " save filename under cursor
-"  call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
+"  "call Decho("line#".line(".")." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a'))
   if exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt && &ft == "netrw"
-   let winfile = "|let w:netrw_winfile='".s:NetrwGetWord()."'"
+   let winfile = "|let w:netrw_winfile=\"".fnameescape(s:NetrwGetWord())."\""
   else
    let winfile= ""
   endif
-"  call Decho("winfile<".winfile.">")
+"  "call Decho("winfile<".winfile.">")
   if exists("w:netrw_liststyle")
    let liststyle = "|let liststyle=".w:netrw_liststyle
   else
    let liststyle= ""
   endif
-"  call Decho("liststyle=".liststyle)
+"  "call Decho("liststyle=".liststyle)
 
   " Save top-of-screen line
   keepj norm! H0
@@ -9950,6 +10438,33 @@ fun! s:ComposePath(base,subdir)
   return ret
 endfun
 
+" ---------------------------------------------------------------------
+" s:DeleteBookmark: deletes a file/directory from Netrw's bookmark system {{{2
+"   Related Functions: s:MakeBookmark() s:NetrwBookHistHandler() s:NetrwBookmark()
+fun! s:DeleteBookmark(fname)
+"  call Dfunc("s:DeleteBookmark(fname<".a:fname.">)")
+  call s:MergeBookmarks()
+
+  if exists("g:netrw_bookmarklist")
+   let indx= index(g:netrw_bookmarklist,a:fname)
+   if indx == -1
+    let indx= 0
+    while indx < len(g:netrw_bookmarklist)
+     if g:netrw_bookmarklist[indx] =~ a:fname
+      call remove(g:netrw_bookmarklist,indx)
+      let indx= indx - 1
+     endif
+     let indx= indx + 1
+    endwhile
+   else
+    " remove exact match
+    call remove(g:netrw_bookmarklist,indx)
+   endif
+  endif
+
+"  call Dret("s:DeleteBookmark")
+endfun
+
 " ---------------------------------------------------------------------
 " s:FileReadable: o/s independent filereadable {{{2
 fun! s:FileReadable(fname)
@@ -9983,13 +10498,13 @@ fun! s:GetTempfile(fname)
    " sanity check -- does the temporary file's directory exist?
    if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
 "    call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)")
-    keepj call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
+    NetrwKeepj call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
 "    call Dret("s:GetTempfile getcwd<".getcwd().">")
     return ""
    endif
 
    " let netrw#NetSource() know about the tmpfile
-   let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#NetrwBrowseX()
+   let s:netrw_tmpfile= tmpfile " used by netrw#NetSource() and netrw#BrowseX()
 "   call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">")
 
    " o/s dependencies
@@ -10056,6 +10571,45 @@ fun! s:MakeSshCmd(sshcmd)
   return sshcmd
 endfun
 
+" ---------------------------------------------------------------------
+" s:MakeBookmark: enters a bookmark into Netrw's bookmark system   {{{2
+fun! s:MakeBookmark(fname)
+"  call Dfunc("s:MakeBookmark(fname<".a:fname.">)")
+
+  if !exists("g:netrw_bookmarklist")
+   let g:netrw_bookmarklist= []
+  endif
+
+  if index(g:netrw_bookmarklist,a:fname) == -1
+   " curdir not currently in g:netrw_bookmarklist, so include it
+   if isdirectory(a:fname) && a:fname !~ '/$'
+    call add(g:netrw_bookmarklist,a:fname.'/')
+   elseif a:fname !~ '/'
+    call add(g:netrw_bookmarklist,getcwd()."/".a:fname)
+   else
+    call add(g:netrw_bookmarklist,a:fname)
+   endif
+   call sort(g:netrw_bookmarklist)
+  endif
+
+"  call Dret("s:MakeBookmark")
+endfun
+
+" ---------------------------------------------------------------------
+" s:MergeBookmarks: merge current bookmarks with saved bookmarks {{{2
+fun! s:MergeBookmarks()
+"  call Dfunc("s:MergeBookmarks()")
+  " get bookmarks from .netrwbook file
+  let savefile= s:NetrwHome()."/.netrwbook"
+  if filereadable(savefile)
+"   call Decho("merge bookmarks (active and file)")
+   NetrwKeepj call s:NetrwBookHistSave()
+"   call Decho("bookmark delete savefile<".savefile.">")
+   NetrwKeepj call delete(savefile)
+  endif
+"  call Dret("s:MergeBookmarks")
+endfun
+
 " ---------------------------------------------------------------------
 " s:NetrwBMShow: {{{2
 fun! s:NetrwBMShow()
@@ -10069,7 +10623,7 @@ fun! s:NetrwBMShow()
    if bmshowfuncs != []
     let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','')
     if bmshowfunc =~ '^call.*BMShow()'
-     exe "sil! keepj ".bmshowfunc
+     exe "sil! NetrwKeepj ".bmshowfunc
     endif
    endif
   endif
@@ -10176,7 +10730,7 @@ fun! s:NetrwDelete(path)
    let result= delete(path)
   endif
   if result < 0
-   keepj call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71)
+   NetrwKeepj call netrw#ErrorMsg(s:WARNING,"delete(".path.") failed!",71)
   endif
 
 "  call Dret("s:NetrwDelete ".result)
@@ -10208,13 +10762,13 @@ fun! s:NetrwEnew(...)
   if exists("b:netrw_option")         |let netrw_option          = b:netrw_option         |endif
   if exists("b:netrw_prvdir")         |let netrw_prvdir          = b:netrw_prvdir         |endif
 
-  keepj call s:NetrwOptionRestore("w:")
-"  call Decho("generate a buffer with keepjumps keepalt enew!")
+  NetrwKeepj call s:NetrwOptionRestore("w:")
+"  call Decho("generate a buffer with NetrwKeepj keepalt enew!")
   let netrw_keepdiff= &l:diff
-  noswapfile keepj keepalt enew!
+  noswapfile NetrwKeepj keepalt enew!
   let &l:diff= netrw_keepdiff
 "  call Decho("bufnr($)=".bufnr("$")." winnr($)=".winnr("$"))
-  keepj call s:NetrwOptionSave("w:")
+  NetrwKeepj call s:NetrwOptionSave("w:")
 
   " copy function-local-variables to buffer variable equivalents
 "  call Decho("copy function-local variables back to buffer netrw variables")
@@ -10252,6 +10806,22 @@ fun! s:NetrwEnew(...)
 "  call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#")."> bh=".&bh." win#".winnr()." winnr($)#".winnr("$"))
 endfun
 
+" ---------------------------------------------------------------------
+" s:NetrwExe: executes a string using "!" {{{2
+fun! s:NetrwExe(cmd)
+"  call Dfunc("s:NetrwExe(a:cmd)")
+  if has("win32") && &shell !~? 'cmd' && !g:netrw_cygwin
+    let savedShell=[&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash]
+    set shell& shellcmdflag& shellxquote& shellxescape&
+    set shellquote& shellpipe& shellredir& shellslash&
+    exe a:cmd
+    let [&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash] = savedShell
+  else
+   exe a:cmd
+  endif
+"  call Dret("s:NetrwExe")
+endfun
+
 " ---------------------------------------------------------------------
 " s:NetrwInsureWinVars: insure that a netrw buffer has its w: variables in spite of a wincmd v or s {{{2
 fun! s:NetrwInsureWinVars()
@@ -10286,7 +10856,7 @@ fun! s:NetrwLcd(newdir)
 "  call Dfunc("s:NetrwLcd(newdir<".a:newdir.">)")
 
   try
-   exe 'keepj sil lcd '.fnameescape(a:newdir)
+   exe 'NetrwKeepj sil lcd '.fnameescape(a:newdir)
   catch /^Vim\%((\a\+)\)\=:E344/
      " Vim's lcd fails with E344 when attempting to go above the 'root' of a Windows share.
      " Therefore, detect if a Windows share is present, and if E344 occurs, just settle at
@@ -10296,7 +10866,7 @@ fun! s:NetrwLcd(newdir)
      if (has("win32") || has("win95") || has("win64") || has("win16")) && !g:netrw_cygwin
        if a:newdir =~ '^\\\\\w\+' || a:newdir =~ '^//\w\+'
          let dirname = '\'
-	 exe 'keepj sil lcd '.fnameescape(dirname)
+	 exe 'NetrwKeepj sil lcd '.fnameescape(dirname)
        endif
      endif
   catch /^Vim\%((\a\+)\)\=:E472/
@@ -10388,9 +10958,9 @@ endfun
 fun! s:RemoteSystem(cmd)
 "  call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)")
   if !executable(g:netrw_ssh_cmd)
-   keepj call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52)
   elseif !exists("b:netrw_curdir")
-   keepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+   NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
   else
    let cmd      = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME")
    let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
@@ -10447,13 +11017,21 @@ fun! s:NetrwRexplore(islocal,dirname)
 "  call Decho("ft=".&ft." win#".winnr()." w:netrw_rexfile<".(exists("w:netrw_rexfile")? w:netrw_rexfile : 'n/a').">")
 
   if &ft == "netrw" && exists("w:netrw_rexfile") && w:netrw_rexfile != ""
+   " a :Rex while in a netrw buffer means: edit the file in w:netrw_rexfile
 "   call Decho("in netrw buffer, will edit file<".w:netrw_rexfile.">")
-   exe "e ".w:netrw_rexfile
+   exe "NetrwKeepj e ".w:netrw_rexfile
    unlet w:netrw_rexfile
 "   call Dret("s:NetrwRexplore returning from netrw to buf#".bufnr("%")."<".bufname("%").">  (ft=".&ft.")")
    return
+"  else " Decho
+"   call Decho("treating as not-netrw-buffer: ft=".&ft.((&ft == "netrw")? " == netrw" : "!= netrw"))
+"   call Decho("treating as not-netrw-buffer: w:netrw_rexfile<".((exists("w:netrw_rexfile"))? w:netrw_rexfile : 'n/a').">")
   endif
 
+  " ---------------------------
+  " :Rex issued while in a file
+  " ---------------------------
+
   " record current file so :Rex can return to it from netrw
   let w:netrw_rexfile= expand("%")
 
@@ -10463,16 +11041,26 @@ fun! s:NetrwRexplore(islocal,dirname)
   endif
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo)
   if w:netrw_rexlocal
-   keepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
-  else
+   if g:netrw_keepj =~ "keepj"
+    keepj call netrw#LocalBrowseCheck(w:netrw_rexdir)
+   else
+    call netrw#LocalBrowseCheck(w:netrw_rexdir)
+   endif
+  elseif g:netrw_keepj =~ "keepj"
    keepj call s:NetrwBrowse(0,w:netrw_rexdir)
+  else
+   call s:NetrwBrowse(0,w:netrw_rexdir)
   endif
   if exists("s:initbeval")
    setl beval
   endif
   if exists("s:rexposn_".bufnr("%"))
 "   call Decho("restore posn, then unlet s:rexposn_".bufnr('%'))
-   keepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+   if g:netrw_keepj =~ "keepj"
+    keepj call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+   else
+    call netrw#RestorePosn(s:rexposn_{bufnr('%')})
+   endif
    unlet s:rexposn_{bufnr('%')}
   else
 "   call Decho("s:rexposn_".bufnr('%')." doesn't exist")
@@ -10558,6 +11146,54 @@ fun! s:SetRexDir(islocal,dirname)
 "  call Dret("s:SetRexDir : win#".winnr()." ".(a:islocal? "local" : "remote")." dir: ".a:dirname)
 endfun
 
+" ---------------------------------------------------------------------
+" s:ShowLink: used to modify thin and tree listings to show links {{{2
+fun! s:ShowLink()
+" "  call Dfunc("s:ShowLink()")
+" "  call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
+" "  call Decho(printf("line#%4d: %s",line("."),getline(".")))
+  if exists("b:netrw_curdir")
+   norm! $?\a
+   let fname   = b:netrw_curdir.'/'.s:NetrwGetWord()
+   let resname = resolve(fname)
+   if resname =~ '^\M'.b:netrw_curdir
+    let dirlen  = strlen(b:netrw_curdir)
+    let resname = strpart(resname,dirlen+1)
+" "    call Decho("resname<".resname.">  (b:netrw_curdir elided)")
+" "   else " Decho
+" "    call Decho("resname<".fname.">")
+   endif
+   let modline = getline(".")."\t --> ".resname
+" "   call Decho("fname  <".fname.">")
+" "   call Decho("modline<".modline.">")
+   setl noro ma
+   call setline(".",modline)
+   setl ro noma nomod
+  endif
+" "  call Dret("s:ShowLink".((exists("fname")? ' : '.fname : 'n/a')))
+endfun
+
+" ---------------------------------------------------------------------
+" s:ShowStyle: {{{2
+fun! s:ShowStyle()
+  if !exists("w:netrw_liststyle")
+   let liststyle= g:netrw_liststyle
+  else
+   let liststyle= w:netrw_liststyle
+  endif
+  if     liststyle == s:THINLIST
+   return s:THINLIST.":thin"
+  elseif liststyle == s:LONGLIST
+   return s:LONGLIST.":long"
+  elseif liststyle == s:WIDELIST
+   return s:WIDELIST.":wide"
+  elseif liststyle == s:TREELIST
+   return s:TREELIST.":tree"
+  else
+   return 'n/a'
+  endif
+endfun
+
 " ---------------------------------------------------------------------
 " s:Strlen: this function returns the length of a string, even if its using multi-byte characters. {{{2
 "           Solution from Nicolai Weibull, vim docs (:help strlen()),
@@ -10593,7 +11229,7 @@ fun! s:Strlen(x)
    call setline(line("."),a:x)
    let ret= virtcol("$") - 1
    d
-   keepj norm! k
+   NetrwKeepj norm! k
    let &l:mod= modkeep
  
   else
@@ -10622,17 +11258,17 @@ fun! s:TreeListMove(dir)
   if curline !~ '/$'
 "   call Decho('regfile')
    if     a:dir == '[' && prvline != ''
-    keepj norm! 0
+    NetrwKeepj norm! 0
     let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','bWe')    " search backwards from regular file
 "    call Decho("regfile srch back: ".nl)
    elseif a:dir == ']' && nxtline != ''
-    keepj norm! $
+    NetrwKeepj norm! $
     let nl = search('^'.indentm1.'[^'.s:treedepthstring.']','We')     " search forwards from regular file
 "    call Decho("regfile srch fwd: ".nl)
    endif
 
   elseif a:dir == '[' && prvline != ''
-   keepj norm! 0
+   NetrwKeepj norm! 0
    let curline= line(".")
    let nl     = search('^'.curindent.'[^'.s:treedepthstring.']','bWe') " search backwards From directory, same indentation
 "   call Decho("dir srch back ind: ".nl)
@@ -10644,7 +11280,7 @@ fun! s:TreeListMove(dir)
    endif
 
   elseif a:dir == ']' && nxtline != ''
-   keepj norm! $
+   NetrwKeepj norm! $
    let curline = line(".")
    let nl      = search('^'.curindent.'[^'.s:treedepthstring.']','We') " search forwards from directory, same indentation
 "   call Decho("dir srch fwd ind: ".nl)
@@ -10672,7 +11308,7 @@ fun! s:UpdateBuffersMenu()
     sil emenu Buffers.Refresh\ menu
    catch /^Vim\%((\a\+)\)\=:E/
     let v:errmsg= ""
-    sil keepj call s:NetrwBMShow()
+    sil NetrwKeepj call s:NetrwBMShow()
    endtry
   endif
 "  call Dret("s:UpdateBuffersMenu")
diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim
index 541ee65ccb..4639909ee8 100644
--- a/runtime/autoload/netrwSettings.vim
+++ b/runtime/autoload/netrwSettings.vim
@@ -1,7 +1,7 @@
 " netrwSettings.vim: makes netrw settings simpler
-" Date:		Aug 27, 2013
+" Date:		Dec 30, 2014
 " Maintainer:	Charles E Campbell <drchipNOSPAM at campbellfamily dot biz>
-" Version:	14
+" Version:	15
 " Copyright:    Copyright (C) 1999-2007 Charles E. Campbell {{{1
 "               Permission is hereby granted to use and distribute this code,
 "               with or without modifications, provided that this copyright
@@ -19,7 +19,7 @@
 if exists("g:loaded_netrwSettings") || &cp
   finish
 endif
-let g:loaded_netrwSettings = "v14"
+let g:loaded_netrwSettings = "v15"
 if v:version < 700
  echohl WarningMsg
  echo "***warning*** this version of netrwSettings needs vim 7.0"
@@ -31,7 +31,7 @@ endif
 " NetrwSettings: {{{1
 fun! netrwSettings#NetrwSettings()
   " this call is here largely just to insure that netrw has been loaded
-  call netrw#NetrwSavePosn()
+  call netrw#SavePosn()
   if !exists("g:loaded_netrw")
    echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
    return
@@ -177,6 +177,7 @@ fun! netrwSettings#NetrwSettings()
   put = 'let g:netrw_sort_direction    = '.g:netrw_sort_direction
   put = 'let g:netrw_sort_options      = '.g:netrw_sort_options
   put = 'let g:netrw_sort_sequence     = '.g:netrw_sort_sequence
+  put = 'let g:netrw_servername        = '.g:netrw_servername
   put = 'let g:netrw_special_syntax    = '.g:netrw_special_syntax
   put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
   put = 'let g:netrw_ssh_cmd           = '.g:netrw_ssh_cmd
diff --git a/runtime/autoload/netrw_gitignore.vim b/runtime/autoload/netrw_gitignore.vim
index 0de902cbb4..da3f50bca0 100644
--- a/runtime/autoload/netrw_gitignore.vim
+++ b/runtime/autoload/netrw_gitignore.vim
@@ -61,9 +61,16 @@ function! netrw_gitignore#Hide(...)
   " convert gitignore patterns to Netrw/Vim regex patterns
   let escaped_lines = []
   for line in gitignore_lines
-    let escaped       = line
-    let escaped       = substitute(escaped, '\.', '\\.', 'g')
-    let escaped       = substitute(escaped, '*', '.*', 'g')
+    let escaped = line
+    let escaped = substitute(escaped, '\*\*', '*', 'g')
+    let escaped = substitute(escaped, '\.', '\\.', 'g')
+    let escaped = substitute(escaped, '\$', '\\$', 'g')
+    let escaped = substitute(escaped, '*', '.*', 'g')
+    " correction: dot, dollar and asterisks chars shouldn't be escaped when
+    " within regex matching groups.
+    let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\.', '\.', 'g')
+    let escaped = substitute(escaped, '\(\[[^]]*\)\zs\\\$', '\$', 'g')
+    let escaped = substitute(escaped, '\(\[[^]]*\)\zs\.\*', '*', 'g')
     let escaped_lines = add(escaped_lines, escaped)
   endfor
 
diff --git a/runtime/doc/gui_w32.txt b/runtime/doc/gui_w32.txt
index fbe3f35e74..5674bbad07 100644
--- a/runtime/doc/gui_w32.txt
+++ b/runtime/doc/gui_w32.txt
@@ -1,4 +1,4 @@
-*gui_w32.txt*   For Vim version 7.4.  Last change: 2012 Aug 04
+*gui_w32.txt*   For Vim version 7.4.  Last change: 2014 Dec 20
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -452,9 +452,10 @@ detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
 You can drag and drop one or more files into the Vim window, where they will
 be opened as normal.  See |drag-n-drop|.
 
-							*:simalt* *:si*
+							*:simalt* *:sim*
 :sim[alt] {key}		simulate pressing {key} while holding Alt pressed.
 			{not in Vi} {only for Win32 versions}
+			Note: ":si" means ":s" with the "i" flag.
 
 Normally, Vim takes control of all Alt-<Key> combinations, to increase the
 number of possible mappings.  This clashes with the standard use of Alt as the
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 908b58680e..1e0134d68f 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt*     For Vim version 7.4.  Last change: 2014 Sep 19
+*index.txt*     For Vim version 7.4.  Last change: 2015 Jan 07
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1465,7 +1465,7 @@ tag	      command	      action ~
 				buffer list
 |:sbrewind|	:sbr[ewind]	split window and go to first file in the
 				buffer list
-|:scriptnames|	:scrip[tnames]	list names of all sourced Vim scripts
+|:scriptnames|	:scr[iptnames]	list names of all sourced Vim scripts
 |:scriptencoding| :scripte[ncoding]	encoding used in sourced Vim script
 |:scscope|	:scs[cope]	split window and execute cscope command
 |:set|		:se[t]		show or set options
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 72459b0fc5..d62bb4e8e1 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.4.  Last change: 2014 Nov 05
+*options.txt*	For Vim version 7.4.  Last change: 2014 Dec 17
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -730,8 +730,6 @@ A jump table for the options with a short description can be found at |Q_op|.
 	open a file, switch buffers, delete a buffer or open/close a window.
 	It will change to the directory containing the file which was opened
 	or selected.
-	This option is provided for backward compatibility with the Vim
-	released with Sun ONE Studio 4 Enterprise Edition.
 	Note: When this option is on some plugins may not work.
 
 				*'arabic'* *'arab'* *'noarabic'* *'noarab'*
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 32f576af6a..5e629aaf42 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt*  For Vim version 7.4.  Last change: 2014 May 13
+*pi_netrw.txt*  For Vim version 7.4.  Last change: 2015 Jan 05
 
 	    ------------------------------------------------
 	    NETRW REFERENCE MANUAL    by Charles E. Campbell
@@ -6,7 +6,7 @@
 Author:  Charles E. Campbell  <NdrOchip@ScampbellPfamily.AbizM>
 	  (remove NOSPAM from Campbell's email first)
 
-Copyright: Copyright (C) 1999-2014 Charles E Campbell    *netrw-copyright*
+Copyright: Copyright (C) 1999-2015 Charles E Campbell    *netrw-copyright*
 	The VIM LICENSE applies to the files in this package, including
 	netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and
 	syntax/netrw.vim.  Like anything else that's free, netrw.vim and its
@@ -18,9 +18,10 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell    *netrw-copyright*
 	software. Use at your own risk!
 
 
+		*netrw*
 		*dav*    *ftp*    *netrw-file*  *rcp*    *scp*
 		*davs*   *http*   *netrw.vim*   *rsync*  *sftp*
-		*fetch*  *netrw*  *network*
+		*fetch*  *network*
 
 ==============================================================================
 1. Contents						*netrw-contents* {{{1
@@ -57,7 +58,7 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell    *netrw-copyright*
       Changing To A Bookmarked Directory..................|netrw-gb|
       Changing To A Predecessor Directory.................|netrw-u|
       Changing To A Successor Directory...................|netrw-U|
-      Customizing Browsing With A User Function...........|netrw-x|
+      Customizing Browsing With A Special Handler.........|netrw-x|
       Deleting Bookmarks..................................|netrw-mB|
       Deleting Files Or Directories.......................|netrw-D|
       Directory Exploring Commands........................|netrw-explore|
@@ -76,7 +77,9 @@ Copyright: Copyright (C) 1999-2014 Charles E Campbell    *netrw-copyright*
       Unmarking Files.....................................|netrw-mF|
       Marking Files By QuickFix List......................|netrw-qF|
       Marking Files By Regular Expression.................|netrw-mr|
-      Marked Files: Arbitrary Command.....................|netrw-mx|
+      Marked Files: Arbitrary Shell Command...............|netrw-mx|
+      Marked Files: Arbitrary Shell Command, En Bloc......|netrw-mX|
+      Marked Files: Arbitrary Vim Command.................|netrw-mv|
       Marked Files: Compression And Decompression.........|netrw-mz|
       Marked Files: Copying...............................|netrw-mc|
       Marked Files: Diff..................................|netrw-md|
@@ -209,6 +212,7 @@ EXTERNAL APPLICATIONS AND PROTOCOLS			*netrw-externapp* {{{2
 	 rsync:   *g:netrw_rsync_cmd*    = "rsync -a"
 	   scp:   *g:netrw_scp_cmd*      = "scp -q"
 	  sftp:   *g:netrw_sftp_cmd*     = "sftp"
+	  file:   *g:netrw_file_cmd*     = "elinks" or "links"
 
 	*g:netrw_http_xcmd* : the option string for http://... protocols are
 	specified via this variable and may be independently overridden.  By
@@ -346,7 +350,7 @@ settings are described below, in |netrw-browser-options|, and in
 			per-buffer basis (supports plain :Nw )
 
  *g:netrw_bufsettings*	the settings that netrw buffers have
- 			(default) noma nomod nonu nowrap ro nobl
+			(default) noma nomod nonu nowrap ro nobl
 
  *g:netrw_chgwin*	specifies a window number where subsequent file edits
 			will take place.  (also see |netrw-C|)
@@ -399,18 +403,26 @@ settings are described below, in |netrw-browser-options|, and in
 			be available (see |netrw-gx|)
 
  *g:netrw_uid*		(ftp) user-id,      retained on a per-vim-session basis
- *s:netrw_passwd* 	(ftp) password,     retained on a per-vim-session basis
+ *s:netrw_passwd*	(ftp) password,     retained on a per-vim-session basis
 
  *g:netrw_preview*	=0 (default) preview window shown in a horizontally
 			   split window
 			=1 preview window shown in a vertically split window.
 			   Also affects the "previous window" (see |netrw-P|)
 			   in the same way.
+			The |g:netrw_alto| variable may be used to provide
+			additional splitting control:
+				g:netrw_preview g:netrw_alto result
+				         0             0     |:aboveleft|
+				         0             1     |:belowright|
+				         1             0     |:topleft|
+				         1             1     |:botright|
+			To control sizing, see |g:netrw_winsize|
 
  *g:netrw_scpport*	= "-P" : option to use to set port for scp
  *g:netrw_sshport*	= "-p" : option to use to set port for ssh
 
- *g:netrw_sepchr* 	=\0xff
+ *g:netrw_sepchr*	=\0xff
 			=\0x01 for enc == euc-jp (and perhaps it should be for
 			   others, too, please let me know)
 			   Separates priority codes from filenames internally.
@@ -430,7 +442,7 @@ settings are described below, in |netrw-browser-options|, and in
 			   lines that o/s's ftp "provides" on transfers
 			=0 force normal ftp behavior (no trailing line removal)
 
- *g:netrw_cygwin* 	=1 assume scp under windows is from cygwin. Also
+ *g:netrw_cygwin*	=1 assume scp under windows is from cygwin. Also
 			   permits network browsing to use ls with time and
 			   size sorting (default if windows)
 			=0 assume Windows' scp accepts windows-style paths
@@ -681,6 +693,16 @@ your <.vimrc> customization file: >
 	  filetype plugin indent on
 	endif
 <
+By also including the following lines in your .vimrc, one may have netrw
+immediately activate when using [g]vim without any filenames, showing the
+current directory: >
+
+	" Augroup VimStartup:
+	augroup VimStartup
+	  au!
+	  au VimEnter * if expand("%") == "" | e . | endif
+	augroup END
+<
 
 ==============================================================================
 6. Transparent Remote File Editing		*netrw-transparent* {{{1
@@ -838,7 +860,7 @@ variables listed below, and may be modified by the user.
     g:netrw_http_cmd     var   ="fetch -o"     if      fetch is available
     g:netrw_http_cmd     var   ="wget -O"      else if wget  is available
     g:netrw_http_put_cmd var   ="curl -T"
-    g:netrw_list_cmd     var   ="ssh USEPORT HOSTNAME ls -Fa"
+    |g:netrw_list_cmd|    var   ="ssh USEPORT HOSTNAME ls -Fa"
     g:netrw_rcp_cmd      var   ="rcp"
     g:netrw_rsync_cmd    var   ="rsync -a"
     g:netrw_scp_cmd      var   ="scp -q"
@@ -1042,6 +1064,9 @@ QUICK REFERENCE: MAPS				*netrw-browse-maps* {{{2
 <	 <F1>	Causes Netrw to issue help
 	 <cr>	Netrw will enter the directory or read the file      |netrw-cr|
 	 <del>	Netrw will attempt to remove the file/directory      |netrw-del|
+	 <c-h>	Edit file hiding list                             |netrw-ctrl-h|
+	 <c-l>	Causes Netrw to refresh the directory listing     |netrw-ctrl-l|
+	 <c-r>	Browse using a gvim server                        |netrw-ctrl-r|
 	   -	Makes Netrw go up one directory                      |netrw--|
 	   a	Toggles between normal display,                      |netrw-a|
 	    	hiding (suppress display of files matching g:netrw_list_hide)
@@ -1051,23 +1076,27 @@ QUICK REFERENCE: MAPS				*netrw-browse-maps* {{{2
 	   d	Make a directory                                     |netrw-d|
 	   D	Attempt to remove the file(s)/directory(ies)         |netrw-D|
 	   gb	Go to previous bookmarked directory                  |netrw-gb|
+	   gd	Force treatment as directory                         |netrw-gd|
+	   gf	Force treatment as file                              |netrw-gf|
 	   gh	Quick hide/unhide of dot-files                       |netrw-gh|
-	 <c-h>	Edit file hiding list                             |netrw-ctrl-h|
 	   i	Cycle between thin, long, wide, and tree listings    |netrw-i|
-	 <c-l>	Causes Netrw to refresh the directory listing     |netrw-ctrl-l|
 	   mb	Bookmark current directory                           |netrw-mb|
 	   mc	Copy marked files to marked-file target directory    |netrw-mc|
 	   md	Apply diff to marked files (up to 3)                 |netrw-md|
 	   me	Place marked files on arg list and edit them         |netrw-me|
 	   mf	Mark a file                                          |netrw-mf|
+	   mF	Unmark files                                         |netrw-mF|
+	   mg	Apply vimgrep to marked files                        |netrw-mg|
 	   mh	Toggle marked file suffices' presence on hiding list |netrw-mh|
 	   mm	Move marked files to marked-file target directory    |netrw-mm|
 	   mp	Print marked files                                   |netrw-mp|
-	   mr	Mark files satisfying a shell-style |regexp|         |netrw-mr|
+	   mr	Mark files using a shell-style |regexp|                |netrw-mr|
 	   mt	Current browsing directory becomes markfile target   |netrw-mt|
 	   mT	Apply ctags to marked files                          |netrw-mT|
 	   mu	Unmark all marked files                              |netrw-mu|
+	   mv	Apply arbitrary vim   command to marked files        |netrw-mv|
 	   mx	Apply arbitrary shell command to marked files        |netrw-mx|
+	   mX	Apply arbitrary shell command to marked files en bloc|netrw-mX|
 	   mz	Compress/decompress marked files                     |netrw-mz|
 	   o	Enter the file/directory under the cursor in a new   |netrw-o|
 	    	browser window.  A horizontal split is used.
@@ -1076,6 +1105,7 @@ QUICK REFERENCE: MAPS				*netrw-browse-maps* {{{2
 	   P	Browse in the previously used window                 |netrw-P|
 	   qb	List bookmarked directories and history              |netrw-qb|
 	   qf	Display information on file                          |netrw-qf|
+	   qF	Mark files using a quickfix list                     |netrw-qF|
 	   r	Reverse sorting order                                |netrw-r|
 	   R	Rename the designed file(s)/directory(ies)           |netrw-R|
 	   s	Select sorting style: by name, time, or file size    |netrw-s|
@@ -1099,7 +1129,7 @@ QUICK REFERENCE: MAPS				*netrw-browse-maps* {{{2
 			mouse
 	<2-leftmouse>	(gvim only) when:
 			 * in a netrw-selected file, AND
-			 * |g:netrw_retmap| == 1     AND
+			 * |g:netrw_retmap| == 1       AND
 			 * the user doesn't already have a <2-leftmouse>
 			   mapping defined before netrw is autoloaded,
 			then a double clicked leftmouse button will return
@@ -1117,7 +1147,7 @@ QUICK REFERENCE: COMMANDS	*netrw-explore-cmds* *netrw-browse-cmds* {{{2
      :Ntree....................................................|netrw-ntree|
      :Explore[!]  [dir] Explore directory of current file......|netrw-explore|
      :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
-     :Lexplore    [dir] Left Explorer Toggle...................|netrw-explore|
+     :Lexplore[!] [dir] Left Explorer Toggle...................|netrw-explore|
      :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
      :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
      :Rexplore          Return to Explorer.....................|netrw-explore|
@@ -1125,19 +1155,45 @@ QUICK REFERENCE: COMMANDS	*netrw-explore-cmds* *netrw-browse-cmds* {{{2
      :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
      :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
 
-BOOKMARKING A DIRECTORY	*netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
+BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
 
-One may easily "bookmark" a directory by using >
+One may easily "bookmark" the currently browsed directory by using >
 
 	mb
 <
+								*.netrwbook*
 Bookmarks are retained in between sessions in a $HOME/.netrwbook file, and are
 kept in sorted order.
 
+If there are marked files and/or directories, mb will add them to the bookmark
+list.
+
+*netrw-:NetrwMB*
+Addtionally, one may use :NetrwMB to bookmark files or directories. >
+
+	:NetrwMB[!] [files/directories]
+
+< No bang: enters files/directories into Netrw's bookmark system
+
+   No argument and in netrw buffer:
+     if there are marked files: bookmark marked files
+     otherwise                : bookmark file/directory under cursor
+   No argument and not in netrw buffer: bookmarks current open file
+   Has arguments: globs them individually and bookmarks them
+
+ With bang: deletes files/directories from Netrw's bookmark system
+
+The :NetrwMB command is available outside of netrw buffers (once netrw has been
+invoked in the session).
+
+The file ".netrwbook" holds bookmarks when netrw (and vim) is not active.  By
+default, its stored on the first directory on the user's |'runtimepath'|.
+
 Related Topics:
 	|netrw-gb| how to return (go) to a bookmark
 	|netrw-mB| how to delete bookmarks
 	|netrw-qb| how to list bookmarks
+	|g:netrw_home| controls where .netrwbook is kept
 
 
 BROWSING						*netrw-cr* {{{2
@@ -1163,7 +1219,7 @@ horizontally or vertically, respectively.  When the option is set to three, a
 When using the gui (gvim), one may select a file by pressing the <leftmouse>
 button.  In addition, if
 
- *|g:netrw_retmap| == 1      AND   (its default value is 0)
+ * |g:netrw_retmap| == 1       AND   (its default value is 0)
  * in a netrw-selected file, AND
  * the user doesn't already have a <2-leftmouse> mapping defined before
    netrw is loaded
@@ -1181,19 +1237,20 @@ The price for such re-use is that when changes are made (such as new files
 are introduced into a directory), the listing may become out-of-date.  One may
 always refresh directory listing buffers by pressing ctrl-L (see
 |netrw-ctrl-l|).
-
 								*:netrw-s-cr*
     Squeezing the Current Tree-Listing Directory~
     When the tree listing style is enabled (see |netrw-i|) and one is using
     gvim, then the <s-cr> mapping may be used to squeeze (close) the
     directory currently containing the cursor.
 
-
-Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
-Associated setting variables: |g:netrw_browse_split|      |g:netrw_fastbrowse|
-                              |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
-			      |g:netrw_ftp_timelist_cmd|  |g:netrw_ssh_cmd|
-			      |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
+Related topics:
+	|netrw-ctrl-r|	|netrw-o|	|netrw-p|
+	|netrw-P|	|netrw-t|	|netrw-v|
+Associated setting variables:
+   |g:netrw_browse_split|	|g:netrw_fastbrowse|
+   |g:netrw_ftp_list_cmd|	|g:netrw_ftp_sizelist_cmd|
+   |g:netrw_ftp_timelist_cmd|	|g:netrw_ssh_browse_reject|
+   |g:netrw_ssh_cmd|		|g:netrw_use_noswf|
 
 
 BROWSING WITH A HORIZONTALLY SPLIT WINDOW	*netrw-o* *netrw-horiz* {{{2
@@ -1207,12 +1264,14 @@ cursor at the top.
 
 Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
 
-Related Actions |netrw-cr| |netrw-p| |netrw-t| |netrw-v|
+Related topics:
+	|netrw-ctrl-r|	|netrw-o|	|netrw-p|
+	|netrw-P|	|netrw-t|	|netrw-v|
 Associated setting variables:
    |g:netrw_alto|    control above/below splitting
    |g:netrw_winsize| control initial sizing
 
-BROWSING WITH A NEW TAB				*netrw-t*
+BROWSING WITH A NEW TAB				*netrw-t* {{{2
 
 Normally one enters a file or directory using the <cr>.  The "t" map
 allows one to open a new window holding the new directory listing or file in
@@ -1220,7 +1279,9 @@ a new tab.
 
 If you'd like to have the new listing in a background tab, use |gT|.
 
-Related Actions |netrw-cr| |netrw-o| |netrw-p| |netrw-v|
+Related topics:
+	|netrw-ctrl-r|	|netrw-o|	|netrw-p|
+	|netrw-P|	|netrw-t|	|netrw-v|
 Associated setting variables:
    |g:netrw_winsize| control initial sizing
 
@@ -1236,13 +1297,30 @@ cursor at the left.
 There is only one tree listing buffer; using "v" on a displayed subdirectory
 will split the screen, but the same buffer will be shown twice.
 
-Related Actions: |netrw-cr| |netrw-o| |netrw-t| |netrw-v|
+Related topics:
+	|netrw-ctrl-r|	|netrw-o|	|netrw-p|
+	|netrw-P|	|netrw-t|	|netrw-v|
 Associated setting variables:
    |g:netrw_altv|    control right/left splitting
    |g:netrw_winsize| control initial sizing
 
 
-CHANGE LISTING STYLE  (THIN LONG WIDE TREE)   			*netrw-i* {{{2
+BROWSING USING A GVIM SERVER			*netrw-ctrl-r* {{{2
+
+One may keep a browsing gvim separate from the gvim being used to edit.
+Use the <c-r> map on a file (not a directory) in the netrw browser, and it
+will use a gvim server (see |g:netrw_servername|).  Subsequent use of <cr>
+(see |netrw-cr|) will re-use that server for editing files.
+
+Related topics:
+	|netrw-ctrl-r|	|netrw-o|	|netrw-p|
+	|netrw-P|	|netrw-t|	|netrw-v|
+Associated setting variables:
+	|g:netrw_servername|   : sets name of server
+	|g:netrw_browse_split| : controls how <cr> will open files
+
+
+CHANGE LISTING STYLE  (THIN LONG WIDE TREE)			*netrw-i* {{{2
 
 The "i" map cycles between the thin, long, wide, and tree listing formats.
 
@@ -1267,7 +1345,7 @@ name.
 
 One may make a preferred listing style your default; see |g:netrw_liststyle|.
 As an example, by putting the following line in your .vimrc, >
-	let g:netrw_liststyle= 4
+	let g:netrw_liststyle= 3
 the tree style will become your default listing style.
 
 One typical way to use the netrw tree display is to: >
@@ -1321,8 +1399,15 @@ The "u" map also accepts counts to go back in the history several slots.
 For your convenience, |netrw-qb| lists the history number which can be
 re-used in that count.
 
+						*.netrwhist*
 See |g:netrw_dirhistmax| for how to control the quantity of history stack
-slots.
+slots.  The file ".netrwhist" holds history when netrw (and vim) is not
+active.  By default, its stored on the first directory on the user's
+|'runtimepath'|.
+
+Related Topics:
+	|netrw-U| changing to a successor directory
+	|g:netrw_home| controls where .netrwhist is kept
 
 
 CHANGING TO A SUCCESSOR DIRECTORY		*netrw-U* *netrw-downdir* {{{2
@@ -1337,7 +1422,7 @@ See |g:netrw_dirhistmax| for how to control the quantity of history stack
 slots.
 
 
-CHANGING TREE TOP				*netrw-ntree* *:Ntree*
+CHANGING TREE TOP				*netrw-ntree* *:Ntree* {{{2
 
 One may specify a new tree top for tree listings using >
 
@@ -1348,7 +1433,7 @@ information is elided).
 With a "dirname", the specified directory name is used.
 
 
-NETRW CLEAN					*netrw-clean* *:NetrwClean*
+NETRW CLEAN					*netrw-clean* *:NetrwClean* {{{2
 
 With :NetrwClean one may easily remove netrw from one's home directory;
 more precisely, from the first directory on your |'runtimepath'|.
@@ -1361,17 +1446,16 @@ that the removal is in fact what you want to do.  If netrw doesn't have
 permission to remove a file, it will issue an error message.
 
 						*netrw-gx*
-CUSTOMIZING BROWSING WITH A USER FUNCTION	*netrw-x* *netrw-handler* {{{2
+CUSTOMIZING BROWSING WITH A SPECIAL HANDLER	*netrw-x* *netrw-handler* {{{2
 						(also see |netrw_filehandler|)
 
 Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
-best seen with a special handler (ie. a tool provided with your computer).
-Netrw allows one to invoke such special handlers by: >
+best seen with a special handler (ie. a tool provided with your computer's
+operating system).  Netrw allows one to invoke such special handlers by: >
 
 	* when Exploring, hit the "x" key
 	* when editing, hit gx with the cursor atop the special filename
-<	  (not available if the |g:netrw_nogx| variable exists)
-
+<	  (latter not available if the |g:netrw_nogx| variable exists)
 Netrw determines which special handler by the following method:
 
   * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
@@ -1379,14 +1463,14 @@ Netrw determines which special handler by the following method:
 
 	:let g:netrw_browsex_viewer= "kfmclient exec"
 <   or >
-	:let g:netrw_browsex_viewer= "gnome-open"
+	:let g:netrw_browsex_viewer= "xdg-open"
 <
-    If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
-    invoked first (see |netrw_filehandler|).
+    If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
+    used instead (see |netrw_filehandler|).
 
   * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
   * for Gnome (with gnome-open): gnome-open is used.
-  * for KDE (with kfmclient)   : kfmclient is used.
+  * for KDE (with kfmclient)   : kfmclient is used
   * for Mac OS X               : open is used.
   * otherwise the netrwFileHandler plugin is used.
 
@@ -1395,17 +1479,31 @@ appropriate application to use to "handle" these files.  Such things as
 OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
 *.eps) can be handled.
 
+The gx mapping extends to all buffers; apply "gx" while atop a word and netrw
+will apply a special handler to it (like "x" works when in a netrw buffer).
+One may also use visual mode (see |visual-start|) to select the text that the
+special handler will use.  Normally gx uses expand("<cfile>") to pick up the
+text under the cursor; one may change what |expand()| uses via the
+|g:netrw_gx| variable.  Alternatively, one may select the text to be used by
+gx via first making a visual selection (see |visual-block|).
+
+Associated setting variables:
+	|g:netrw_gx|	control how gx picks up the text under the cursor
+	|g:netrw_nogx|	prevent gx map while editing
+
 							*netrw_filehandler*
 
-The "x" map applies a function to a file, based on its extension.  Of course,
-the handler function must exist for it to be called!
+When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to
+handle the special file with a vim function.  The "x" map applies a function
+to a file, based on its extension.  Of course, the handler function must exist
+for it to be called!
 >
- Ex. mypgm.html   x ->
-                  NFH_html("scp://user@host/some/path/mypgm.html")
-<
-Users may write their own netrw File Handler functions to support more
-suffixes with special handling.  See <autoload/netrwFileHandlers.vim> for
-examples on how to make file handler functions.   As an example: >
+ Ex. mypgm.html   x -> NFH_html("scp://user@host/some/path/mypgm.html")
+
+<	Users may write their own netrw File Handler functions to
+	support more suffixes with special handling.  See
+	<autoload/netrwFileHandlers.vim> for examples on how to make
+	file handler functions.   As an example: >
 
 	" NFH_suffix(filename)
 	fun! NFH_suffix(filename)
@@ -1439,7 +1537,14 @@ DELETING BOOKMARKS					*netrw-mB* {{{2
 To delete a bookmark, use >
 
 	{cnt}mB
-<
+
+If there are marked files, then mB will remove them from the
+bookmark list.
+
+Alternatively, one may use :NetrwMB! (see |netrw-:NetrwMB|). >
+
+	:NetrwMB! [files/directories]
+
 Related Topics:
 	|netrw-gb| how to return (go) to a bookmark
 	|netrw-mb| how to make a bookmark
@@ -1498,11 +1603,11 @@ DIRECTORY EXPLORATION COMMANDS  {{{2
 
      :[N]Explore[!]  [dir]... Explore directory of current file      *:Explore*
      :[N]Hexplore[!] [dir]... Horizontal Split & Explore             *:Hexplore*
-     :Rexplore            ... Return to/from Explorer                *:Rexplore*
+     :[N]Lexplore[!] [dir]... Left Explorer Toggle                   *:Lexplore*
      :[N]Sexplore[!] [dir]... Split&Explore current file's directory *:Sexplore*
-     :Texplore       [dir]... Tab              & Explore             *:Texplore*
      :[N]Vexplore[!] [dir]... Vertical   Split & Explore             *:Vexplore*
-     :Lexplore       [dir]... Left Explorer Toggle                   *:Lexplore*
+     :Texplore       [dir]... Tab & Explore                          *:Texplore*
+     :Rexplore            ... Return to/from Explorer                *:Rexplore*
 
      Used with :Explore **/pattern : (also see |netrw-starstar|)
      :Nexplore............. go to next matching file                *:Nexplore*
@@ -1511,54 +1616,73 @@ DIRECTORY EXPLORATION COMMANDS  {{{2
 						*netrw-:Explore*
 :Explore  will open the local-directory browser on the current file's
           directory (or on directory [dir] if specified).  The window will be
-	  split only if the file has been modified, otherwise the browsing
-	  window will take over that window.  Normally the splitting is taken
-	  horizontally.
+	  split only if the file has been modified and |'hidden'| is not set,
+	  otherwise the browsing window will take over that window.  Normally
+	  the splitting is taken horizontally.
 	  Also see: |netrw-:Rexplore|
 :Explore! is like :Explore, but will use vertical splitting.
-						*netrw-:Lexplore*
-:Lexplore [dir] toggles an Explorer window on the left hand side
-          of the current tab  It will open a netrw window on the current
-	  directory if [dir] is omitted; a :Lexplore [dir] will show
-	  the specified directory in the left-hand side browser display
-	  no matter from which window the command is issued.  By default,
-	  :Lexplore will change an uninitialized |g:netrw_chgwin| to 2;
-	  edits will thus be preferentially made in window#2.
-	  Also see: |netrw-C|| |g:netrw_chgwin| |g:netrw_winsize|
-	  	    |netrw-p| |netrw-P|| |g:netrw_browse_split|
-						*netrw-:Sexplore*
-:Sexplore will always split the window before invoking the local-directory
-          browser.  As with Explore, the splitting is normally done
-	  horizontally.
-:Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
+
 						*netrw-:Hexplore*
 :Hexplore  [dir] does an :Explore with |:belowright| horizontal splitting.
 :Hexplore! [dir] does an :Explore with |:aboveleft|  horizontal splitting.
-						*netrw-:Vexplore*
-:Vexplore  [dir] does an :Explore with |:leftabove|  vertical splitting.
-:Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
+
+						*netrw-:Lexplore*
+:[N]Lexplore [dir] toggles a full height Explorer window on the left hand side
+	  of the current tab.  It will open a netrw window on the current
+	  directory if [dir] is omitted; a :Lexplore [dir] will show the
+	  specified directory in the left-hand side browser display no matter
+	  from which window the command is issued.  By default, :Lexplore will
+	  change an uninitialized |g:netrw_chgwin| to 2; edits will thus
+	  preferentially be made in window#2.
+	    The [N] specifies a |g:netrw_winsize| just for the new :Lexplore
+	  window.
+	    Those who like this method often also like tree style displays;
+	  see |g:netrw_liststyle|.
+
+	  Also see: |netrw-C| |g:netrw_chgwin| |g:netrw_winsize|
+		    |netrw-p| |netrw-P|        |g:netrw_browse_split|
+
+:[N]Lexplore! is like :Lexplore, except that the full-height Explorer window
+	  will open on the right hand side, and an uninitialized |g:netrw_chgwin|
+	  will be set to 1.
+
+						*netrw-:Sexplore*
+:[N]Sexplore will always split the window before invoking the local-directory
+	  browser.  As with Explore, the splitting is normally done
+	  horizontally.
+:[N]Sexplore! [dir] is like :Sexplore, but the splitting will be done vertically.
+
 						*netrw-:Texplore*
 :Texplore  [dir] does a |:tabnew| before generating the browser window
 
-By default, these commands use the current file's directory.  However, one may
-explicitly provide a directory (path) to use.
+						*netrw-:Vexplore*
+:[N]Vexplore  [dir] does an :Explore with |:leftabove|  vertical splitting.
+:[N]Vexplore! [dir] does an :Explore with |:rightbelow| vertical splitting.
 
-The [N] will override |g:netrw_winsize| to specify the quantity of rows and/or
-columns the new explorer window should have.
+The optional parameters are:
 
-Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
-user, is used to control the quantity of rows and/or columns new explorer
-windows should have.
+ [N]: This parameter will override |g:netrw_winsize| to specify the quantity of
+      rows and/or columns the new explorer window should have.
+      Otherwise, the |g:netrw_winsize| variable, if it has been specified by the
+      user, is used to control the quantity of rows and/or columns new
+      explorer windows should have.
 
+ [dir]: By default, these explorer commands use the current file's directory.
+        However, one may explicitly provide a directory (path) to use instead;
+	ie. >
+
+	:Explore /some/path
+<
 						*netrw-:Rexplore*
-:Rexplore  This command is a little different from the others as it doesn't
-	   necessarily open an Explorer window.
+:Rexplore  This command is a little different from the other Explore commands
+	   as it doesn't necessarily open an Explorer window.
 
 	   Return to Explorer~
-	   When one edits a file, for example by pressing <cr> when the
-	   cursor is atop a file in a netrw browser window, :Rexplore will
-	   return the display to that of the last netrw browser display
-	   in that window.
+	   When one edits a file using netrw which can occur, for example,
+	   when pressing <cr> while the cursor is atop a filename in a netrw
+	   browser window, a :Rexplore issued while editing that file will
+	   return the display to that of the last netrw browser display in
+	   that window.
 
 	   Return from Explorer~
 	   Conversely, when one is editing a directory, issuing a :Rexplore
@@ -1571,11 +1695,11 @@ windows should have.
 Also see: |g:netrw_alto| |g:netrw_altv| |g:netrw_winsize|
 
 
-*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
-EXPLORING WITH STARS AND PATTERNS
+*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat* *netrw-grep*
+EXPLORING WITH STARS AND PATTERNS {{{2
 
 When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
-following four styles, Explore generates a list of files which satisfy
+following four patterns Explore generates a list of files which satisfy
 the request. >
 
     */filepat	files in current directory which satisfy filepat
@@ -1597,7 +1721,7 @@ will clear the explore list.
 
 If your console or gui produces recognizable shift-up or shift-down sequences,
 then you'll likely find using shift-downarrow and shift-uparrow convenient.
-They're mapped by netrw:
+They're mapped by netrw as follows:
 
 	<s-down>  == Nexplore, and
 	<s-up>    == Pexplore.
@@ -1678,7 +1802,7 @@ Related topics:               |netrw-s|               |netrw-S|
 Associated setting variables: |g:netrw_sort_sequence| |g:netrw_sort_options|
 
 
-EXECUTING FILE UNDER CURSOR VIA SYSTEM()			*netrw-X*
+EXECUTING FILE UNDER CURSOR VIA SYSTEM()			*netrw-X* {{{2
 
 Pressing X while the cursor is atop an executable file will yield a prompt
 using the filename asking for any arguments.  Upon pressing a [return], netrw
@@ -1769,18 +1893,19 @@ Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
 Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
 |g:netrw_list_hide| automatically hides all git-ignored files.
 
-'netrw_gitignore#Hide' searches for patterns in the following files:
+'netrw_gitignore#Hide' searches for patterns in the following files: >
+
 	'./.gitignore'
 	'./.git/info/exclude'
 	global gitignore file: `git config --global core.excludesfile`
 	system gitignore file: `git config --system core.excludesfile`
-
+<
 Files that do not exist, are ignored.
 Git-ignore patterns are taken from existing files, and converted to patterns for
 hiding files. For example, if you had '*.log' in your '.gitignore' file, it
 would be converted to '.*\.log'.
 
-To use this function, simply assign it's output to |g:netrw_list_hide| option.
+To use this function, simply assign its output to |g:netrw_list_hide| option.  >
 
 	Example: let g:netrw_list_hide= netrw_gitignore#Hide()
 		Git-ignored files are hidden in Netrw.
@@ -1790,7 +1915,7 @@ To use this function, simply assign it's output to |g:netrw_list_hide| option.
 
 	Example: g:netrw_list_hide= netrw_gitignore#Hide() . '.*\.swp$'
 		Combining 'netrw_gitignore#Hide' with custom patterns.
-
+<
 
 IMPROVING BROWSING			*netrw-listhack* *netrw-ssh-hack* {{{2
 
@@ -1926,7 +2051,7 @@ Associated setting variable: |g:netrw_keepdir|
 MARKING FILES					*netrw-:MF*	*netrw-mf* {{{2
 	(also see |netrw-mr|)
 
-Netrw has several ways of marking files:
+Netrw provides several ways to mark files:
 
 	* One may mark files with the cursor atop a filename and
 	  then pressing "mf".
@@ -1949,6 +2074,8 @@ The following netrw maps make use of marked files:
 
     |netrw-a|	Hide marked files/directories
     |netrw-D|	Delete marked files/directories
+    |netrw-mb|	Append marked files to bookmarks
+    |netrw-mB|	Delete marked files from bookmarks
     |netrw-mc|	Copy marked files to target
     |netrw-md|	Apply vimdiff to marked files
     |netrw-me|	Edit marked files
@@ -1958,7 +2085,9 @@ The following netrw maps make use of marked files:
     |netrw-mp|	Print marked files
     |netrw-mt|	Set target for |netrw-mm| and |netrw-mc|
     |netrw-mT|	Generate tags using marked files
+    |netrw-mv|	Apply vim command to marked files
     |netrw-mx|	Apply shell command to marked files
+    |netrw-mX|	Apply shell command to marked files, en bloc
     |netrw-mz|	Compress/Decompress marked files
     |netrw-O|	Obtain marked files
     |netrw-R|	Rename marked files
@@ -1982,13 +2111,13 @@ If the mouse is enabled and works with your vim, you may use <s-leftmouse> to
 mark one or more files.  You may mark multiple files by dragging the shifted
 leftmouse.  (see |netrw-mouse|)
 
-*markfilelist* *global_markfilelist* *local_markfilelist*
+			*markfilelist* *global_markfilelist* *local_markfilelist*
 All marked files are entered onto the global marked file list; there is only
-one such list.  In addition, every netrw buffer also has its own local marked
-file list; since netrw buffers are associated with specific directories, this
-means that each directory has its own local marked file list.  The various
-commands which operate on marked files use one or the other of the marked file
-lists.
+one such list.  In addition, every netrw buffer also has its own buffer-local
+marked file list; since netrw buffers are associated with specific
+directories, this means that each directory has its own local marked file
+list.  The various commands which operate on marked files use one or the other
+of the marked file lists.
 
 Known Problem: if one is using tree mode (|g:netrw_liststyle|) and several
 directories have files with the same name,  then marking such a file will
@@ -2004,7 +2133,7 @@ This command will unmark all files in the current buffer.  One may also use
 mf (|netrw-mf|) on a specific file to unmark just that file.
 
 
-MARKING FILES BY QUICKFIX LIST				*netrw-qF*
+MARKING FILES BY QUICKFIX LIST				*netrw-qF* {{{2
 	(also see |netrw-mf|)
 
 One may convert the |quickfix-error-lists| into a marked file list using
@@ -2024,7 +2153,20 @@ future I may make it possible to use |regexp|s instead of glob()-style
 expressions (yet-another-option).
 
 
-MARKED FILES: ARBITRARY COMMAND				*netrw-mx* {{{2
+MARKED FILES, ARBITRARY VIM COMMAND				*netrw-mv*  {{{2
+	    (See |netrw-mf| and |netrw-mr| for how to mark files)
+		      (uses the local marked-file list)
+
+The "mv" map causes netrw execute an arbitrary vim command on each file
+on the local marked file list, individually:
+
+	* 1split
+	* sil! keepalt e file
+	* run vim command
+	* sil! keepalt wq!
+
+
+MARKED FILES, ARBITRARY SHELL COMMAND				*netrw-mx* {{{2
 	    (See |netrw-mf| and |netrw-mr| for how to mark files)
 		      (uses the local marked-file list)
 
@@ -2033,6 +2175,37 @@ command to be applied to all marked files.  All "%"s in the command will be
 substituted with the name of each marked file in turn.  If no "%"s are in the
 command, then the command will be followed by a space and a marked filename.
 
+Example:
+	(mark files)
+	mx
+	Enter command: cat
+
+	The result is a series of shell commands:
+	cat 'file1'
+	cat 'file2'
+	...
+
+
+MARKED FILES, ARBITRARY SHELL COMMAND, EN BLOC 			*netrw-mX* {{{2
+	    (See |netrw-mf| and |netrw-mr| for how to mark files)
+		      (uses the global marked-file list)
+
+Upon activation of the 'mX' map, netrw will query the user for some (external)
+command to be applied to all marked files on the global marked file list.  The
+"en bloc" means that one command will be executed on all the files at once: >
+
+	command files
+
+It is useful, for example, to select files and make a tarball:
+
+	(mark files)
+	mX
+	Enter command: tar cf mynewtarball.tar
+
+The command that will be run in this example:
+
+	tar cf mynewtarball.tar 'file1' 'file2' ...
+
 
 MARKED FILES: COMPRESSION AND DECOMPRESSION		*netrw-mz* {{{2
 	    (See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2046,6 +2219,10 @@ that's "gzip".
 For decompression, netrw provides a |Dictionary| of suffices and their
 associated decompressing utilities; see |g:netrw_decompress|.
 
+Remember that one can mark multiple files by regular expression
+(see |netrw-mr|); this is particularly useful to facilitate compressing and
+decompressing a large number of files.
+
 Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
 
 MARKED FILES: COPYING						*netrw-mc* {{{2
@@ -2056,7 +2233,16 @@ Select a target directory with mt (|netrw-mt|).  Then change directory,
 select file(s) (see |netrw-mf|), and press "mc".  The copy is done
 from the current window (where one does the mf) to the target.
 
-Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
+If one does not have a target directory set with |netrw-mt|, then netrw
+will query you for a directory to copy to.
+
+One may also copy directories and their contents (local only) to a target
+directory.
+
+Associated setting variables:
+	|g:netrw_localcopycmd|
+	|g:netrw_localcopydircmd|
+	|g:netrw_ssh_cmd|
 
 MARKED FILES: DIFF						*netrw-md* {{{2
 	    (See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2090,7 +2276,7 @@ Thus, one may use >
 	mr ...file-pattern
 	mg ..contents-pattern
 to have a marked file list satisfying the file-pattern but containing the
-desried contents-pattern.
+desired contents-pattern.
 
 MARKED FILES: HIDING AND UNHIDING BY SUFFIX			*netrw-mh* {{{2
 	    (See |netrw-mf| and |netrw-mr| for how to mark files)
@@ -2148,7 +2334,7 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
   * Also, if the cursor is in the banner, then the netrw window's currently
     displayed directory is used for the copy/move-to target.
     Unless the target already is the current directory.  In which case,
-    remove the target.
+    typing "mf" clears the target.
 
   * However, if the cursor is atop a directory name, then that directory is
     used for the copy/move-to target
@@ -2157,9 +2343,9 @@ Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
     This command uses |<q-args>|, so spaces in the directory name are
     permitted without escaping.
 
-There is only one copy/move-to target per vim session; ie. the target is a
-script variable (see |s:var|) and is shared between all netrw windows (in an
-instance of vim).
+There is only one copy/move-to target at a time in a vim session; ie. the
+target is a script variable (see |s:var|) and is shared between all netrw
+windows (in an instance of vim).
 
 When using menus and gvim, netrw provides a "Targets" entry which allows one
 to pick a target from the list of bookmarks and history.
@@ -2196,7 +2382,7 @@ edit the desired file and go to the tag.
 
 Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
 
-MARKED FILES: TARGET DIRECTORY USING BOOKMARKS  		*netrw-Tb* {{{2
+MARKED FILES: TARGET DIRECTORY USING BOOKMARKS		*netrw-Tb* {{{2
 
 Sets the marked file copy/move-to target.
 
@@ -2214,7 +2400,7 @@ Related topics:
       Moving files to target.............................|netrw-mm|
 
 
-MARKED FILES: TARGET DIRECTORY USING HISTORY	  		*netrw-Th* {{{2
+MARKED FILES: TARGET DIRECTORY USING HISTORY			*netrw-Th* {{{2
 
 Sets the marked file copy/move-to target.
 
@@ -2269,15 +2455,13 @@ your browsing preferences.  (see also: |netrw-settings|)
   *g:netrw_banner*		enable/suppress the banner
 				=0: suppress the banner
 				=1: banner is enabled (default)
-				NOTE: suppressing the banner is a new feature
-				which may cause problems.
 
   *g:netrw_bannerbackslash*	if this variable exists and is not zero, the
 				banner will be displayed with backslashes
 				rather than forward slashes.
 
   *g:netrw_browse_split*	when browsing, <cr> will open the file by:
-				=0: re-using the same window
+				=0: re-using the same window  (default)
 				=1: horizontally splitting the window first
 				=2: vertically   splitting the window first
 				=3: open file in new tab
@@ -2285,10 +2469,19 @@ your browsing preferences.  (see also: |netrw-settings|)
 				    Note that |g:netrw_preview| may be used
 				    to get vertical splitting instead of
 				    horizontal splitting.
+				=[servername,tab-number,window-number]
+				    Given a |List| such as this, a remote server
+				    named by the "servername" will be used for
+				    editing.  It will also use the specified tab
+				    and window numbers to perform editing
+				    (see |clientserver|, |netrw-ctrl-r|)
+				This option does not affect |:Lexplore|
+				windows.
 
 				Related topics:
-					|netrw-cr|	|netrw-C|
-					|g:netrw_alto|	|g:netrw_altv|
+				    |g:netrw_alto|	|g:netrw_altv|
+				    |netrw-C|		|netrw-cr|
+				    |netrw-ctrl-r|
 
   *g:netrw_browsex_viewer*	specify user's preference for a viewer: >
 					"kfmclient exec"
@@ -2321,7 +2514,7 @@ your browsing preferences.  (see also: |netrw-settings|)
 				tags
 
   *g:netrw_cursor*		= 2 (default)
-  				This option controls the use of the
+				This option controls the use of the
 				|'cursorline'| (cul) and |'cursorcolumn'|
 				(cuc) settings by netrw:
 
@@ -2385,7 +2578,7 @@ your browsing preferences.  (see also: |netrw-settings|)
 				versus speed.
 
   *g:netrw_ffkeep*		(default: doesn't exist)
-  				If this variable exists and is zero, then
+				If this variable exists and is zero, then
 				netrw will not do a save and restore for
 				|'fileformat'|.
 
@@ -2428,6 +2621,11 @@ your browsing preferences.  (see also: |netrw-settings|)
 				These characters in directory names are
 				escaped before applying glob()
 
+  *g:netrw_gx*			="<cfile>"
+ 				This option controls how gx (|netrw-gx|) picks
+				up the text under the cursor.  See |expand()|
+				for possibilities.
+
   *g:netrw_hide*		Controlled by the "a" map (see |netrw-a|)
 				=0 : show all
 				=1 : show not-hidden files
@@ -2447,10 +2645,22 @@ your browsing preferences.  (see also: |netrw-settings|)
 				The current browsing directory is contained in
 				b:netrw_curdir (also see |netrw-c|)
 
+  *g:netrw_keepj*		="keepj" (default) netrw attempts to keep the
+				         |:jumps| table unaffected.
+				=""      netrw will not use |:keepjumps| with
+					 exceptions only for the
+					 saving/restoration of position.
+
   *g:netrw_list_cmd*		command for listing remote directories
 				 default: (if ssh is executable)
 				          "ssh HOSTNAME ls -FLa"
 
+ *g:netrw_list_cmd_options*	If this variable exists, then its contents are
+				appended to the g:netrw_list_cmd.  For
+				example, use "2>/dev/null" to get rid of banner
+				messages on unix systems.
+
+
   *g:netrw_liststyle*		Set the default listing style:
                                 = 0: thin listing (one file per line)
                                 = 1: long listing (one file per line with time
@@ -2468,7 +2678,7 @@ your browsing preferences.  (see also: |netrw-settings|)
 
 				Examples:
 				 let g:netrw_list_hide= '.*\.swp$'
-         			 let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
+				 let g:netrw_list_hide= netrw_gitignore#Hide().'.*\.swp$'
 				default: ""
 
   *g:netrw_localcopycmd*	="cp" Linux/Unix/MacOS/Cygwin
@@ -2476,6 +2686,11 @@ your browsing preferences.  (see also: |netrw-settings|)
 				Copies marked files (|netrw-mf|) to target
 				directory (|netrw-mt|, |netrw-mc|)
 
+ *g:netrw_localcopydircmd*	="cp -R"	Linux/Unix/MacOS/Cygwin
+				="xcopy /e /c /h/ /i /k"	Windows
+				Copies directories to target directory.
+				(|netrw-mc|, |netrw-mt|)
+
   *g:netrw_localmkdir*		command for making a local directory
 				 default: "mkdir"
 
@@ -2499,7 +2714,7 @@ your browsing preferences.  (see also: |netrw-settings|)
 				 default: "ssh USEPORT HOSTNAME mkdir"
 
   *g:netrw_mousemaps*		  =1 (default) enables mouse buttons while
-  				   browsing to:
+				   browsing to:
 				     leftmouse       : open file/directory
 				     shift-leftmouse : mark file
 				     middlemouse     : same as P
@@ -2543,6 +2758,10 @@ your browsing preferences.  (see also: |netrw-settings|)
   *g:netrw_rmf_cmd*		command for removing remote softlinks
 				 default: "ssh USEPORT HOSTNAME rm -f"
 
+  *g:netrw_servername*		use this variable to provide a name for
+				|netrw-ctrl-r| to use for its server.
+				 default: "NETRWSERVER"
+
   *g:netrw_sort_by*		sort by "name", "time", or "size"
 				 default: "name"
 
@@ -2731,7 +2950,7 @@ Related topics:
    directory, see |g:netrw_keepdir|.
 
 							*netrw-createfile*
-OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY		*netrw-%*
+OPEN A NEW FILE IN NETRW'S CURRENT DIRECTORY		*netrw-%* {{{2
 
 To open a new file in netrw's current directory, press "%".  This map
 will query the user for a new filename; an empty file by that name will
@@ -2744,9 +2963,9 @@ PREVIEW WINDOW				*netrw-p* *netrw-preview* {{{2
 
 One may use a preview window by using the "p" key when the cursor is atop the
 desired filename to be previewed.  The display will then split to show both
-the browser (where the cursor will remain) and the file (see |:pedit|).
-By default, the split will be taken horizontally; one may use vertical
-splitting if one has set |g:netrw_preview| first.
+the browser (where the cursor will remain) and the file (see |:pedit|).  By
+default, the split will be taken horizontally; one may use vertical splitting
+if one has set |g:netrw_preview| first.
 
 An interesting set of netrw settings is: >
 
@@ -2755,6 +2974,7 @@ An interesting set of netrw settings is: >
 	let g:netrw_winsize   = 30
 
 These will:
+
 	1. Make vertical splitting the default for previewing files
 	2. Make the default listing style "tree"
 	3. When a vertical preview window is opened, the directory listing
@@ -2817,6 +3037,17 @@ If there are marked files:  (see |netrw-mf|)
     Marked files will be renamed (moved).  You will be queried as above in
     order to specify where you want the file/directory to be moved.
 
+    If you answer a renaming query with a "s/frompattern/topattern/", then
+    subsequent files on the marked file list will be renamed by taking each
+    name, applying that substitute, and renaming each file to the result.
+    As an example : >
+
+    	mr  [query: reply with *.c]
+	R   [query: reply with s/^\(.*\)\.c$/\1.cpp/]
+<
+    This example will mark all *.c files and then rename them to *.cpp
+    files.
+
     WARNING:~
 
     Note that moving files is a dangerous operation; copies are safer.  That's
@@ -2843,17 +3074,24 @@ Related topics:               |netrw-r| |netrw-S|
 Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
 
 
-SETTING EDITING WINDOW					*netrw-C* {{{2
+SETTING EDITING WINDOW				*netrw-C* *netrw-:NetrwC* {{{2
 
-One may select a netrw window for editing with the "C" mapping, or by setting
-g:netrw_chgwin to the selected window number.  Subsequent selection of a file
-to edit (|netrw-cr|) will use that window.
+One may select a netrw window for editing with the "C" mapping, using the
+:NetrwC [win#] command, or by setting g:netrw_chgwin to the selected window
+number.  Subsequent selection of a file to edit (|netrw-cr|) will use that
+window.
 
 	* C  by itself, will select the current window for editing via
 	  |netrw-cr|
 
 	* [count]C the count will be used as the window number to be used
 	  for editing via |netrw-cr|.
+
+	* :NetrwC will set |g:netrw_chgwin| to the current window
+
+	* :NetrwC win#  will set |g:netrw_chgwin| to the specified window
+	  number
+
 Using >
 	let g:netrw_chgwin= -1
 will restore the default editing behavior (ie. use the current window).
@@ -3107,7 +3345,7 @@ Associated setting variables:	|g:netrw_chgwin|
 	    "let g:netrw_scp_cmd = "d:\\dev\\putty\\PSCP.exe"
 <
 								*netrw-p14*
-	P14. I'd would like to speed up writes using Nwrite and scp/ssh
+	P14. I would like to speed up writes using Nwrite and scp/ssh
 	     style connections.  How?  (Thomer M. Gil)
 
 	     Try using ssh's ControlMaster and ControlPath (see the ssh_config
@@ -3155,15 +3393,66 @@ Associated setting variables:	|g:netrw_chgwin|
 	     directory.  Start if from your $HOME or another writable
 	     directory.
 
+								*netrw-p17*
+	P17. Netrw is closing buffers on its own.
+	     What steps will reproduce the problem?
+		1. :Explore, navigate directories, open a file
+		2. :Explore, open another file
+		3. Buffer opened in step 1 will be closed. o
+	    What is the expected output? What do you see instead?
+		I expect both buffers to exist, but only the last one does.
+
+	   (Lance) Problem is caused by "set autochdir" in .vimrc.
+	   (drchip) I am able to duplicate this problem with |'acd'| set.
+	            It appears that the buffers are not exactly closed;
+		    a ":ls!" will show them (although ":ls" does not).
+
+								*netrw-P18*
+	P18. How to locally edit a file that's only available via
+	     another server accessible via ssh?
+	     See http://stackoverflow.com/questions/12469645/
+	     "Using Vim to Remotely Edit A File on ServerB Only
+	      Accessible From ServerA"
+
 ==============================================================================
 11. Debugging Netrw Itself				*netrw-debug* {{{1
 
-The <netrw.vim> script is typically available as something like:
+Step 1: check that the problem you've encountered hasn't already been resolved
+by obtaining a copy of the latest (often developmental) netrw at:
+
+	http://www.drchip.org/astronaut/vim/index.html#NETRW
+
+The <netrw.vim> script is typically installed on systems as something like:
 >
 	/usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
 	/usr/local/share/vim/vim7x/autoload/netrw.vim
+		(see output of :echo &rtp)
+<
+which is loaded automatically at startup (assuming :set nocp).  If you
+installed a new netrw, then it will be located at >
+
+	$HOME/.vim/plugin/netrwPlugin.vim
+	$HOME/.vim/autoload/netrw.vim
 <
-which is loaded automatically at startup (assuming :set nocp).
+Step 2: assuming that you've installed the latest version of netrw,
+check that your problem is really due to netrw.  Create a file
+called netrw.vimrc with the following contents: >
+
+	set nocp
+	so $HOME/.vim/plugin/netrwPlugin.vim
+<
+Then run netrw as follows: >
+
+	vim -u netrw.vimrc --noplugins [some path here]
+<
+Perform whatever netrw commands you need to, and check that the problem is
+still present.  This procedure sidesteps any issues due to personal .vimrc
+settings and other plugins.  If the problem does not appear, then you need
+to determine what setting in your .vimrc is causing the conflict with netrw
+or which plugin.
+
+Step 3: If the problem still is present, then get a debugging trace from
+netrw:
 
 	1. Get the <Decho.vim> script, available as:
 
@@ -3192,7 +3481,8 @@ which is loaded automatically at startup (assuming :set nocp).
 	3. Then bring up vim and attempt to evoke the problem by doing a
 	   transfer or doing some browsing.  A set of messages should appear
 	   concerning the steps that <netrw.vim> took in attempting to
-	   read/write your file over the network in a separate tab.
+	   read/write your file over the network in a separate tab or
+	   server vim window.
 
 	   To save the file, use >
 
@@ -3207,14 +3497,82 @@ which is loaded automatically at startup (assuming :set nocp).
 	   debugging trace is due to which command.
 
 	   Please send that information to <netrw.vim>'s maintainer along
-	   with the o/s you're using and vim version you're using
+	   with the o/s you're using and the vim version that you're using
 	   (see |:version|) >
 		NdrOchip at ScampbellPfamily.AbizM - NOSPAM
 <
 ==============================================================================
 12. History						*netrw-history* {{{1
 
-	v152:	Apr 08, 2014   	* uses the |'noswapfile'| option (requires
+	v153:	May 13, 2014	* added another |g:netrw_ffkeep| usage {{{2
+		May 14, 2014	* changed s:PerformListing() so that it
+				  always sets ft=netrw for netrw buffers
+				  (ie. even when syntax highlighting is
+				  off, not available, etc)
+		May 16, 2014	* introduced the |netrw-ctrl-r| functionality
+		May 17, 2014	* introduced the |netrw-:NetrwMB| functionality
+				* mb and mB (|netrw-mb|, |netrw-mB|) will
+				  add/remove marked files from bookmark list
+		May 20, 2014	* (Enno Nagel) reported that :Lex <dirname>
+				  wasn't working.  Fixed.
+		May 26, 2014	* restored test to prevent leftmouse window
+				  resizing from causing refresh.
+				  (see s:NetrwLeftmouse())
+				* fixed problem where a refresh caused cursor
+				  to go just under the banner instead of
+				  staying put
+		May 28, 2014	* (László Bimba) provided a patch for opening
+				  the |:Lexplore| window 100% high, optionally
+				  on the right, and will work with remote
+				  files.
+		May 29, 2014	* implemented :NetrwC  (see |netrw-:NetrwC|)
+		Jun 01, 2014	* Removed some "silent"s from commands used
+				  to implemented scp://... and pscp://...
+				  directory listing.  Permits request for
+				  password to appear.
+		Jun 05, 2014	* (Enno Nagel) reported that user maps "/"
+				  caused problems with "b" and "w", which
+				  are mapped (for wide listings only) to
+				  skip over files rather than just words.
+		Jun 10, 2014	* |g:netrw_gx| introduced to allow users to
+				  override default "<cfile>" with the gx
+				  (|netrw-gx|) map
+		Jun 11, 2014	* gx (|netrw-gx|), with |'autowrite'| set,
+				  will write modified files.  s:NetrwBrowseX()
+				  will now save, turn off, and restore the
+				  |'autowrite'| setting.
+		Jun 13, 2014	* added visual map for gx use
+		Jun 15, 2014	* (Enno Nagel) reported that with having hls
+				  set and wide listing style in use, that the
+				  b and w maps caused unwanted highlighting.
+		Jul 05, 2014	* |netrw-mv| and |netrw-mX| commands included
+		Jul 09, 2014	* |g:netrw_keepj| included, allowing optional
+				  keepj
+		Jul 09, 2014	* fixing bugs due to previous update
+		Jul 21, 2014	* (Bruno Sutic) provided an updated
+				  netrw_gitignore.vim
+		Jul 30, 2014	* (Yavuz Yetim) reported that editing two
+				  remote files of the same name caused the
+				  second instance to have a "temporary"
+				  name.  Fixed: now they use the same buffer.
+		Sep 18, 2014	* (Yasuhiro Matsumoto) provided a patch which
+				  allows scp and windows local paths to work.
+		Oct 07, 2014	* gx (see |netrw-gx|) when atop a directory,
+				  will now do |gf| instead
+		Nov 06, 2014	* For cygwin: cygstart will be available for
+				  netrw#BrowseX() to use if its executable.
+		Nov 07, 2014	* Began support for file://... urls.  Will use
+				  |g:netrw_file_cmd| (typically elinks or links)
+		Dec 02, 2014	* began work on having mc (|netrw-mc|) copy
+				  directories.  Works for linux machines,
+				  cygwin+vim, but not for windows+gvim.
+		Dec 02, 2014	* in tree mode, netrw was not opening
+				  directories via symbolic links.
+		Dec 02, 2014	* added resolved link information to
+				  thin and tree modes
+		Dec 30, 2014	* (issue#231) |:ls| was not showing
+				  remote-file buffers reliably.  Fixed.
+	v152:	Apr 08, 2014	* uses the |'noswapfile'| option (requires {{{2
 				  vim 7.4 with patch 213)
 				* (Enno Nagel) turn |'rnu'| off in netrw
 				  buffers.
@@ -3240,7 +3598,7 @@ which is loaded automatically at startup (assuming :set nocp).
 				  chgwin window.
 		May 09, 2014	* SavePosn was "saving filename under cursor"
 				  from a non-netrw window when using :Rex.
-	v151:	Jan 22, 2014	* extended :Rexplore to return to buffer
+	v151:	Jan 22, 2014	* extended :Rexplore to return to buffer {{{2
 				  prior to Explore or editing a directory
 				* (Ken Takata) netrw gave error when
 				  clipboard was disabled.  Sol'n: Placed
@@ -3287,7 +3645,7 @@ which is loaded automatically at startup (assuming :set nocp).
 				  and it also handles Window's shares
 				* Fixed |netrw-d| command when applied with ftp
 				* https: support included for netrw#NetRead()
-	v150:	Jul 12, 2013	* removed a "keepalt" to allow ":e #" to
+	v150:	Jul 12, 2013	* removed a "keepalt" to allow ":e #" to {{{2
 				  return to the netrw directory listing
 		Jul 13, 2013	* (Jonas Diemer) suggested changing
 				  a <cWORD> to <cfile>.
@@ -3342,7 +3700,7 @@ which is loaded automatically at startup (assuming :set nocp).
 				  style, with a previous window open, that
 				  the wrong directory was being used to open
 				  a file.  Fixed. (P21)
-	v149:	Apr 18, 2013	* in wide listing format, now have maps for
+	v149:	Apr 18, 2013	* in wide listing format, now have maps for {{{2
 				  w and b to move to next/previous file
 		Apr 26, 2013	* one may now copy files in the same
 				  directory; netrw will issue requests for
@@ -3356,133 +3714,9 @@ which is loaded automatically at startup (assuming :set nocp).
 				  requested by Paul Domaskis.
 		Jul 03, 2013	* Explore now avoids splitting when a buffer
 				  will be hidden.
-	v148:	Apr 16, 2013	* changed Netrw's Style menu to allow direct
+	v148:	Apr 16, 2013	* changed Netrw's Style menu to allow direct {{{2
 				  choice of listing style, hiding style, and
 				  sorting style
-	v147:	Nov 24, 2012	* (James McCoy) Even with g:netrw_dirhistmax
-				  at zero, the .vim/ directory would be
-				  created to support history/bookmarks.  I've
-				  gone over netrw to suppress history and
-				  bookmarking when g:netrw_dirhistmax is zero.
-				  For instance, the menus will display
-				  (disabled) when attempts to use
-				  bookmarks/history are made.
-		Nov 29, 2012	* (Kim Jang-hwan) reported that with
-				  g:Align_xstrlen set to 3 that the cursor was
-				  moved (linewise) after invocation.  This
-				  problem also afflicted netrw.
-				  (see |g:netrw_xstrlen|) Fixed.
-		Jan 21, 2013	* (mattn) provided a patch to insert some
-				  endifs needed with the code implementing
-				  |netrw-O|.
-		Jan 24, 2013	* (John Szakmeister) found that remote file
-				  editing resulted in filetype options being
-				  overwritten by NetrwOptionRestore().  I
-				  moved filetype detect from NetrwGetFile()
-				  to NetrwOptionRestore.
-		Feb 17, 2013	* (Yukhiro Nakadaira) provided a patch
-				  correcting some syntax errors.
-		Feb 28, 2013	* (Ingo Karkat) provided a patch preventing
-				  receipt of an |E95| when revisiting a
-				  file://... style url.
-		Mar 18, 2013	* (Gary Johnson) pointed out that changing
-				  cedit to <Esc> caused problems with visincr;
-				  the cedit setting is now bypassed in netrw too.
-		Apr 02, 2013	* (Paul Domaskis) reported an undefined
-				  variable error (s:didstarstar) was
-				  occurring.  It is now defined at
-				  initialization.
-				* included additional sanity checking for the
-				  marked file functions.
-				* included |netrw-qF| and special "j" option
-				  handling for |netrw-mg|
-		Apr 12, 2013	* |netrw-u| and |netrw-U| now handle counts
-				* the former mapping for "T" has been removed;
-				  in its place are new maps, |netrw-Tb| and |netrw-Th|.
-				* the menu now supports a "Targets" entry for
-				  easier target selection. (see |netrw-mt|)
-				* (Paul Domaskis) reported some problems with
-				  moving/copying files under Windows' gvim
-				  (ie. not cygwin).  Fixed.
-				* (Paul Mueller) provided a patch to get
-				  start and rundll working via |netrw-gx|
-				  by bypassing the user's |'shellslash'| option.
-	v146:	Oct 20, 2012	* (David Kotchan) reported that under Windows,
-				  directories named with unusual characters
-				  such as "#" or "$" were not being listed
-				  properly.
-				* (Kenny Lee) reported that the buffer list
-				  was being populated by netrw buffers.
-				  Netrw will now |:bwipe| netrw buffers
-				  upon editing a file if g:netrw_fastbrowse
-				  is zero and its not in tree listing style.
-				* fixed a bug with s:NetrwInit() that
-				  prevented initialization with |Lists| and
-				  |Dictionaries|.
-				* |netrw-mu| now unmarks marked-file lists
-	v145:	Apr 05, 2012	* moved some command from a g:netrw_local_...
-				  format to g:netwr_local... format
-				* included some NOTE level messages about
-				  commands that aren't executable
-				* |g:netrw_errorlvl| (default: NOTE=0)
-				  option introduced
-		May 18, 2012	* (Ilya Dogolazky) a scenario where a
-				  |g:netrw_fastbrowse| of zero did not
-				  have a local directory refreshed fixed.
-		Jul 10, 2012	* (Donatas) |netrw-gb| wasn't working due
-				  to an incorrectly used variable.
-		Aug 09, 2012	* (Bart Baker) netrw was doubling
-				  of entries after a split.
-				* (code by Takahiro Yoshihara) implemented
-				  |g:netrw_dynamic_maxfilenamelen|
-		Aug 31, 2012	* (Andrew Wong) netrw refresh overwriting
-				  the yank buffer.
-	v144: Mar 12, 2012	* when |CTRL-W_s| or |CTRL-W_v| are used,
-				  or their wincmd equivalents, on a netrw
-				  buffer, the netrw's w: variables were
-				  not copied over.  Fixed.
-		Mar 13, 2012	* nbcd_curpos_{bufnr('%')} was commented
-				  out, and was mistakenly used during
-				  RestorePosn.  Unfortunately, I'm not
-				  sure why it was commented out, so this
-				  "fix" may re-introduce an earlier problem.
-		Mar 21, 2012	* included s:rexposn internally to make
-				  :Rex return the cursor to the same pos'n
-				  upon restoration of netrw buffer
-		Mar 27, 2012	* (sjbesse) s:NetrwGetFile() needs to remove
-				  "/" from the netrw buffer's usual |'isk'|
-				  in order to allow "filetype detect" to work
-				  properly for scripts.
-	v143: Jun 01, 2011	* |g:netrw_winsize| will accept a negative
-				  number; the absolute value of it will then
-				  be used to specify lines/columns instead of
-				  a percentage.
-		Jul 05, 2011	* the "d" map now supports mkdir via ftp
-				  See |netrw-d| and |g:netrw_remote_mkdir|
-		Jul 11, 2011	* Changed Explore!, Sexplore!, and Vexplore
-				  to use a percentage of |winwidth()| instead
-				  of a percentage of |winheight()|.
-		Jul 11, 2011	* included support for https://... I'm just
-				  beginning to test this, however.
-		Aug 01, 2011	* changed RestoreOptions to also restore
-				  cursor position in netrw buffers.
-		Aug 12, 2011	* added a note about "%" to the balloon
-		Aug 30, 2011	* if |g:netrw_nobeval| exists, then balloon
-				  evaluation is suppressed.
-		Aug 31, 2011	* (Benjamin R Haskell) provided a patch that
-				  implements non-standard port handling for
-				  files opened via the remote browser.
-		Aug 31, 2011	* Fixed a **//pattern  Explorer bug
-		Sep 15, 2011	* (reported by Francesco Campana) netrw
-				  now permits the "@" to be part of the
-				  user id (if there's an @ that appears
-				  to the right).
-		Nov 21, 2011	* New option: |g:netrw_ftp_options|
-		Dec 07, 2011	* (James Sinclair) provided a fix handling
-				  attempts to use a uid and password when
-				  they weren't defined.  This affected
-				  NetWrite (NetRead already had that fix).
-
 
 ==============================================================================
 13. Todo						*netrw-todo* {{{1
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index edeef6655e..01be75accd 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt*    For Vim version 7.4.  Last change: 2014 Oct 29
+*repeat.txt*    For Vim version 7.4.  Last change: 2015 Jan 07
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -235,8 +235,8 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
 			command is ignored.
 			{not in Vi}
 
-						*:scrip* *:scriptnames*
-:scrip[tnames]		List all sourced script names, in the order they were
+						*:scr* *:scriptnames*
+:scr[iptnames]		List all sourced script names, in the order they were
 			first sourced.  The number is used for the script ID
 			|<SID>|.
 			{not in Vi} {not available when compiled without the
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index efb7bda661..c4964bcf3f 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 7.4.  Last change: 2014 Nov 19
+*syntax.txt*	For Vim version 7.4.  Last change: 2015 Jan 07
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1128,6 +1128,14 @@ to standard by placing this in your vimrc file: >
 	:let enforce_freedesktop_standard = 1
 
 
+DIFF							*diff.vim*
+
+The diff highlighting normally finds translated headers.  This can be slow if
+there are very long lines in the file.  To disable translations: >
+
+	:let diff_translations = 0
+
+
 DIRCOLORS			       *dircolors.vim* *ft-dircolors-syntax*
 
 The dircolors utility highlighting definition has one option.  It exists to
diff --git a/runtime/doc/tags b/runtime/doc/tags
index ae7e22f7d8..027df9ac5e 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -1398,6 +1398,8 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 .dic	spell.txt	/*.dic*
 .exrc	starting.txt	/*.exrc*
 .gvimrc	gui.txt	/*.gvimrc*
+.netrwbook	pi_netrw.txt	/*.netrwbook*
+.netrwhist	pi_netrw.txt	/*.netrwhist*
 .vimrc	starting.txt	/*.vimrc*
 /	pattern.txt	/*\/*
 /$	pattern.txt	/*\/$*
@@ -2726,7 +2728,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 :sbr	windows.txt	/*:sbr*
 :sbrewind	windows.txt	/*:sbrewind*
 :sbuffer	windows.txt	/*:sbuffer*
-:scrip	repeat.txt	/*:scrip*
+:scr	repeat.txt	/*:scr*
 :scripte	repeat.txt	/*:scripte*
 :scriptencoding	repeat.txt	/*:scriptencoding*
 :scriptnames	repeat.txt	/*:scriptnames*
@@ -2761,7 +2763,6 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 :sfirst	windows.txt	/*:sfirst*
 :sh	various.txt	/*:sh*
 :shell	various.txt	/*:shell*
-:si	gui_w32.txt	/*:si*
 :sig	sign.txt	/*:sig*
 :sign	sign.txt	/*:sign*
 :sign-define	sign.txt	/*:sign-define*
@@ -2774,6 +2775,7 @@ $VIMRUNTIME	starting.txt	/*$VIMRUNTIME*
 :sign-unplace	sign.txt	/*:sign-unplace*
 :sil	various.txt	/*:sil*
 :silent	various.txt	/*:silent*
+:sim	gui_w32.txt	/*:sim*
 :simalt	gui_w32.txt	/*:simalt*
 :sl	various.txt	/*:sl*
 :sla	windows.txt	/*:sla*
@@ -5415,6 +5417,7 @@ diff-options	diff.txt	/*diff-options*
 diff-original-file	diff.txt	/*diff-original-file*
 diff-patchexpr	diff.txt	/*diff-patchexpr*
 diff.txt	diff.txt	/*diff.txt*
+diff.vim	syntax.txt	/*diff.vim*
 diff_filler()	eval.txt	/*diff_filler()*
 diff_hlID()	eval.txt	/*diff_hlID()*
 digraph	digraph.txt	/*digraph*
@@ -6008,6 +6011,7 @@ g:netrw_errorlvl	pi_netrw.txt	/*g:netrw_errorlvl*
 g:netrw_fastbrowse	pi_netrw.txt	/*g:netrw_fastbrowse*
 g:netrw_fetch_cmd	pi_netrw.txt	/*g:netrw_fetch_cmd*
 g:netrw_ffkeep	pi_netrw.txt	/*g:netrw_ffkeep*
+g:netrw_file_cmd	pi_netrw.txt	/*g:netrw_file_cmd*
 g:netrw_fname_escape	pi_netrw.txt	/*g:netrw_fname_escape*
 g:netrw_ftp	pi_netrw.txt	/*g:netrw_ftp*
 g:netrw_ftp_browse_reject	pi_netrw.txt	/*g:netrw_ftp_browse_reject*
@@ -6019,6 +6023,7 @@ g:netrw_ftp_timelist_cmd	pi_netrw.txt	/*g:netrw_ftp_timelist_cmd*
 g:netrw_ftpextracmd	pi_netrw.txt	/*g:netrw_ftpextracmd*
 g:netrw_ftpmode	pi_netrw.txt	/*g:netrw_ftpmode*
 g:netrw_glob_escape	pi_netrw.txt	/*g:netrw_glob_escape*
+g:netrw_gx	pi_netrw.txt	/*g:netrw_gx*
 g:netrw_hide	pi_netrw.txt	/*g:netrw_hide*
 g:netrw_home	pi_netrw.txt	/*g:netrw_home*
 g:netrw_http_cmd	pi_netrw.txt	/*g:netrw_http_cmd*
@@ -6026,10 +6031,13 @@ g:netrw_http_put_cmd	pi_netrw.txt	/*g:netrw_http_put_cmd*
 g:netrw_http_xcmd	pi_netrw.txt	/*g:netrw_http_xcmd*
 g:netrw_ignorenetrc	pi_netrw.txt	/*g:netrw_ignorenetrc*
 g:netrw_keepdir	pi_netrw.txt	/*g:netrw_keepdir*
+g:netrw_keepj	pi_netrw.txt	/*g:netrw_keepj*
 g:netrw_list_cmd	pi_netrw.txt	/*g:netrw_list_cmd*
+g:netrw_list_cmd_options	pi_netrw.txt	/*g:netrw_list_cmd_options*
 g:netrw_list_hide	pi_netrw.txt	/*g:netrw_list_hide*
 g:netrw_liststyle	pi_netrw.txt	/*g:netrw_liststyle*
 g:netrw_localcopycmd	pi_netrw.txt	/*g:netrw_localcopycmd*
+g:netrw_localcopydircmd	pi_netrw.txt	/*g:netrw_localcopydircmd*
 g:netrw_localmkdir	pi_netrw.txt	/*g:netrw_localmkdir*
 g:netrw_localmovecmd	pi_netrw.txt	/*g:netrw_localmovecmd*
 g:netrw_localrmdir	pi_netrw.txt	/*g:netrw_localrmdir*
@@ -6050,6 +6058,7 @@ g:netrw_rsync_cmd	pi_netrw.txt	/*g:netrw_rsync_cmd*
 g:netrw_scp_cmd	pi_netrw.txt	/*g:netrw_scp_cmd*
 g:netrw_scpport	pi_netrw.txt	/*g:netrw_scpport*
 g:netrw_sepchr	pi_netrw.txt	/*g:netrw_sepchr*
+g:netrw_servername	pi_netrw.txt	/*g:netrw_servername*
 g:netrw_sftp_cmd	pi_netrw.txt	/*g:netrw_sftp_cmd*
 g:netrw_silent	pi_netrw.txt	/*g:netrw_silent*
 g:netrw_sort_by	pi_netrw.txt	/*g:netrw_sort_by*
@@ -6998,6 +7007,8 @@ netrw-:Hexplore	pi_netrw.txt	/*netrw-:Hexplore*
 netrw-:Lexplore	pi_netrw.txt	/*netrw-:Lexplore*
 netrw-:MF	pi_netrw.txt	/*netrw-:MF*
 netrw-:MT	pi_netrw.txt	/*netrw-:MT*
+netrw-:NetrwC	pi_netrw.txt	/*netrw-:NetrwC*
+netrw-:NetrwMB	pi_netrw.txt	/*netrw-:NetrwMB*
 netrw-:Rexplore	pi_netrw.txt	/*netrw-:Rexplore*
 netrw-:Sexplore	pi_netrw.txt	/*netrw-:Sexplore*
 netrw-:Texplore	pi_netrw.txt	/*netrw-:Texplore*
@@ -7006,6 +7017,7 @@ netrw-C	pi_netrw.txt	/*netrw-C*
 netrw-D	pi_netrw.txt	/*netrw-D*
 netrw-O	pi_netrw.txt	/*netrw-O*
 netrw-P	pi_netrw.txt	/*netrw-P*
+netrw-P18	pi_netrw.txt	/*netrw-P18*
 netrw-R	pi_netrw.txt	/*netrw-R*
 netrw-S	pi_netrw.txt	/*netrw-S*
 netrw-Tb	pi_netrw.txt	/*netrw-Tb*
@@ -7035,6 +7047,7 @@ netrw-createfile	pi_netrw.txt	/*netrw-createfile*
 netrw-credits	pi_netrw.txt	/*netrw-credits*
 netrw-ctrl-h	pi_netrw.txt	/*netrw-ctrl-h*
 netrw-ctrl-l	pi_netrw.txt	/*netrw-ctrl-l*
+netrw-ctrl-r	pi_netrw.txt	/*netrw-ctrl-r*
 netrw-ctrl_l	pi_netrw.txt	/*netrw-ctrl_l*
 netrw-curdir	pi_netrw.txt	/*netrw-curdir*
 netrw-d	pi_netrw.txt	/*netrw-d*
@@ -7061,6 +7074,7 @@ netrw-gf	pi_netrw.txt	/*netrw-gf*
 netrw-gh	pi_netrw.txt	/*netrw-gh*
 netrw-gitignore	pi_netrw.txt	/*netrw-gitignore*
 netrw-gp	pi_netrw.txt	/*netrw-gp*
+netrw-grep	pi_netrw.txt	/*netrw-grep*
 netrw-gx	pi_netrw.txt	/*netrw-gx*
 netrw-handler	pi_netrw.txt	/*netrw-handler*
 netrw-help	pi_netrw.txt	/*netrw-help*
@@ -7082,6 +7096,7 @@ netrw-login	pi_netrw.txt	/*netrw-login*
 netrw-mB	pi_netrw.txt	/*netrw-mB*
 netrw-mF	pi_netrw.txt	/*netrw-mF*
 netrw-mT	pi_netrw.txt	/*netrw-mT*
+netrw-mX	pi_netrw.txt	/*netrw-mX*
 netrw-mb	pi_netrw.txt	/*netrw-mb*
 netrw-mc	pi_netrw.txt	/*netrw-mc*
 netrw-md	pi_netrw.txt	/*netrw-md*
@@ -7099,6 +7114,7 @@ netrw-mr	pi_netrw.txt	/*netrw-mr*
 netrw-ms	pi_netrw.txt	/*netrw-ms*
 netrw-mt	pi_netrw.txt	/*netrw-mt*
 netrw-mu	pi_netrw.txt	/*netrw-mu*
+netrw-mv	pi_netrw.txt	/*netrw-mv*
 netrw-mx	pi_netrw.txt	/*netrw-mx*
 netrw-mz	pi_netrw.txt	/*netrw-mz*
 netrw-netrc	pi_netrw.txt	/*netrw-netrc*
@@ -7118,6 +7134,7 @@ netrw-p13	pi_netrw.txt	/*netrw-p13*
 netrw-p14	pi_netrw.txt	/*netrw-p14*
 netrw-p15	pi_netrw.txt	/*netrw-p15*
 netrw-p16	pi_netrw.txt	/*netrw-p16*
+netrw-p17	pi_netrw.txt	/*netrw-p17*
 netrw-p2	pi_netrw.txt	/*netrw-p2*
 netrw-p3	pi_netrw.txt	/*netrw-p3*
 netrw-p4	pi_netrw.txt	/*netrw-p4*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index d114d36c59..f0d6668be2 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2014 Dec 14
+*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 07
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -54,6 +54,7 @@ Regexp problems:
 - Using back reference before the capturing group sometimes works with the old
   engine, can we do this with the new engine?  E.g. with
   "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
+- Diff highlighting can be very slow. (Issue 309)
 
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
 More info Jul 24.  Not clear why.
@@ -65,41 +66,24 @@ Breaks test_eval.  Inefficient, can we only compute y_width when needed?
 Problem that a previous silent ":throw" causes a following try/catch not to
 work. (ZyX, 2013 Sep 28)
 
+Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
+
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
 Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
 
-Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
-
 Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 
-When window number in Ex range is too high, should give an error:
-    :3close  " fails if there are only 2 windows.
-Patch from Marcin Szamotulski, 2014 Dec 13.
-
-Patch to recover from X server restart: hint on Issue 203 (2014 Nov 21 18:44)
-
-Insert a block with virtualedit set does not work correctly.
-Patch by James McCoy, 2014 Dec 10.
-
 MS-Windows: When editing a file with a leading space, writing it uses the
 wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
 
-Add LessCss support. (Jenoma / Alessandro Vioni, 2014 Nov 24)
-Now with updated license, Nov 24.
-
-Memory leak using :wviminfo. Issue 296.  With Patch by Christian.
-
-patch to remove FEAT_OSFILETYPE from fileio.c. (Christian, 2014 Nov 12)
+Patch to fix unnecessary redraw of vertical separators.
+(Thiago Padilha, 2015 Jan 5, second version)
 
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
-Patch to also support range for :argdo, :bufdo, etc.
-(Marcin Szamotulski, 2014 Dec 7)
-Asked for tests.
-
 Ukrainian vimtutor. (Issue 288)
 
 Regenerate the Unicode tables in mbyte.c.
@@ -108,19 +92,30 @@ Diff from ZyX, 2014 Dec 6.
 Patch to fix relative numbers. (Christian Brabandt, 2014 Nov 17)
 Update Nov 26.
 
+Patch to improve config.vim syntax.  Issue 305.  Maintainer last update was in
+2008.
+
 Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
 (Hirohito Higashi, 2014 Dec 8)
 
+Better greek spell checking.  Issue 299.
+
 Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
 Nov 12)
 
 Patch to avoid recognizing polkit as hog files. (Issue 292)
 
+":0argedit foo" puts new argument in second place instead of first.
+Patch from Ingo Karkat, 2014 Dec 19.
+
 Patch 7.4.468 changed how CTRL-C is handled.  It does not take care of mapping
 CTRL-C in different modes. (Ingo Karkat, 2014 Dec 12)
 Patch from Christian Brabandt, 2014 Dec 13.
 Needs to be improved.
 
+Patch for greek characters on MS-Windows console. (Yasuhiro Matsumoto, 2014
+Dec 17)
+
 Patch to support hex values for setting option value.
 (Zyx, 2015 Nov 6)
 
@@ -131,6 +126,16 @@ Update Nov 5.
 MS-Windows: Crash opening very long file name starting with "\\".
 (Christian Brock, 2012 Jun 29)
 
+Patch for this from Marcin Szamotulski, 2014 Dec 28:
+8   Make the # register writable, so that it can be restored after jumping
+    around in windows.
+
+Using CTRL-L while popup menu is visible behaves like CTRL-P, which is wrong.
+Patch by Yasuhiro Matsumoto, 2015 Jan 5.
+Is this right?  Comment from Amadeus Demarzi.
+Another patch from Christian, Jan 6.
+Comment from Hirohito Higashi, Jan 6.
+
 Cursorline background color not mixed with character highlight.
 Patch by Yasuhiro Matsumoto, 2014 Dec 3.
 
@@ -143,9 +148,19 @@ ml_updatechunk() is slow when retrying for another encoding. (John Little,
 Patch to add a different escape sequence for replace mode.
 (Omar Sandoval, 2014 Nov 30)
 
+Calling setreg() with an empty list doesn't work.
+Patch by Yasuhiro Matsumoto, 2014 Dec 14.
+
+Extended file attributes lost on write (backupcopy=no).  Issue 306.
+
+Window height computed incorrectly when Vim is minimized.
+Patch to fix this. (Ingo Karkat, 2014 Dec 19)
+
 Patch to allow values greater than 255 for ctermfg/ctermbg on Windows.
 (Yasuhiro Matsumoto, 2014 Dec 5)
 
+Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
+
 When 'balloonexpr' returns a list the result has a trailing newline.
 Just remove one trailing newline. (lcd, 2014 Oct 17)
 
@@ -190,6 +205,10 @@ was already defined.
 
 Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
 Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
+Updated patch by Roland Eggner, Dec 16
+Updated patch from Charles, Dec 29.
+
+Patch to open folds for 'incsearch'. (Christian Brabandt, 2015 Jan 6)
 
 Patch for building a 32bit Vim with 64bit MingW compiler.
 (Michael Soyka, 2014 Oct 15)
@@ -200,6 +219,8 @@ Redo only remembers the last change.  Could use "{count}g." to redo an older
 change.  How does the user know which change?  At least have a way to list
 them: ":repeats".
 
+Patch for glob(), adding slash to normal files. (Ingo Karkat, 2014 Dec 22)
+
 Using "." to repeat an Ex command puts that command in history.  Probably
 should not happen.  If the command is the result of a mapping it's not put in
 history either. (Jacob Niehus, 2014 Nov 2)
@@ -233,6 +254,9 @@ Spell files use a latin single quote. Unicode also has another single quote:
 New OpenOffice spell files support this with ICONV.  But they are not
 compatible with Vim spell files.  The old files can no longer be downloaded.
 
+Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
+Saito, 2013 Apr 24)
+
 Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
 More tests May 14. Update May 29.  Update Aug 10.
 
@@ -567,9 +591,6 @@ Patch to improve equivalence classes in regexp patterns.
 Patch with suggestions for starting.txt. (Tony Mechelynck, 2012 Oct 24)
 But use Gnome instead of GTK?
 
-Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
-Saito, 2013 Apr 24)
-
 Should be possible to enable/disable matchparen per window or buffer.
 Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin
 Szamotulski, 2012 Nov 8)
@@ -5076,8 +5097,6 @@ Argument list:
 
 Registers:
 8   Don't display empty registers with ":display". (Etienne)
-8   Make the # register writable, so that it can be restored after jumping
-    around in windows.
 8   Add put command that overwrites existing text.  Should also work for
     blocks.  Useful to move text around in a table.  Works like using "R ^R r"
     for every line.
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index e55642d142..019345baf7 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2014 Dec 06
+" Last Change:	2015 Jan 07
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -1052,6 +1052,9 @@ au BufNewFile,BufRead *.ldif			setf ldif
 " Ld loader
 au BufNewFile,BufRead *.ld			setf ld
 
+" Less
+au BufNewFile,BufRead *.less			setf less
+
 " Lex
 au BufNewFile,BufRead *.lex,*.l,*.lxx,*.l++	setf lex
 
diff --git a/runtime/ftplugin/less.vim b/runtime/ftplugin/less.vim
new file mode 100644
index 0000000000..637e9d292e
--- /dev/null
+++ b/runtime/ftplugin/less.vim
@@ -0,0 +1,20 @@
+" Vim filetype plugin
+" Language:	less
+" Maintainer:	Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change:	2014 November 24
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin = 1
+
+let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<"
+
+setlocal formatoptions-=t formatoptions+=croql
+
+setlocal comments=:// commentstring=//\ %s
+
+setlocal omnifunc=csscomplete#CompleteCSS
+setlocal suffixesadd=.less
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index 11b2b0a665..28b7e245b6 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language:	man
 " Maintainer:	SungHyun Nam <goweol@gmail.com>
-" Last Change:	2014 Nov 12
+" Last Change:	2014 Dec 29
 
 " To make the ":Man" command available before editing a manual page, source
 " this script from your startup vimrc file.
@@ -159,10 +159,10 @@ func <SID>GetPage(...)
   silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
   " Remove blank lines from top and bottom.
   while getline(1) =~ '^\s*$'
-    silent norm ggdd
+    silent keepj norm ggdd
   endwhile
   while getline('$') =~ '^\s*$'
-    silent norm Gdd
+    silent keepj norm Gdd
   endwhile
   1
   setl ft=man nomod
diff --git a/runtime/ftplugin/matlab.vim b/runtime/ftplugin/matlab.vim
index 6bfb3d7618..205111c3c2 100644
--- a/runtime/ftplugin/matlab.vim
+++ b/runtime/ftplugin/matlab.vim
@@ -1,7 +1,10 @@
 " Vim filetype plugin file
 " Language:	matlab
 " Maintainer:	Jake Wasserman <jwasserman at gmail dot com>
-" Last Changed: 2006 Jan 12
+" Last Changed: 2014 Dec 30
+
+" Contributors:
+" Charles Campbell
 
 if exists("b:did_ftplugin")
 	finish
@@ -12,10 +15,11 @@ let s:save_cpo = &cpo
 set cpo-=C
 
 if exists("loaded_matchit")
-	let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
-	let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' .
-		\ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' .
-		\ s:conditionalEnd
+ let s:conditionalEnd = '\%(([^()]*\)\@!\<end\>\%([^()]*)\)\@!'
+ let b:match_words=
+   \ '\<\%(if\|switch\|for\|while\)\>:\<\%(elseif\|case\|break\|continue\|else\|otherwise\)\>:'.s:conditionalEnd.','.
+   \ '\<function\>:\<return\>:\<endfunction\>'
+ unlet s:conditionalEnd
 endif
 
 setlocal suffixesadd=.m
diff --git a/runtime/indent/less.vim b/runtime/indent/less.vim
new file mode 100644
index 0000000000..82bf2d87fc
--- /dev/null
+++ b/runtime/indent/less.vim
@@ -0,0 +1,13 @@
+" Vim indent file
+" Language:	less
+" Maintainer:	Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change:	2014 November 24
+
+if exists("b:did_indent")
+  finish
+endif
+
+runtime! indent/css.vim
+
+" vim:set sw=2:
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index e3e79ddea8..cad4d31a04 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -1,6 +1,6 @@
 " netrwPlugin.vim: Handles file transfer and remote directory listing across a network
 "            PLUGIN SECTION
-" Date:		Jan 22, 2014
+" Date:		Nov 07, 2014
 " Maintainer:	Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
 " Copyright:    Copyright (C) 1999-2013 Charles E. Campbell {{{1
@@ -20,7 +20,7 @@
 if &cp || exists("g:loaded_netrwPlugin")
  finish
 endif
-let g:loaded_netrwPlugin = "v152"
+let g:loaded_netrwPlugin = "v153"
 if v:version < 702
  echohl WarningMsg
  echo "***warning*** you need vim version 7.2 for this version of netrw"
@@ -54,15 +54,15 @@ augroup END
 " Network Browsing Reading Writing: {{{2
 augroup Network
  au!
- au BufReadCmd   file://*									call netrw#FileUrlRead(expand("<amatch>"))
- au BufReadCmd   ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
- au FileReadCmd  ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
- au BufWriteCmd  ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://*		exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
- au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://*		exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
- try
-  au SourceCmd   ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>"))
- catch /^Vim\%((\a\+)\)\=:E216/
-  au SourcePre   ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>"))
+ au BufReadCmd   file://*											call netrw#FileUrlRead(expand("<amatch>"))
+ au BufReadCmd   ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
+ au FileReadCmd  ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
+ au BufWriteCmd  ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*			exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
+ au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://*			exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
+ try                                                       
+  au SourceCmd   ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>"))
+ catch /^Vim\%((\a\+)\)\=:E216/                            
+  au SourcePre   ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://*	exe 'Nsource '.fnameescape(expand("<amatch>"))
  endtry
 augroup END
 
@@ -81,18 +81,26 @@ com! -nargs=* -bar -bang -count=0 -complete=dir	Vexplore	call netrw#Explore(<cou
 com! -nargs=* -bar       -count=0 -complete=dir	Texplore	call netrw#Explore(<count>,0,6        ,<q-args>)
 com! -nargs=* -bar -bang			Nexplore	call netrw#Explore(-1,0,0,<q-args>)
 com! -nargs=* -bar -bang			Pexplore	call netrw#Explore(-2,0,0,<q-args>)
-com! -nargs=* -bar       	  -complete=dir Lexplore	call netrw#Lexplore(<q-args>)
+com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore	call netrw#Lexplore(<count>,<bang>0,<q-args>)
 
 " Commands: NetrwSettings {{{2
 com! -nargs=0	NetrwSettings	call netrwSettings#NetrwSettings()
 com! -bang	NetrwClean	call netrw#Clean(<bang>0)
 
 " Maps:
-if !exists("g:netrw_nogx") && maparg('gx','n') == ""
- if !hasmapto('<Plug>NetrwBrowseX')
-  nmap <unique> gx <Plug>NetrwBrowseX
+if !exists("g:netrw_nogx")
+ if maparg('gx','n') == ""
+  if !hasmapto('<Plug>NetrwBrowseX')
+   nmap <unique> gx <Plug>NetrwBrowseX
+  endif
+  nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>
+ endif
+ if maparg('gx','v') == ""
+  if !hasmapto('<Plug>NetrwBrowseXVis')
+   vmap <unique> gx <Plug>NetrwBrowseXVis
+  endif
+  vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
  endif
- nno <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cfile>"),0)<cr>
 endif
 
 " ---------------------------------------------------------------------
@@ -119,7 +127,7 @@ fun! s:LocalBrowse(dirname)
 "   call Decho("(LocalBrowse) dirname<".a:dirname.">  (isdirectory, amiga)")
    if a:dirname != '' && isdirectory(a:dirname)
     sil! call netrw#LocalBrowseCheck(a:dirname)
-    if exists("w:netrw_bannercnt")
+    if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
      exe w:netrw_bannercnt
     endif
    endif
@@ -128,7 +136,7 @@ fun! s:LocalBrowse(dirname)
 "   call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft."  (isdirectory, not amiga)")
 "   call Dredir("LocalBrowse ft last set: ","verbose set ft")
    sil! call netrw#LocalBrowseCheck(a:dirname)
-   if exists("w:netrw_bannercnt")
+   if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
     exe w:netrw_bannercnt
    endif
 
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
index a0005140b2..ff69c5860b 100644
--- a/runtime/syntax/diff.vim
+++ b/runtime/syntax/diff.vim
@@ -2,7 +2,7 @@
 " Language:	Diff (context or unified)
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
 "               Translations by Jakson Alves de Aquino.
-" Last Change:	2014 Nov 12
+" Last Change:	2015 Jan 07
 
 " Quit when a (custom) syntax file was already loaded
 if exists("b:current_syntax")
@@ -18,6 +18,9 @@ syn match diffIsA	"^File .* is a .* while file .* is a .*"
 syn match diffNoEOL	"^\\ No newline at end of file .*"
 syn match diffCommon	"^Common subdirectories: .*"
 
+" Disable the translations by setting diff_translations to zero.
+if !exists("diff_translations") || diff_translations
+
 " ca
 syn match diffOnly	"^Només a .*"
 syn match diffIdentical	"^Els fitxers .* i .* són idèntics$"
@@ -320,6 +323,8 @@ syn match diffIsA	"^檔案 .* 是.*而檔案 .* 是.*"
 syn match diffNoEOL	"^\\ 檔案末沒有 newline 字元"
 syn match diffCommon	"^.* 和 .* 有共同的副目錄$"
 
+endif
+
 
 syn match diffRemoved	"^-.*"
 syn match diffRemoved	"^<.*"
diff --git a/runtime/syntax/html.vim b/runtime/syntax/html.vim
index d59126dede..ab1f9b3c13 100644
--- a/runtime/syntax/html.vim
+++ b/runtime/syntax/html.vim
@@ -2,7 +2,8 @@
 " Language:	HTML
 " Maintainer:	Claudio Fleiner <claudio@fleiner.com>
 " URL:		http://www.fleiner.com/vim/syntax/html.vim
-" Last Change:	2012 Oct 05
+" Last Change:	2015 Jan 07
+"		included patch from David Felix
 
 " Please check :help html.vim for some comments and a description of the options
 
@@ -168,7 +169,7 @@ if main_syntax != 'java' || exists("java_javascript")
   " JAVA SCRIPT
   syn include @htmlJavaScript syntax/javascript.vim
   unlet b:current_syntax
-  syn region  javaScript start=+<script\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+  syn region  javaScript start=+<script\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
   syn region  htmlScriptTag     contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
   HtmlHiLink htmlScriptTag htmlTag
 
@@ -193,7 +194,7 @@ if main_syntax != 'java' || exists("java_vb")
   " VB SCRIPT
   syn include @htmlVbScript syntax/vb.vim
   unlet b:current_syntax
-  syn region  javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+  syn region  javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
 endif
 
 syn cluster htmlJavaScript      add=@htmlPreproc
diff --git a/runtime/syntax/less.vim b/runtime/syntax/less.vim
new file mode 100644
index 0000000000..5cc8c6d7bd
--- /dev/null
+++ b/runtime/syntax/less.vim
@@ -0,0 +1,79 @@
+" Vim syntax file
+" Language:	less
+" Maintainer:	Alessandro Vioni <jenoma@gmail.com>
+" URL: https://github.com/genoma/vim-less
+" Last Change:	2014 November 24
+
+if exists("b:current_syntax")
+  finish
+endif
+
+runtime! syntax/css.vim
+runtime! after/syntax/css.vim
+
+syn case ignore
+
+syn cluster lessCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp
+syn cluster lessCssAttributes contains=css.*Attr,lessEndOfLineComment,lessComment,cssValue.*,cssColor,cssURL,lessDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
+
+syn region lessDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
+
+syn match lessProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:" contains=css.*Prop skipwhite nextgroup=lessCssAttribute contained containedin=lessDefinition
+syn match lessProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+\s*:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
+syn match lessProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=lessCssAttribute
+syn match lessCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@lessCssAttributes,lessVariable,lessFunction,lessInterpolation
+syn match lessDefault "!default\>" contained
+
+" less variables and media queries
+syn match lessVariable "@[[:alnum:]_-]\+" nextgroup=lessCssAttribute skipwhite
+syn match lessMedia "@media" nextgroup=lessCssAttribute skipwhite
+
+" Less functions
+syn match lessFunction "\<\%(escape\|e\|unit\)\>(\@=" contained
+syn match lessFunction "\<\%(ceil\|floor\|percentage\|round\|sqrt\|abs\|sin\|asin\|cos\|acos\|tan\|atan\|pi\|pow\|min\|max\)\>(\@=" contained
+syn match lessFunction "\<\%(rgb\|rgba\|argb\|argb\|hsl\|hsla\|hsv\|hsva\)\>(\@=" contained
+syn match lessFunction "\<\%(hue\|saturation\|lightness\|red\|green\|blue\|alpha\|luma\)\>(\@=" contained
+syn match lessFunction "\<\%(saturate\|desaturate\|lighten\|darken\|fadein\|fadeout\|fade\|spin\|mix\|greyscale\|contrast\)\>(\@=" contained
+syn match lessFunction "\<\%(multiply\|screen\|overlay\|softlight\|hardlight\|difference\|exclusion\|average\|negation\)\>(\@=" contained
+
+" Less id class visualization
+syn match lessIdChar     "#[[:alnum:]_-]\@=" nextgroup=lessId,lessClassIdCall
+syn match lessId         "[[:alnum:]_-]\+" contained
+syn match lessClassIdCall  "[[:alnum:]_-]\+()" contained
+
+syn match lessClassChar  "\.[[:alnum:]_-]\@=" nextgroup=lessClass,lessClassCall
+syn match lessClass      "[[:alnum:]_-]\+" contained
+syn match lessClassCall  "[[:alnum:]_-]\+()" contained
+
+syn match lessAmpersand  "&" contains=lessIdChar,lessClassChar
+
+syn region lessInclude start="@import" end=";\|$" contains=lessComment,cssURL,cssUnicodeEscape,cssMediaType,cssStringQ,cssStringQQ
+
+syn keyword lessTodo        FIXME NOTE TODO OPTIMIZE XXX contained
+syn region  lessComment     start="^\z(\s*\)//"  end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
+syn region  lessCssComment  start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=lessTodo,@Spell
+syn match   lessEndOfLineComment "//.*" contains=lessComment,lessTodo,@Spell
+
+hi def link lessEndOfLineComment        lessComment
+hi def link lessCssComment              lessComment
+hi def link lessComment                 Comment
+hi def link lessDefault                 cssImportant
+hi def link lessVariable                Identifier
+hi def link lessFunction                PreProc
+hi def link lessTodo                    Todo
+hi def link lessInclude                 Include
+hi def link lessIdChar                  Special
+hi def link lessClassChar               Special
+hi def link lessAmpersand               Character
+hi def link lessId                      Identifier
+hi def link lessClass                   Type
+hi def link lessCssAttribute            PreProc
+hi def link lessClassCall               Type
+hi def link lessClassIdCall             Type
+hi def link lessTagName                 cssTagName
+hi def link lessDeprecated              cssDeprecated
+hi def link lessMedia                   cssMedia
+
+let b:current_syntax = "less"
+
+" vim:set sw=2:
diff --git a/runtime/syntax/netrw.vim b/runtime/syntax/netrw.vim
index 16e3c90c44..980fe5dde5 100644
--- a/runtime/syntax/netrw.vim
+++ b/runtime/syntax/netrw.vim
@@ -1,7 +1,7 @@
 " Language   : Netrw Remote-Directory Listing Syntax
-" Maintainer : Charles E. Campbell, Jr.
-" Last change: Mar 07, 2014
-" Version    : 18
+" Maintainer : Charles E. Campbell
+" Last change: Oct 06, 2014
+" Version    : 19
 " ---------------------------------------------------------------------
 
 " Syntax Clearing: {{{1
@@ -16,7 +16,7 @@ endif
 syn cluster NetrwGroup		contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
 syn cluster NetrwTreeGroup	contains=netrwDir,netrwSymLink,netrwExe
 
-syn match  netrwPlain		"\(\S\+ \)*\S\+"					contains=@NoSpell
+syn match  netrwPlain		"\(\S\+ \)*\S\+"					contains=netrwLink,@NoSpell
 syn match  netrwSpecial		"\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)"		contains=netrwClassify,@NoSpell
 syn match  netrwDir		"\.\{1,2}/"						contains=netrwClassify,@NoSpell
 "syn match  netrwDir		"\%(\S\+ \)*\S\+/"					contains=netrwClassify,@NoSpell
@@ -24,7 +24,11 @@ syn match  netrwDir		"\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)"			contains=netrwClassi
 syn match  netrwSizeDate	"\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s"	skipwhite	contains=netrwDateSep,@NoSpell	nextgroup=netrwTime
 syn match  netrwSymLink		"\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)"  			contains=netrwClassify,@NoSpell
 syn match  netrwExe		"\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" 		contains=netrwClassify,@NoSpell
+if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
 syn match  netrwTreeBar		"^\%([-+|│] \)\+"					contains=netrwTreeBarSpace	nextgroup=@netrwTreeGroup
+else
+syn match  netrwTreeBar		"^\%([-+|] \)\+"					contains=netrwTreeBarSpace	nextgroup=@netrwTreeGroup
+endif
 syn match  netrwTreeBarSpace	" "					contained
 
 syn match  netrwClassify	"[*=|@/]\ze\%(\s\{2,}\|$\)"		contained
@@ -44,10 +48,11 @@ syn match  netrwList		".*$"				contained		contains=netrwComma,@NoSpell
 syn match  netrwComma		","				contained
 syn region netrwQuickHelp	matchgroup=Comment start="Quick Help:\s\+" end="$"	contains=netrwHelpCmd,netrwQHTopic,@NoSpell	keepend contained
 syn match  netrwHelpCmd		"\S\+\ze:"			contained skipwhite	contains=@NoSpell		nextgroup=netrwCmdSep
-syn match  netrwQHTopic		"-\a\+-"			contained skipwhite
+syn match  netrwQHTopic		"([a-zA-Z &]\+)"		contained skipwhite
 syn match  netrwCmdSep		":"				contained nextgroup=netrwCmdNote
 syn match  netrwCmdNote		".\{-}\ze  "			contained		contains=@NoSpell
 syn match  netrwVersion		"(netrw.*)"			contained		contains=@NoSpell
+syn match  netrwLink		"-->"				contained skipwhite
 
 " -----------------------------
 " Special filetype highlighting {{{1
@@ -95,6 +100,7 @@ if !exists("did_drchip_netrwlist_syntax")
  hi default link netrwComma	netrwComment
  hi default link netrwHide	netrwComment
  hi default link netrwMarkFile	TabLineSel
+ hi default link netrwLink	Special
 
  " special syntax highlighting (see :he g:netrw_special_syntax)
  hi default link netrwBak	NonText
diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim
index 85a6eaa2ae..9677823fb1 100644
--- a/runtime/syntax/r.vim
+++ b/runtime/syntax/r.vim
@@ -3,12 +3,11 @@
 " Maintainer:	      Jakson Aquino <jalvesaq@gmail.com>
 " Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com>
 " 		      Tom Payne <tom@tompayne.org>
-" Last Change:	      Wed Jul 09, 2014  10:29PM
+" Last Change:	      Wed Dec 31, 2014  12:36AM
 " Filenames:	      *.R *.r *.Rhistory *.Rt
-" 
-" NOTE: The highlighting of R functions is defined in the
-" r-plugin/functions.vim, which is part of vim-r-plugin2:
-" http://www.vim.org/scripts/script.php?script_id=2628
+"
+" NOTE: The highlighting of R functions is defined in
+" runtime files created by a filetype plugin, if installed.
 "
 " CONFIGURATION:
 "   syntax folding can be turned on by
@@ -37,9 +36,9 @@ syn match rComment contains=@Spell,rCommentTodo "#.*"
 syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|include\|docType\)"
 syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
 syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
-syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\)"
+syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
 syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
-syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritsParams\)"
+syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\)"
 syn match rOComment contains=@Spell,rOKeyword "#'.*"
 
 
@@ -79,12 +78,12 @@ syn keyword rRepeat      for in repeat while
 syn keyword rConstant T F LETTERS letters month.abb month.name pi
 syn keyword rConstant R.version.string
 
-syn keyword rNumber   NA_integer_ NA_real_ NA_complex_ NA_character_ 
+syn keyword rNumber   NA_integer_ NA_real_ NA_complex_ NA_character_
 
 " Constants
 syn keyword rConstant NULL
 syn keyword rBoolean  FALSE TRUE
-syn keyword rNumber   NA Inf NaN 
+syn keyword rNumber   NA Inf NaN
 
 " integer
 syn match rInteger "\<\d\+L"
@@ -93,7 +92,7 @@ syn match rInteger "\<\d\+[Ee]+\=\d\+L"
 
 " number with no fractional part or exponent
 syn match rNumber "\<\d\+\>"
-" hexadecimal number 
+" hexadecimal number
 syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
 
 " floating point number with integer and fractional parts and optional exponent
@@ -111,17 +110,19 @@ syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
 syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
 syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
 
+syn match rAssign    '='
 syn match rOperator    "&"
 syn match rOperator    '-'
 syn match rOperator    '\*'
 syn match rOperator    '+'
-syn match rOperator    '='
 if &filetype != "rmd" && &filetype != "rrst"
   syn match rOperator    "[|!<>^~/:]"
 else
   syn match rOperator    "[|!<>^~`/:]"
 endif
 syn match rOperator    "%\{2}\|%\S\{-}%"
+syn match rOperator '\([!><]\)\@<=='
+syn match rOperator '=='
 syn match rOpError  '\*\{3}'
 syn match rOpError  '//'
 syn match rOpError  '&&&'
@@ -129,8 +130,8 @@ syn match rOpError  '|||'
 syn match rOpError  '<<'
 syn match rOpError  '>>'
 
-syn match rArrow "<\{1,2}-"
-syn match rArrow "->\{1,2}"
+syn match rAssign "<\{1,2}-"
+syn match rAssign "->\{1,2}"
 
 " Special
 syn match rDelimiter "[,;:]"
@@ -151,9 +152,14 @@ syn match rBraceError "[)}]" contained
 syn match rCurlyError "[)\]]" contained
 syn match rParenError "[\]}]" contained
 
-" Source list of R functions. The list is produced by the Vim-R-plugin
-" http://www.vim.org/scripts/script.php?script_id=2628
-runtime r-plugin/functions.vim
+" Source list of R functions produced by a filetype plugin (if installed)
+if has("nvim")
+  " Nvim-R
+  runtime R/functions.vim
+else
+  " Vim-R-plugin
+  runtime r-plugin/functions.vim
+endif
 
 syn match rDollar display contained "\$"
 syn match rDollar display contained "@"
@@ -171,7 +177,7 @@ if &filetype == "rhelp"
 endif
 
 " Type
-syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame 
+syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
 
 " Name of object with spaces
 if &filetype != "rmd" && &filetype != "rrst"
@@ -179,13 +185,19 @@ if &filetype != "rmd" && &filetype != "rrst"
 endif
 
 if &filetype == "rhelp"
-  syn match rhPreProc "^#ifdef.*" 
-  syn match rhPreProc "^#endif.*" 
+  syn match rhPreProc "^#ifdef.*"
+  syn match rhPreProc "^#endif.*"
   syn match rhSection "\\dontrun\>"
 endif
 
+if exists("r_syn_minlines")
+  exe "syn sync minlines=" . r_syn_minlines
+else
+  syn sync minlines=40
+endif
+
 " Define the default highlighting.
-hi def link rArrow       Statement	
+hi def link rAssign      Statement
 hi def link rBoolean     Boolean
 hi def link rBraceError  Error
 hi def link rComment     Comment
@@ -204,7 +216,7 @@ hi def link rHelpIdent   Identifier
 hi def link rhPreProc    PreProc
 hi def link rhSection    PreCondit
 hi def link rInteger     Number
-hi def link rLstElmt	 Normal
+hi def link rLstElmt     Normal
 hi def link rNameWSpace  Normal
 hi def link rNumber      Number
 hi def link rOperator    Operator
diff --git a/runtime/tutor/tutor.uk.utf-8 b/runtime/tutor/tutor.uk.utf-8
new file mode 100644
index 0000000000..64982e9258
--- /dev/null
+++ b/runtime/tutor/tutor.uk.utf-8
@@ -0,0 +1,976 @@
+===============================================================================
+=                         Ласкаво простимо в уроки VIM                        =
+===============================================================================
+        
+     Vim дуже потужний редактор, що має багато команд. Всі команди неможливо
+     помістити в підручнику на зразок цього, але цих уроків достатньо, щоб 
+     ви навчились з легкістю користуватись Vim як універсальним редактором. 
+
+     УВАГА:
+     Уроки цього підручника вимагають зміни тексту. Зробіть копію файлу, щоб
+     практикуватись на ньому.
+
+     Важливо пам'ятати, що цей підручник має на меті навчання на практиці.
+     Це означає що ви маєте застосовувати команди щоб вивчити їх. Просто
+     прочитавши текст, ви забудете команди.
+
+     Кнопки на клавіатурі, будемо позначати квадратними дужками: [кнопка].
+
+     А зараз переконайтесь, що включена англійська розкладка і не затиснутий
+     Caps Lock, і натисніть кнопку j щоб переміститись до першого уроку.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 1.1: ПЕРЕМІЩЕННЯ КУРСОРА 
+
+
+   ** Щоб переміщати курсор використовуйте кнопки [h],[j],[k],[l],
+      як вказано на схемі: 
+             ^
+            [k]      
+        <[h]   [l]>       
+            [j]
+             v                
+
+  Таке розміщення спочатку може видатись трохи дивним. Як наприклад те, що
+  кнопка [l] переміщує курсор вправо. Але клавіші розміщені так, щоб 
+  мінімізувати кількість рухів. Найчастіша дія яку користувач робить з 
+  текстовим файлом - це читає його. А при читанні прокручують текст вниз.
+  Тому вниз прокручує [j] - вона знаходиться якраз під вказівним пальцем
+  правої руки. 
+
+  Курсор можна переміщувати і класичним способом (курсорними клавішами), але
+  зручніше буде, якщо ви опануєте спосіб Vim. (Особливо якщо ви вже вмієте
+  набирати всліпу).
+
+  1. Попереміщуйте курсор по екрану, поки не призвичаїтесь.
+
+  2. Перемістіться до наступного уроку. 
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                          Урок 1.2: Вихід з Vim
+
+
+Увага! Перед тим як виконувати цей урок прочитайте його повністю.
+
+  1. Натисніть [ESC] (щоб впевнитись що ви в звичайному режимі).
+
+  2. Наберіть:  :q! [ENTER].
+     Це завершує роботу, відкидаючи всі зміни які ви здійснили.
+
+  3. Коли ви побачите привітання терміналу введіть команду яку ви використали
+     щоб відкрити цей підручник. Скоріш за все це було: vim tutor.txt [ENTER]
+
+  4. Якщо ви запам'ятали кроки з 1 по 3, виконайте їх, і переходьте до 
+     наступного уроку. 
+
+Зауваження: Команда :q! [ENTER]  завершує роботу і відкидає всі зміни. Через
+            кілька уроків ви навчитесь зберігати зміни в файл.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                     Урок 1.3:РЕДАГУВАННЯ ТЕКСТУ. ВИДАЛЕННЯ. 
+
+
+           ** Натисніть [x] щоб видалити символ під курсором. **
+
+  1. Перемістіть курсор до лінії нижче, яка позначена так: --->.
+
+  2. Щоб виправити помилки перемістіть курсор так, щоб він став над 
+     символом який треба видалити.
+
+  3. Натисніть [x] щоб видалити непотрібний символ.
+
+  4. Повторіть кроки з другого по четвертий, поки речення не стане правильним.
+
+---> Ккоровва перрестрибнуууууула ччерезз мііісяццць.
+
+  5. Тепер, коли речення правильне, можна перейти до уроку 1.4.
+
+Зауваження: Протягом навчання не старайтесь запам'ятати все.
+            Вчіться практикою.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                      Урок 1.4: РЕДАГУВАННЯ ТЕКСТУ. ВСТАВКА
+
+
+                      ** Натисніть  [i] щоб вставити текст. **
+
+  1. Перемістіть курсор на перший рядок позначений:  --->.
+
+  2. Перемістіть курсор на символ, ПІСЛЯ якого потрібно вставити текст.
+
+  3. Натисніть [i] і наберіть необхідні вставки.
+
+  4. Коли всі помилки виправлені натисніть [ESC] щоб повернутись в звичайний
+     режим.
+
+---> З прав текст.
+---> З цього рядка пропав деякий текст.
+
+  5. Коли призвичаїтесь вставляти текст - переходьте до уроку 1.5.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                     Урок 1.5: РЕДАГУВАННЯ ТЕКСТУ. ДОДАВАННЯ.
+
+
+                        ** Натисніть [A] щоб додати текст. **
+
+Увага! Тут і далі, коли мають наувазі клавішу з буквою в верхньому
+       регістрі, то це означає що її натискають з затиснутою [SHIFT].
+
+  1. Перемістіть курсор до першої лінії внизу позначеної --->.
+     Не має значення над яким символом знаходиться курсор.
+
+  2. Натисніть [A] і введіть необхідне доповнення.
+
+  3. Коли додавання завершене натисніть [ESC] щоб повернутись в 
+     звичайний режим.
+
+  4. Перемістіть курсор до другої лінії позначеної ---> і повторіть
+     кроки 2 і 3 щоб виправити речення.
+
+---> З цього рядка пропущ
+     З цього рядка пропущений текст.
+---> З цього рядка також
+     З цього рядка також пропущений текст.
+
+  5. Після виконання вправ, переходьте до наступного уроку.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                     Урок 1.6: РЕДАГУВАННЯ ФАЙЛУ
+
+                    ** Використайте :wq щоб зберегти файл і вийти.**
+
+Увага! Перед виконанням уроку прочитайте його повністю.
+
+  1. Вийдіть з цього підручника як ви робили в уроці 1.2:  :q![ENTER]
+     Або якщо ви маєте доступ до іншого терміналу виконуйте наступні
+     дії в ньому.
+
+  2. В терміналі наберіть команду:  vim НазваФайлу [ENTER]
+     'vim' - команда для запуску редактора, НазваФайлу - файл який будемо
+     редагувати. Якщо ввести неіснуючий файл, то він створиться
+
+  3. Відредагуйте текст, як навчились у попередніх уроках.
+
+  4. Щоб зберегти зміни у файлі, і вийти з Vim наберіть:  :wq [ENTER]
+
+  5. Якщо ви вийшли з підручника на першому кроці, то зайдіть в нього
+     знову і переходьте до підсумку.
+
+  6. Після прочитання і засвоєння попередніх кроків виконайте їх.
+  
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 1
+
+
+  1. Курсор керується курсорними клавішами, або клавішами [h][j][k][l]
+         [h] (вліво)    [j] (вниз)       [k] (вверх)    [l] (вправо)
+
+  2. Щоб запустити Vim з терміналу наберіть:  vim Назва файлу [ENTER]
+
+  3. Щоб вийти з Vim наберіть: [ESC] :q! [ENTER]  щоб відкинути всі зміни.
+                 або наберіть: [ESC] :wq [ENTER]  щоб зберегти всі зміни.
+
+  4. Щоб видалити символ під курсором натисніть [x].
+
+  5. Щоб вставити, чи доповнити текст наберіть:
+         [i]   текст що вставляєтсья   [ESC]    вставиться перед курсором
+         [A]   текст до додається      [ESC]    додасть текст до рядка
+
+Зауваження: Натискання [ESC] перенесе вас в звичайний режим, чи відмінить
+         не до кінця введену команду.
+
+Тепер переходьте до уроку 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 2.1: КОМАНДИ ВИДАЛЕННЯ
+
+
+                       ** Введіть dw щоб видалити слово. **
+
+  1. Натисніть [ESC], щоб переконатись що ви в звичайному режимі.
+
+  2. Перемістіть курсор до лінії нижче позначеної --->.
+
+  3. Перемістіть курсор до початку слова що має бути видалене.
+
+  4. Введіть dw щоб слово пропало.
+
+  Зауваження: Буква d з'явиться в останньому рядку екрану, якщо ви її натиснули.
+              Vim чекає введення наступного символа. Якщо з'явилось щось інше
+              значить ви щось не так ввели. Натисніть [ESC] і почніть спочатку.
+
+---> Є деякі слова весело, які не потрібні папір в цьому реченні.
+
+  5. Повторюйте кроки 3 і 4 поки речення не стане правильне, а тоді переходьте
+     до уроку 2.2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                      Урок 2.2: БІЛЬШЕ КОМАНД ВИДАЛЕННЯ
+
+
+     ** Наберіть d$ щоб видалити символи від курсора до кінця рядка. **
+
+  1. Натисніть [ESC] щоб переконатись що ви в звичайному режимі.
+
+  2. Перемістіть курсор до лінії нижче, що позначена --->.
+
+  3. Перемістіть курсор до кінця правильного рядка (ПІСЛЯ першої крапки).
+
+  4. Введіть d$ щоб видалити все до кінця рядка.
+
+---> Хтось надрукував кінець цього рядка двічі. кінець цього рядка двічі.
+
+
+  5. Перейдіть до уроку 2.3 щоб розібратись в цьому детальніше.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                     Урок 2.3:ОПЕРАТОРИ І ПЕРЕМІЩЕННЯ
+
+
+  Багато команд що змінюють текст утворені з оператора і переміщення.
+  Формат команди видалення з оператором d подано нижче:
+
+        d   переміщення
+
+  Де:
+    d      - оператор видалення.
+    переміщення - з чим працює оператор (описано нижче).
+
+  Короткий список переміщень:
+    w - до початку наступного слова, НЕ ВКЛЮЧАЮЧИ його перший символ.
+    e - до кінця поточного слова, ВКЛЮЧАЮЧИ останній символ.
+    $ - до кінця рядка, ВКЛЮЧАЮЧИ останній символ.
+
+  Тому введення de видалить символи від курсора, до кінця слова.
+
+Зауваження: Натискання тільки переміщення в звичайному режимі відповідно 
+            переміщує курсор.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+             Урок 2.4: ВИКОРИСТАННЯ ЛІЧИЛЬНИКА ДЛЯ ПЕРЕМІЩЕННЯ
+
+
+   ** Введення числа перед переміщенням повторює його стільки раз. **
+
+  1. Перемістіть курсор до початку рядка позначеного --->
+
+  2. Введіть  2w щоб перемістити курсор на два слова вперед.
+
+  3. Введіть 3e щоб перемістити курсор в кінець третього слова.
+
+  4. Введіть 0 (нуль) щоб переміститись на початок рядка.
+
+  5. Повторіть кроки 2 і 3 з різними числами.
+
+---> А це просто рядок зі словами, серед яких можна рухати курсором.
+
+  6. Переходьте до уроку 2.5.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                     Урок 2.5: БАГАТОРАЗОВЕ ВИДАЛЕННЯ
+
+
+   ** Введення числа з оператором повторює його стільки ж разів. **
+
+  В комбінації з оператором видалення, і переміщення з лічильника можна 
+  видаляти потрібне число елементів.
+  Для цього введіть 
+         d   число   переміщення
+
+  1. Перемістіться до першого слова в ВЕРХНЬОМУ РЕГІСТРІ в рядку 
+     позначеному --->.
+
+  2. Введіть d2w щоб видалити два слова.
+
+  3. Повторіть кроки 1 і 2 з різними числами, щоб видалити все зайве.
+
+--->  цей ABC DE рядок FGHI JK LMN OP слів Q RS TUV почищений.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                         Урок 2.6: ОПЕРАЦІЇ З РЯДКАМИ
+
+
+                 ** Введіть  dd  щоб видалити весь рядок. **
+
+  Через те, що видалення всього рядка є доволі частою дією розробники Vi
+  вирішили що для цієї операції потрібна проста команда, як dd.
+
+  1. Перемістіть курсор до другого рядка в вірші нижче.
+  2. Введіть dd щоб видалити рядок.
+  3. Потім перемістіться до четвертого рядка.
+  4. Введіть 2dd щоб видалити два рядки.
+
+--->  1)  Троянди червоні,
+--->  2)  Багнюка весела,
+--->  3)  Волошки голубі,
+--->  4)  В мене є машина,
+--->  5)  Годинник каже час,
+--->  6)  Цукерки солодкі,
+--->  7)  Дарую тобі.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                         Урок 2.7: ВІДКИНУТИ ЗМІНИ
+
+
+  ** Натисніть u щоб скасувати останні команди, U щоб виправити ввесь рядок. **
+
+  1. Перемістіть курсор до рядка нижче позначеного ---> на місце першої помилки.
+  2. Натисніть x щоб видалити непотрібний символ.
+  3. Потім натисніть u щоб відмінити виправлення.
+  4. Цього разу виправте всі помилки в рядку використовуючи команду x .
+  5. Після цього введіть U, і відкиньте всі зміни в цілому рядку.
+  6. Натисніть u кілька разів, щоб відмінити U і попередні команди.
+  7. Тепер натисніть CTRL-R кілька разів, щоб повторити відмінені команди 
+     (відмінити відміну).
+
+---> Вииправте помилки наа цьоому рядку і вііідмініть їх.
+
+  8. Тепер можна переходити до підсумків другого уроку.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 2
+
+
+  1. Щоб видалити все від курсора аж до початку наступного слова введіть: dw
+  2. Щоб видалити від курсора до кінця рядка:    d$
+  3. Щоб видалити увесь рядок:    dd
+
+  4. Щоб повторити переміщення, поставте перед ним число повторів:   2w
+  5. Формат команди зміни:
+               оператор   [число]   переміщення
+     де:
+       оператор - що робити, як наприклад d для видалення
+       [число] - кількість повторів 
+       переміщення   - куди переміститись перед виконанням оператора, як
+                як наприклад w (слово), $ (кінець рядка), і т.і.
+
+  6. Щоб переміститись до початку рядка використовуйте нуль:  0
+
+  7. Щоб відмінити попередню дію введіть:   u  (u в нижньому регістрі)
+     Щоб відмінити всі зміни рядка введіть: U  (U в верхньому регістрі)
+     Щоб скасувати відміну натисніть:       CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                         Урок 3.1: КОМАНДА PUT
+
+
+       ** Введіть p щоб вставити перед тим видалений текст після курсору. **
+
+  1. Перемістіть курсор до першої ---> лінії внизу.
+
+  2. Введіть dd щоб видалити рядок і зберегти його в регістрі Vim.
+
+  3. Перемістіть курсор до рядка в), НАД тим місцем де має бути видалений рядок.
+
+  4. Натисніть p щоб вставити рядок під курсором.
+
+  5. Повторіть кроки від 2 до 4 щоб вставити всі рядки в правильному порядку.
+
+---> г) всіх до кузні іззива.
+---> б) а в коваля серце тепле,
+---> в) а він клепче та й співа,
+---> а) А в тій кузні коваль клепле,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                       Урок 3.2: Команда заміни
+
+
+       ** Наберіть rx щоб замінити символ під курсором на x . **
+
+  1. Перемістіть курсор до першого рядка нижче, позначеного  --->.
+
+  2. Помістіть курсор над першою помилкою.
+
+  3. Наберіть r а потім символ який має стояти там.
+
+  4. Повторіть кроки з 2 по 3 поки перший рядок не стане еквівалентним другому.
+
+--->  Коли ця лігія набираламт. хтось наьтснкв геправмльні унопкм!
+--->  Коли ця лінія набиралась, хтось натиснув неправильні кнопки!
+
+  5. Зараз переходьте до уроку 3.3.
+
+Примітка: Ви маєте вчитись діями, а не простим заучуванням, пам'ятаєте?
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 3.3: ОПЕРАТОР ЗАМІНИ
+
+
+           ** Щоб зробити заміну до кінця слова введіть ce . **
+
+  1. Перемістіть курсор до першого рядка позначеного --->.
+
+  2. Помістіть курсор над у в слові рукра.
+
+  3. Введіть ce і правильне закінчення слова (ядок в цьому випадку).
+
+  4. Натисніть [ESC] і переходьте до наступного символа, який потрібно замінити.
+
+  5. Повторюйте кроки 3 і 4 поки перше речення не стане таким самим як і друге.
+
+---> Цей рукра має кілька слів що потретамув заміни за допоцкщшг оператора.
+---> Цей рядок має кілька слів що потребують заміни за допомогою оператора.
+
+Зауважте що ce видаляє слово, і поміщає вас в режим вставки.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                       Урок 3.4: БІЛЬШЕ ЗМІН З c
+
+
+  ** Оператор заміни використовується з тими ж переміщеннями що і видалення. **
+
+  1. Оператор заміни працює в такий же спосіб що і видалення. Формат:
+
+         c    [число]   переміщення
+
+  2. Переміщення ті ж самі, такі як w (слово) і $ (кінець рядка).
+
+  3. Перемістіться до першого рядка позначеного --->.
+
+  4. Перемістіть курсор до першої помилки.
+
+  5. Наберіть c$ і решту рядка, щоб він став таким як другий і натисніть [ESC].
+
+---> Кінець цього рядка потребує якихось дій щоб стати таким як кінець другого.
+---> Кінець цього рядка можна виправити за допомогою команди c$.
+
+Примітка: Можна використовувати кнопку Backspace щоб виправляти опечатки при 
+                наборі.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 3
+
+
+  1. Щоб вставити текст який був видалений наберіть p . Це вставляє 
+     видалений текст ПІСЛЯ курсора (якщо був видалений рядок, вставка
+     продовжиться з рядка під курсором).
+
+  2. Щоб замінити символ під курсором наберіть r і необхідний символ.
+
+  3. Оператор заміни дозволяє робити заміну тексту від курсору, до потрібного
+     переміщення. Наприклад щоб замінити все від курсора до кінця слова
+     вводять  ce . Щоб замінити закінчення рядка тиснуть c$  .
+
+  4. Формат заміни:
+
+         c   [число]   переміщення
+
+Почнемо наступний урок.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                  Урок 4.1: ПОЗИЦІЯ КУРСОРА І СТАТУС ФАЙЛУ
+
+  ** Введіть CTRL-G щоб побачити вашу позицію в файлі, і його статус.
+     Введіть G  щоб переміститись на потрібний рядок файлу. **
+
+  ПРИМІТКА: Прочитайте увесь урок перед виконанням будь-яких кроків!!
+
+  1. Затисніть кнопку Ctrl і натисніть g . Це називається CTRL-G.
+     Внизу з'явиться повідомлення з назвою файлу, і позицією в файлі. 
+     Запам'ятайте номер рядка для кроку 3.
+
+ПРИМІТКА: Ви бачите позицію курсора в нижньому правому кутку екрану.
+          Це трапляється коли включена опція 'ruler' (читайте :help 'ruler'  )
+
+  2. Натисніть G щоб переміститись до кінця файлу.
+     Наберіть  gg щоб переміститись до початку файлу.
+
+  3. Наберіть номер рядка де ви були а потім G. Це перенесе вас до потрібного
+     рядка.
+
+  4. Якщо ви запам'ятали три попередні кроки, то виконуйте.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 4.2: КОМАНДА ПОШУКУ
+
+
+         ** Введіть  / (слеш) і фразу, щоб шукати її в тексті. **
+
+  1. В звичайному режимі введіть символ  /  . Зауважте що він і курсор 
+     з'являються в низу екрану, як і з командою  :   .
+
+  2. Тепер введіть 'очепятка' <ENTER>. Це буде словом яке ви шукатимете.
+
+  3. Щоб здійснити пошук цієї фрази ще раз введіть  n .
+     Щоб шукати в протилежному напрямку введіть  N .
+
+  4. Щоб шукати фразу в зворотньому напрямку використайте  ?  замість  / .
+
+  5. Щоб переміститись назад до того місця звідки прийшли натисніть CTRL-O.
+     Повторіть щоб повернутись ще далі. (Це як кнопка назад в браузері)
+     CTRL-I переміщує вперед.
+
+--->  "очепятка" не є способом написати опечатка; очепятка це опечатка.
+Примітка: Коли пошук досягає кінця файлу він продовжує з початку, хіба що 
+          опція 'wrapscan' була виключена.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                   Урок 4.3: ПОШУК ПАРНИХ ДУЖОК
+
+
+              ** Введіть  %  щоб знайти парну ),], чи } . **
+
+  1. Помістіть курсор над будь-якою (, [, чи { в рядку нижче позначеному --->.
+
+  2. Тепер введіть символ  %  .
+
+  3. Курсор переміститься до відповідної дужки.
+
+  4. Введіть  %  щоб перемістити курсор до іншої парної дужки.
+
+  5. Спробуйте з іншими дужками, і подивіться що вийде.
+
+---> Це ( тестовий рядок ( з такими [ такими ] і такими { дужками } в ньому. ))
+
+
+Примітка: Це корисно при відлагоджуванні програми з неправильними дужками. 
+          І взагалі в кожному тексті дужки мають стояти правильно!
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                      Урок 4.4: КОМАНДА ЗАМІНИ
+
+
+        ** Наберіть :s/старе/нове/g щоб замінити 'старе' на 'нове'. **
+
+  1. Перемістіть курсор до лінії нижче позначеної  --->.
+
+  2. Введіть :s/(біп)/блять [ENTER] . Зауважте що ця команда змінює тільки перше
+     входження (біп) в рядку.
+
+  3. Потім наберіть  :s/(біп)/блять/g .  Додавання  g  вказує що заміни 
+     робляться у всьому рядку глобально.
+
+---> люди не лю(біп), коли в слові "лю(біп)" "(біп)" заміняють на "(бiп)".
+
+  4. Щоб замінити кожне входження послідовності символів між двома рядками 
+     наберіть  :#,#s/старе/нове/g    де #,# діапазон рядків в яких робиться 
+                                     заміна.
+     Введіть   :%s/старе/нове/g      щоб змінити кожне входження у цілому файлі.
+     Введіть   :%s/старе/нове/gc        щоб замінити, кожне входження у файлі з
+                                     підтвердженням кожної заміни.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 4 
+
+
+  1. CTRL-G  виводить вашу позицію в файлі і назву файлу.
+             G  переміщує в кінець файлу.
+     число   G  переміщує до рядка з вказаним номером.
+            gg  переміщує до першого рядка.
+
+  2. Ввід  /    і послідовності символів шукає послідовність ПІСЛЯ курсора.
+     Ввід  ?       і послідовності символів шукає послідовність ПЕРЕД курсором.
+ 
+     Після пошуку введіть  n  щоб знайти наступне входження в тому ж напрямку
+     або  N  щоб шукати в протилежному напрямку.
+     CTRL-O відносить вас до старішої позиції, CTRL-I до новішої позиції.
+
+  3. Ввід  %       коли курсор знаходиться над дужкою (,),[,],{, чи } переносить
+     курсор до протилежної дужки.
+
+  4. Щоб замінити перше входження старого слова на нове    :s/старе/нове
+     Щоб замінити всі старі слова рядка на нові            :s/старе/нове/g
+     Щоб замінити фрази між двома рядками                  :#,#s/старе/нове/g
+     Щоб замінити всі входження в файлі                    :%s/старе/нове/g
+     Щоб щоразу підтверджувати заміну додайте 'c'          :%s/старе/нове/gc
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                Урок 5.1: ЯК ВИКОНАТИ ЗОВНІШНЮ КОМАНДУ
+
+
+   ** Введіть  :!  і зовнішню команду, щоб виконати ту команду. **
+
+  1. Введіть відому команду  :  щоб встановити курсор в низу екрану.
+     Це дозволяє вводити команди командного рядка.
+
+  2. Тепер введіть  !  (символ знаку оклику) .  Це дозволить вам виконати
+     будь-яку зовнішню команду.
+
+  3. Як приклад введіть :!ls [ENTER].  Це покаже список файлів каталогу, так
+     так ніби ви знаходитесь в оболонці терміналу. Або використайте :!dir
+     якщо ви раптом знаходитесь в Windows.
+
+Примітка:  Можна запускати будь-яку зовнішню команду таким способом, навіть з
+           аргументами.
+
+Примітка:  Всі команди що починаються з  :  мають закінчуватись натисканням
+           [ENTER]. Більше на цьому не наголошуватиметься.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                      Урок 5.2: ЩЕ ПРО ЗАПИС ФАЙЛІВ
+
+
+     ** Щоб зберегти змінений текст, введіть :w НАЗВА_ФАЙЛУ **
+
+  1. Введіть  :!dir  чи  :!ls  щоб переглянути вміст вашої директорії.
+     Вам вже казали що після цього тиснуть [ENTER].
+
+  2. Виберіть ім'я файлу яке ще не використовується, наприклад TEST.
+     (Взагалі то це не обов'язково, якщо вміст обраного файлу не 
+     є цінним)
+
+  3. Тепер введіть:      :w TEST   (де TEST це назва яку ви обрали.)
+
+  4. Це зберігає увесь файл (підручник Vim ) під ім'ям TEST.
+     Щоб перевірити знову наберіть  :!ls   щоб побачити зміни в каталозі.
+
+Примітка: Якщо ви вийдете з Vim і запустите його знову командою vim TEST, 
+          файл що ви відкриєте буде точною копією цього, коли ви його зберегли.
+
+  5. Зараз видаліть файл ввівши (Unix):         :!rm TEST
+                             чи (MS-DOS):       :!del TEST
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                    Урок 5.3: ВИБІР ТЕКСТУ ДЛЯ ЗАПИСУ
+
+
+  ** Щоб зберегти частину файлу, наберіть  v  переміщення  :w НАЗВА_ФАЙЛУ **
+
+  1. Перемістіть курсор до цього рядка.
+
+  2. Натисніть  v  і перемістіть курсор на п'ять пунктів нижче. Зауважте, що 
+     текст виділяється.
+
+  3. Натисніть символ  :  .  Внизу екрану з'являються символи  :'<,'> .
+
+  4. Введіть w TEST  , де TEST назва файлу що ще не використовується.  
+     Переконайтесь що ви бачите  :'<,'>w TEST  перед тим як натиснути [ENTER].
+
+  5. Vim запише вибрані рядки в файл TEST.  Використайте :!dir  чи  !ls
+     щоб побачити це. Поки що не видаляйте його! Ми використаємо TEST в
+     наступному уроці.
+
+Зауваження: Натискання v починає режим візуального виділення. Ви можете
+            переміщувати курсор щоб змінити розмір вибраної частини.
+            Потім можна використати оператор щоб зробити щось з текстом.
+            Наприклад  d  видалить текст.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                   Урок 5.4: ОТРИМАННЯ І ЗЛИТТЯ ФАЙЛІВ
+
+
+       ** Щоб вставити вміст файлу введіть  :r НАЗВА_ФАЙЛУ  **
+
+  1. Помістіть курсор десь над цим рядком.
+
+Зауваження:  Після виконання кроку 2 ви побачите текст з уроку 5.3. Тоді
+             перемістіться вниз, щоб побачити вміст цього уроку знову.
+
+  2. Тоді отримайте вміст вашого файлу TEST використавши команду  :r TEST  ,
+     де TEST назва файлу що ви використали.
+     Файл що ви отримуєте поміщується під рядком курсора.
+
+  3. Щоб перевірити що файл вставлено, прокрутіть текст назад, і переконаєтесь
+     що тепер є дві копії урок 5.3, the original and the file version.
+
+Примітка:  Також ви можете вставляти вивід зовнішньої програми. Наприклад
+           :r !ls  читає вивід команди  ls  і вставляє його під курсором.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               Підсумок 5 уроку
+
+
+  1.  :!команда  виконує зовнішню команду.
+
+  2.  :w НАЗВА_ФАЙЛУ записує поточний файл на диск під назвою НАЗВА_ФАЙЛУ.
+
+  3.  v  переміщення  :w НАЗВА_ФАЙЛУ зберігає візуально виділену частину тексту       
+       в файл НАЗВА_ФАЙЛУ.
+
+  4.  :r НАЗВА_ФАЙЛУ  отримує з диску файл НАЗВА_ФАЙЛУ і вставляє його під 
+      курсором.
+
+  5.  :r !ls  читає вивід команди ls і вставляє її під поточною позицією курсора
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                         Урок 6.1: КОМАНДА ВСТАВКИ
+
+        
+           ** Введіть o щоб вставити новий рядок під курсором. **
+
+  1. Перемістіть курсор на рядок нижче, позначений --->.
+
+  2. Натисніть  o  щоб вставити новий рядок ПІД курсором та перейти в 
+     режим вставки.
+
+  3. Тепер введіть текст і натисніть [ESC] щоб вийти з режиму вставки.
+
+---> Після натискання  o  курсор ставиться на наступний рядок в режимі вставки.
+
+  4. Щоб вставити рядок НАД ABOVE курсором пишуть  O  в верхньому регістрі, 
+     замість o. Спробуйте на рядку нижче.
+
+---> Щоб вставити рядок над цим введіть  O  .
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 6.2: КОМАНДА ДОПИСУВАННЯ
+
+
+             ** Натисніть  a  щоб вставити текст після курсору. **
+
+  1. Перемістіть курсор до початку рядка внизу позначеного --->.
+  
+  2. Тисніть  e  поки курсор не буде в кінці ря .
+
+  3. Натисніть  a  (маленьке) щоб додати текст ПІСЛЯ курсору.
+
+  4. Допишіть слова як рядок внизу.  Натисніть [ESC] щоб вийти з режиму
+     вставки.
+
+  5. Використайте  e  щоб переміститись до наступного неповного слова та
+     to move to the next incomplete word and repeat steps 3 and 4.
+  
+---> Цей ря дозволить вам попрактикува в дописува тексту до рядка.
+---> Цей рядок дозволить вам попрактикуватись в дописуванні тексту до рядка.
+
+Примітка:  a, i  і  A  переходять в один і той же режим вставки, єдиною різницею
+           є тільки те, де вставляються символи.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                    Урок 6.3: ІНШИЙ СПОСІБ ЗАМІНИ
+
+
+        ** Введіть велику  R  щоб замінити більш ніж один символ. **
+
+  1. Перемістіть курсор до першого рядка внизу позначеного --->.  
+     Перемістіть курсор до першого  xxx .
+
+  2. Тепер натисніть  R  і введіть номер під ним з другого рядка, так що він
+     замінює xxx .
+
+  3. Натисніть [ESC] щоб покинути режим заміни.  Зауважте, що решта рядка 
+     залишається незмінною.
+
+  4. Повторіть кроки від 1 до 3 щоб замінити всі xxx на числа з другого рядка.
+
+---> Додавання 123 до xxx дає xxx.
+---> Додавання 123 до 456 дає 579.
+
+Зауваження:  Режим заміни подібний до режиму вставки, тільки кожен введений 
+             символ видаляє символ який стояв на його місці.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                        Урок 6.4: КОПІЮВАННЯ І ВСТАВКА
+
+
+  ** Використайте оператор  y  щоб копіювати текст і  p  щоб його вставити **
+
+  1. Перейдіть до рядка нижче позначеного ---> і покладіть курсор після "а)".
+  
+  2. Перейдіть в візуальний режим за допомогою клавіші  v  і перемістіть курсор
+     якраз перед словом "один".
+  
+  3. Введіть  y  щоб копіювати (yank) виділений текст.
+
+  4. Перемістіть курсор до кінця наступного рядка:  j$
+
+  5. Натисніть  p  щоб вставити (put) текст.  Тоді введіть :  два [ESC] .
+
+  6. так само додайте третій рядочок.
+
+--->  а) це рядок номер один
+      б)
+
+  Зауваження: також можна використовувати  y  як оператор;  
+              yw  копіює одне слово.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                            Урок 6.5: ВСТАНОВЛЕННЯ ОПЦІЙ
+
+
+     ** Встановити опцію так що пошук чи заміна буде ігнорувати регістр **
+
+  1. Знайдіть слово 'ігнорувати' ввівши :   /ігнорувати
+     Повторіть кілька разів натискаючи  n .
+
+  2. Встановіть опцію ігнорування регістру 'ic' (Ignore case) ввівши:  :set ic
+
+  3. Тепер пошукайте 'ігнорувати' знову ввівши  n
+     Зауважте що Ігнорувати та ІГНОРУВАТИ тепер також знаходяться.
+
+  4. Ввімкніть 'hlsearch' (підсвітку пошуку) і 'incsearch' (інтерактивність)
+     командою :set hls is  .
+
+  5. Тепер пошукайте щось знову і зауважте зміни:  /ігнорувати [ENTER]
+
+  6. Щоб вимкнути ігнорування регістру напишіть:  :set noic
+
+Примітка:  Щоб вимкнути підсвітку співпадінь введіть:   :nohlsearch 
+Примітка:  Якщо ви хочете не брати до уваги регістр тільки під час одного пошуку           
+           використайте ключ  \c. Наприклад:  /ігнорувати\c  [ENTER]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 6
+
+  1. Введіть  о  щоб додати рядок ПІД курсором і почати режим вставки.
+     Введіть  O  щоб додати рядок НАД курсором.
+
+  2. Введіть  a  щоб вставити текст ПІСЛЯ курсора.
+     Введіть  A  щоб додати текст до рядка.
+
+  3. Переміщення  e  переміщує нас до кінця слова.
+
+  4. Оператор  y  копіює текст,  p  вставляє його.
+
+  5. Введення  R  переносить нас в режим заміни до натискання [ESC].
+
+  6. Набір ":set xxx" встановлює опцію "xxx".  Деякі опції:
+        'ic' 'ignorecase'       ігнорувати верхній/нижній регістр при пошуку
+        'is' 'incsearch'        показувати співпадіння пошуку під час введення
+                                фрази
+        'hls' 'hlsearch'        пісвічувати всі співпадіння
+     Можна одночасно використовувати і коротку і довгу форму запису опції.
+
+  7. Використайте префікс "no" щоб вимкнути опцію:   :set noic
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                       Урок 7.1: ОТРИМАННЯ ДОПОМОГИ
+
+
+              ** Використання вбудованої довідкової системи **
+
+  Vim має всеосяжну систему довідки. Щоб ознайомитись з нею спробуйте один з
+  таких способів:
+        - натисніть кнопку [HELP] (якщо така є)
+        - натисніть [F1]
+        - наберіть   :help
+
+  Прочитайте текст в вікні допомоги, щоб вияснити як вона працює.
+  Натисніть CTRL-W  двічі щоб змінити вікно
+  Наберіть   :q  щоб закрити вікно довідки.
+
+  Можна знайти довідку майже на будь-яку тему додаючи аргумент після команди
+  ":help" . Спробуйте одну з наступних (не забувайте натискати  [ENTER]):
+
+        :help w
+        :help c_CTRL-D
+        :help insert-index
+        :help user-manual
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                      Урок 7.2: СТВОРЕННЯ СКРИПТА АВТОЗАПУСКУ
+
+
+                      ** Ввімкнення додаткових функцій Vim **
+
+  Vim має набагато більше функцій ніж Vi, але більшість з них відключені за 
+  замовчуванням.  Щоб почати використання додаткових функцій потрібно створити
+  файл "vimrc".
+
+  1. Почніть редагування файлу "vimrc" .  Це залежить від вашої системи:
+        :e ~/.vimrc             для Unix
+        :e $VIM/_vimrc          для MS-Windows
+
+  2. Тепер прочитайте приклад вмісту "vimrc" :
+        :r $VIMRUNTIME/vimrc_example.vim
+
+  3. Збережіть файл:
+        :w
+
+  Наступного разу коли ви запустите Vim він буде використовувати підсвітку 
+  синтаксису. Можна додати всі ваші улюблені налаштування в цей файл. Для більш
+  детальної інформації введіть  :help vimrc-intro
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                             Урок 7.3: АВТОДОПОВНЕННЯ
+
+
+              ** Автодоповнення за допомогою CTRL-D і [TAB] **
+
+  1. Переконайтесь що в Vim не включена зворотня сумісність:  :set nocp
+
+  2. Подивіться що за файли існують в каталозі:  :!ls   чи  :!dir
+
+  3. Введіть початок команди:  :e
+
+  4. Натисніть  CTRL-D  і Vim покаже список команд що починаються з "e".
+
+  5. Натисніть [TAB]  і  Vim доповнить команду до ":edit".
+
+  6. Тепер додайте пропуск і початок існуючого імені файлу:  :edit FIL
+
+  7. Натисніть [TAB].  Vim доповнить ім'я (якщо воно унікальне).
+
+Зауваження:  Доповнення працює для багатьох команд. Просто натискайте CTRL-D і
+             [TAB]. Це особливо корисно для команди  :help .
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+                               ПІДСУМОК УРОКУ 7
+
+
+  1. Введіть  :help  або натисніть [F1] щоб відкрити вікно довідки.
+
+  2. Введіть  :help тема  щоб знайти довідку про  тему .
+
+  3. Введіть  CTRL-W CTRL-W  щоб змінити вікно.
+
+  4. Наберіть  :q  щоб закрити вікно
+
+  5. Створіть скрипт vimrc щоб змінювати ваші налаштування при запуску.
+
+  6. При наборі команди що починається з двокрапки  :  натисніть CTRL-D 
+     щоб побачити можливі доповнення. Натисніть [TAB] щоб побачити одне з
+     доповнень.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  Це завершує уроки Vim .  Вони були націлені щоб дати вам короткий вступ в 
+  редактор Vim, достатній для того щоб використовувати редактор комфортно.
+  Ці уроки зовсім далеко від повних, бо Vim має набагато більше команд. Можна 
+  прочитати інструкцію користувача : ":help user-manual".
+
+  Для подальшого читання і вивчення рекомендується така книжка:
+        Vim - Vi Improved - by Steve Oualline
+        Publisher: New Riders
+  Особливо корисна для початківців.
+  Там багато прикладів і ілюстрацій.
+  Дивіться http://iccf-holland.org/click5.html
+
+  Ці уроки були написані Майклом С. Пірсом та Робертом Уаром.
+
+  Модифіковано для Vim Бремом Муленаром.
+  
+
+  Переклад на українську Буник Т.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From d2fb0aa2d496bc57a04db85b9097607628909ad1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 19:04:28 +0100
Subject: [PATCH 386/473] updated for version 7.4.567 Problem:    Non-ascii
 vertical separater characters are always redrawn. Solution:   Compare only
 the one byte that's stored. (Thiago Padilha)

---
 src/screen.c  | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/screen.c b/src/screen.c
index 290dd1bd3d..bbf57b1121 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -6062,7 +6062,7 @@ screen_line(row, coloff, endcol, clear_width
 	    int c;
 
 	    c = fillchar_vsep(&hl);
-	    if (ScreenLines[off_to] != c
+	    if (ScreenLines[off_to] != (schar_T)c
 # ifdef FEAT_MBYTE
 		    || (enc_utf8 && (int)ScreenLinesUC[off_to]
 						       != (c >= 0x80 ? c : 0))
diff --git a/src/version.c b/src/version.c
index 6339bcb724..8b3ecbe90c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    567,
 /**/
     566,
 /**/

From 641022c596d0cb0b8392a951cf1d1094bd9f39fa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 7 Jan 2015 19:04:29 +0100
Subject: [PATCH 387/473] Added tag v7-4-567 for changeset 0b245c8dbd19

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 28e1718171..dcdbc48d61 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3289,3 +3289,4 @@ b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 9657929ee56251b52885cd0660941b0aab2af3ba v7-4-564
 22f95a018b13dc9d8a3246d990a1ea0b5b3a264d v7-4-565
 a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
+0b245c8dbd19755e08b5248110a537a74ddb92c4 v7-4-567

From 6cbcc1661081908757f8f64e4659551bb6d48e98 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sat, 10 Jan 2015 15:09:25 +0100
Subject: [PATCH 388/473] Updated syntax files.

---
 runtime/doc/todo.txt       |  36 +++--
 runtime/syntax/amiga.vim   |   8 +-
 runtime/syntax/csh.vim     |   8 +-
 runtime/syntax/dcl.vim     |   8 +-
 runtime/syntax/elmfilt.vim |   8 +-
 runtime/syntax/exports.vim |   8 +-
 runtime/syntax/lisp.vim    |  25 ++--
 runtime/syntax/maple.vim   |   8 +-
 runtime/syntax/rpcgen.vim  |   8 +-
 runtime/syntax/sh.vim      |  85 +++++------
 runtime/syntax/sm.vim      |   8 +-
 runtime/syntax/tags.vim    |   8 +-
 runtime/syntax/tex.vim     |  61 ++++----
 runtime/syntax/vim.vim     | 288 +++++++++++++++++--------------------
 runtime/syntax/xmath.vim   |   6 +-
 runtime/syntax/xxd.vim     |   8 +-
 runtime/syntax/yacc.vim    |   4 +-
 17 files changed, 286 insertions(+), 299 deletions(-)

diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index f0d6668be2..fe4b5ec31a 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 07
+*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 10
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -56,6 +56,9 @@ Regexp problems:
   "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
 - Diff highlighting can be very slow. (Issue 309)
 
+The range for :wincmd is not always a window number, can also be a column
+count.  Remove the range check.  What to use for ":$wincmd"?
+
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
 More info Jul 24.  Not clear why.
 
@@ -68,6 +71,10 @@ work. (ZyX, 2013 Sep 28)
 
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
+Patch on Issue 292, recognizing polkit filetype.
+
+Issue 133: patch for config.vim, maintainer not responding.
+
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
@@ -78,9 +85,6 @@ Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
 MS-Windows: When editing a file with a leading space, writing it uses the
 wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
 
-Patch to fix unnecessary redraw of vertical separators.
-(Thiago Padilha, 2015 Jan 5, second version)
-
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
@@ -95,6 +99,8 @@ Update Nov 26.
 Patch to improve config.vim syntax.  Issue 305.  Maintainer last update was in
 2008.
 
+Patch on issue 310, matchadd() seems to hang.
+
 Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
 (Hirohito Higashi, 2014 Dec 8)
 
@@ -119,6 +125,9 @@ Dec 17)
 Patch to support hex values for setting option value.
 (Zyx, 2015 Nov 6)
 
+Patch to fix problems with small screen sizes. (Christian Brabandt, 2015 Jan
+8)
+
 On MS-Windows running tests with Mercurial has problems when the fileformat of
 the input files are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
 Update Nov 5.
@@ -148,6 +157,8 @@ ml_updatechunk() is slow when retrying for another encoding. (John Little,
 Patch to add a different escape sequence for replace mode.
 (Omar Sandoval, 2014 Nov 30)
 
+Patch on Issue 166, popup drawing with '$' in 'cpo'.
+
 Calling setreg() with an empty list doesn't work.
 Patch by Yasuhiro Matsumoto, 2014 Dec 14.
 
@@ -161,6 +172,13 @@ Patch to allow values greater than 255 for ctermfg/ctermbg on Windows.
 
 Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
 
+Problem caused by patch 7.3.638: window->open does not update window
+correctly. Issue 91.  With patch.
+
+'ff' is wrong for one-line file without EOL. (Patch on Issue 77)
+
+Patch on Issue 72: 'autochdir' causes problems for :vimgrep.
+
 When 'balloonexpr' returns a list the result has a trailing newline.
 Just remove one trailing newline. (lcd, 2014 Oct 17)
 
@@ -255,7 +273,8 @@ New OpenOffice spell files support this with ICONV.  But they are not
 compatible with Vim spell files.  The old files can no longer be downloaded.
 
 Patch to make FocusGained and FocusLost work in modern terminals. (Hayaki
-Saito, 2013 Apr 24)
+Saito, 2013 Apr 24)  Has a problem (email 2015 Jan 7).
+Update 2015 Jan 10.
 
 Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
 More tests May 14. Update May 29.  Update Aug 10.
@@ -465,9 +484,6 @@ Works OK for echo, just not for  ":call" and ":call call()". (Ted, 2011 Mar
 Patch by Christian Brabandt, 2013 Mar 23.
 Not 100% sure this is the right solution.
 
-Problem caused by patch 7.3.638: window->open does not update window
-correctly. Issue 91.
-
 Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}.
 (Christian Brabandt, 2013 Dec 9)
 
@@ -526,8 +542,6 @@ Patch by Christian Brabandt, 2013 Apr 20, unfinished.
 
 Bug: findfile("any", "file:///tmp;") does not work.
 
-'ff' is wrong for one-line file without EOL. (Issue 77)
-
 Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
 Needs a different check for CLEARTYPE_QUALITY.
 
@@ -595,8 +609,6 @@ Should be possible to enable/disable matchparen per window or buffer.
 Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin
 Szamotulski, 2012 Nov 8)
 
-Issue 72: 'autochdir' causes problems for :vimgrep.
-
 Session file creation: 'autochdir' causes trouble.  Keep it off until after
 loading all files.
 
diff --git a/runtime/syntax/amiga.vim b/runtime/syntax/amiga.vim
index e70f995f68..4ccab1950f 100644
--- a/runtime/syntax/amiga.vim
+++ b/runtime/syntax/amiga.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	AmigaDos
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 11, 2006
-" Version:     6
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:     7
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_AMIGA
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/csh.vim b/runtime/syntax/csh.vim
index 39603fa158..a67cb09189 100644
--- a/runtime/syntax/csh.vim
+++ b/runtime/syntax/csh.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	C-shell (csh)
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Version:	10
-" Last Change:	Sep 11, 2006
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Version:	11
+" Last Change:	Oct 23, 2014
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_CSH
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/dcl.vim b/runtime/syntax/dcl.vim
index b051b08cf1..0c3e598578 100644
--- a/runtime/syntax/dcl.vim
+++ b/runtime/syntax/dcl.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	DCL (Digital Command Language - vms)
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 11, 2006
-" Version:	6
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	7
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_DCL
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/elmfilt.vim b/runtime/syntax/elmfilt.vim
index 0afa1694cf..e7d5df22aa 100644
--- a/runtime/syntax/elmfilt.vim
+++ b/runtime/syntax/elmfilt.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	Elm Filter rules
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 11, 2006
-" Version:	5
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	6
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_ELMFILT
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/exports.vim b/runtime/syntax/exports.vim
index 40b4b8806d..f695dc8d21 100644
--- a/runtime/syntax/exports.vim
+++ b/runtime/syntax/exports.vim
@@ -1,10 +1,10 @@
 " Vim syntax file
 " Language:	exports
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 06, 2005
-" Version:	4
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	5
 " Notes:		This file includes both SysV and BSD 'isms
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_EXPORTS
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/lisp.vim b/runtime/syntax/lisp.vim
index 74ec20bb4e..2528f4f9b1 100644
--- a/runtime/syntax/lisp.vim
+++ b/runtime/syntax/lisp.vim
@@ -1,28 +1,23 @@
 " Vim syntax file
 " Language:    Lisp
-" Maintainer:  Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change: Nov 16, 2010
-" Version:     22
-" URL:	       http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:  Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change: Oct 06, 2014
+" Version:     23
+" URL:	       http://www.drchip.org/astronaut/vim/index.html#SYNTAX_LISP
 "
-"  Thanks to F Xavier Noria for a list of 978 Common Lisp symbols
-"  taken from the HyperSpec
+"  Thanks to F Xavier Noria for a list of 978 Common Lisp symbols taken from HyperSpec
 "  Clisp additions courtesy of http://clisp.cvs.sourceforge.net/*checkout*/clisp/clisp/emacs/lisp.vim
 
 " ---------------------------------------------------------------------
 "  Load Once: {{{1
-" For vim-version 5.x: Clear all syntax items
-" For vim-version 6.x: Quit when a syntax file was already loaded
-if version < 600
-  syntax clear
-elseif exists("b:current_syntax")
-  finish
+if exists("b:current_syntax")
+ finish
 endif
 
-if version >= 600
- setlocal iskeyword=38,42,43,45,47-58,60-62,64-90,97-122,_
+if exists("g:lisp_isk")
+ exe "setl isk=".g:lisp_isk
 else
- set iskeyword=38,42,43,45,47-58,60-62,64-90,97-122,_
+ setl isk=38,42,43,45,47-58,60-62,64-90,97-122,_
 endif
 
 if exists("g:lispsyntax_ignorecase") || exists("g:lispsyntax_clisp")
diff --git a/runtime/syntax/maple.vim b/runtime/syntax/maple.vim
index b6e4ae9243..9c94643836 100644
--- a/runtime/syntax/maple.vim
+++ b/runtime/syntax/maple.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	Maple V (based on release 4)
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Jan 05, 2010
-" Version:	10
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	11
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_MAPLE
 "
 " Package Function Selection: {{{1
 " Because there are a lot of packages, and because of the potential for namespace
diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim
index 548f8c807f..86b997c29c 100644
--- a/runtime/syntax/rpcgen.vim
+++ b/runtime/syntax/rpcgen.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	rpcgen
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 06, 2005
-" Version:	8
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	9
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index 5ca5bc641a..f3218ffcb2 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -2,10 +2,10 @@
 " Language:		shell (sh) Korn shell (ksh) bash (sh)
 " Maintainer:		Charles E. Campbell  <NdrOchipS@PcampbellAfamily.Mbiz>
 " Previous Maintainer:	Lennart Schultz <Lennart.Schultz@ecmwf.int>
-" Last Change:		Mar 20, 2014
-" Version:		132
-" URL:		http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
-" For options and settings, please use:	:help ft-sh-syntax
+" Last Change:		Jan 08, 2015
+" Version:		134
+" URL:		http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
+" For options and settings, please use:      :help ft-sh-syntax
 " This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr)
 
 " For version 5.x: Clear all syntax items {{{1
@@ -17,7 +17,7 @@ elseif exists("b:current_syntax")
 endif
 
 " AFAICT "." should be considered part of the iskeyword.  Using iskeywords in
-" syntax is dicey, so the following code permits the user to
+" syntax is dicey, so the following code permits the user to prevent/override
 "  g:sh_isk set to a string	: specify iskeyword.
 "  g:sh_noisk exists	: don't change iskeyword
 "  g:sh_noisk does not exist	: (default) append "." to iskeyword
@@ -104,7 +104,7 @@ syn cluster shErrorList	contains=shDoError,shIfError,shInError,shCaseError,shEsa
 if exists("b:is_kornshell")
  syn cluster ErrorList add=shDTestError
 endif
-syn cluster shArithParenList	contains=shArithmetic,shCaseEsac,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement
+syn cluster shArithParenList	contains=shArithmetic,shCaseEsac,shComment,shDeref,shDerefSimple,shDo,shEcho,shEscape,shIf,shFor,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement
 syn cluster shArithList	contains=@shArithParenList,shParenError
 syn cluster shCaseEsacList	contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange
 syn cluster shCaseList	contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq
@@ -127,7 +127,7 @@ syn cluster shHereList	contains=shBeginHere,shHerePayload
 syn cluster shHereListDQ	contains=shBeginHere,@shDblQuoteList,shHerePayload
 syn cluster shIdList	contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr
 syn cluster shIfList	contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
-syn cluster shLoopList	contains=@shCaseList,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet,shOption
+syn cluster shLoopList	contains=@shCaseList,shIf,shFor,shForPP,shTestOpr,shExpr,shDblBrace,shConditional,shCaseEsac,shTest,@shErrorList,shSet,shOption
 syn cluster shSubShList	contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator
 syn cluster shTestList	contains=shCharClass,shComment,shCommandSub,shDeref,shDerefSimple,shExDoubleQuote,shDoubleQuote,shExpr,shNumber,shOperator,shExSingleQuote,shSingleQuote,shTestOpr,shTest,shCtrlSeq
 " Echo: {{{1
@@ -151,18 +151,18 @@ endif
 " Error Codes: {{{1
 " ============
 if !exists("g:sh_no_error")
- syn match	shDoError	"\<done\>"
- syn match	shIfError	"\<fi\>"
- syn match	shInError	"\<in\>"
- syn match	shCaseError	";;"
- syn match	shEsacError	"\<esac\>"
- syn match	shCurlyError	"}"
- syn match	shParenError	")"
- syn match	shOK	'\.\(done\|fi\|in\|esac\)'
+ syn match   shDoError "\<done\>"
+ syn match   shIfError "\<fi\>"
+ syn match   shInError "\<in\>"
+ syn match   shCaseError ";;"
+ syn match   shEsacError "\<esac\>"
+ syn match   shCurlyError "}"
+ syn match   shParenError ")"
+ syn match   shOK	'\.\(done\|fi\|in\|esac\)'
  if exists("b:is_kornshell")
-   syn match	shDTestError	"]]"
+  syn match     shDTestError "]]"
  endif
- syn match	shTestError	"]"
+ syn match     shTestError "]"
 endif
 
 " Options: {{{1
@@ -197,9 +197,10 @@ syn region shTest	transparent matchgroup=shStatement start="\<test\s" skip=+\\\\
 syn match  shTestOpr	contained	"<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
 syn match  shTestOpr	contained	'=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
 syn match  shTestPattern	contained	'\w\+'
-syn match  shTestDoubleQuote	contained	'\%(\%(\\\\\)*\\\)\@<!"[^"]*"'
+syn region shTestDoubleQuote	contained	start='"' skip='\\"' end='"' contains=shBQpairs
 syn match  shTestSingleQuote	contained	'\\.'
 syn match  shTestSingleQuote	contained	"'[^']*'"
+syn match  shBQpairs	contained	'\\\\'
 if exists("b:is_kornshell") || exists("b:is_bash")
  syn region  shDblBrace matchgroup=Delimiter start="\[\[" skip=+\\\\\|\\$+ end="\]\]"	contains=@shTestList
  syn region  shDblParen matchgroup=Delimiter start="((" skip=+\\\\\|\\$+ end="))"	contains=@shTestList
@@ -216,11 +217,11 @@ if s:sh_fold_ifdofor
  syn region shIf	fold transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>"   contains=@shIfList
  syn region shFor	fold matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\_s" end="\<do\>"me=e-2	contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
 else
- syn region shDo	transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>" contains=@shLoopList
+ syn region shDo	transparent matchgroup=shConditional start="\<do\>" matchgroup=shConditional end="\<done\>"	contains=@shLoopList
  syn region shIf	transparent matchgroup=shConditional start="\<if\_s" matchgroup=shConditional skip=+-fi\>+ end="\<;\_s*then\>" end="\<fi\>"   contains=@shIfList
  syn region shFor	matchgroup=shLoop start="\<for\ze\_s\s*\%(((\)\@!" end="\<in\>" end="\<do\>"me=e-2	contains=@shLoopList,shDblParen skipwhite nextgroup=shCurlyIn
- syn match  shForPP	'\<for\>\ze\_s*(('
 endif
+syn region shForPP	matchgroup=shLoop start='\<for\>\_s*((' end='))' contains=shTestOpr
 if exists("b:is_kornshell") || exists("b:is_bash")
  syn cluster shCaseList	add=shRepeat
  syn cluster shFunctionList	add=shRepeat
@@ -280,7 +281,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
 elseif !exists("g:sh_no_error")
  syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList
 endif
-syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(" skip='\\\\\|\\.' end=")"	contains=@shCommandSubList
+syn region shCmdParenRegion matchgroup=shCmdSubRegion start="(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
 
 if exists("b:is_bash")
  syn cluster shCommandSubList add=bashSpecialVariables,bashStatement
@@ -321,12 +322,12 @@ elseif !exists("g:sh_no_error")
 endif
 syn region  shSingleQuote	matchgroup=shQuote start=+'+ end=+'+		contains=@Spell
 syn region  shDoubleQuote	matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+	contains=@shDblQuoteList,shStringSpecial,@Spell
+"syn region  shDoubleQuote	matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+	contains=@shDblQuoteList,shStringSpecial,@Spell
 syn match   shStringSpecial	"[^[:print:] \t]"	contained
 syn match   shStringSpecial	"\%(\\\\\)*\\[\\"'`$()#]"
-"syn match   shSpecial	"[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"	nextgroup=shMoreSpecial,shComment
-syn match   shSpecial	"[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]"	nextgroup=shMoreSpecial
-syn match   shSpecial	"^\%(\\\\\)*\\[\\"'`$()#]"		nextgroup=shComment
-syn match   shMoreSpecial	"\%(\\\\\)*\\[\\"'`$()#]" 	contained	nextgroup=shMoreSpecial
+syn match   shSpecial	"[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
+syn match   shSpecial	"^\%(\\\\\)*\\[\\"'`$()#]"	nextgroup=shComment
+syn match   shMoreSpecial	"\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained
 
 " Comments: {{{1
 "==========
@@ -363,9 +364,9 @@ elseif s:sh_fold_heredoc
  syn region shHereDoc matchgroup=shRedir19 fold start="<<\\\z([^ \t|]*\)"		matchgroup=shRedir19 end="^\z1\s*$"
 
 else
- syn region shHereDoc matchgroup=shRedir20 start="<<\s*\\\=\z([^ \t|]*\)"		matchgroup=shRedir20 end="^\z1\s*$"	contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir20 start="<<\s*\\\=\z([^ \t|]*\)"		matchgroup=shRedir20 end="^\z1\s*$"    contains=@shDblQuoteList
  syn region shHereDoc matchgroup=shRedir21 start="<<\s*\"\z([^ \t|]*\)\""		matchgroup=shRedir21 end="^\z1\s*$"
- syn region shHereDoc matchgroup=shRedir22 start="<<-\s*\z([^ \t|]*\)"		matchgroup=shRedir22 end="^\s*\z1\s*$"	contains=@shDblQuoteList
+ syn region shHereDoc matchgroup=shRedir22 start="<<-\s*\z([^ \t|]*\)"		matchgroup=shRedir22 end="^\s*\z1\s*$" contains=@shDblQuoteList
  syn region shHereDoc matchgroup=shRedir23 start="<<-\s*'\z([^ \t|]*\)'"		matchgroup=shRedir23 end="^\s*\z1\s*$"
  syn region shHereDoc matchgroup=shRedir24 start="<<\s*'\z([^ \t|]*\)'"		matchgroup=shRedir24 end="^\z1\s*$"
  syn region shHereDoc matchgroup=shRedir25 start="<<-\s*\"\z([^ \t|]*\)\""		matchgroup=shRedir25 end="^\s*\z1\s*$"
@@ -450,21 +451,21 @@ syn match  shDerefSpecial	contained	"\({[#!]\)\@<=[[:alnum:]*@_]\+"	nextgroup=@s
 syn match  shDerefVar	contained	"{\@<=\k\+"		nextgroup=@shDerefVarList
 
 " sh ksh bash : ${var[... ]...}  array reference: {{{1
-syn region  shDerefVarArray	contained	matchgroup=shDeref start="\[" end="]"	contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
+syn region  shDerefVarArray   contained	matchgroup=shDeref start="\[" end="]"	contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
 
 " Special ${parameter OPERATOR word} handling: {{{1
-" sh ksh bash : ${parameter:-word}	word is default value
-" sh ksh bash : ${parameter:=word}	assign word as default value
-" sh ksh bash : ${parameter:?word}	display word if parameter is null
-" sh ksh bash : ${parameter:+word}	use word if parameter is not null, otherwise nothing
-"    ksh bash : ${parameter#pattern}	remove small left  pattern
-"    ksh bash : ${parameter##pattern}	remove large left  pattern
-"    ksh bash : ${parameter%pattern}	remove small right pattern
-"    ksh bash : ${parameter%%pattern}	remove large right pattern
-"        bash : ${parameter^pattern}	Case modification
-"        bash : ${parameter^^pattern}	Case modification
-"        bash : ${parameter,pattern}	Case modification
-"        bash : ${parameter,,pattern}	Case modification
+" sh ksh bash : ${parameter:-word}    word is default value
+" sh ksh bash : ${parameter:=word}    assign word as default value
+" sh ksh bash : ${parameter:?word}    display word if parameter is null
+" sh ksh bash : ${parameter:+word}    use word if parameter is not null, otherwise nothing
+"    ksh bash : ${parameter#pattern}  remove small left  pattern
+"    ksh bash : ${parameter##pattern} remove large left  pattern
+"    ksh bash : ${parameter%pattern}  remove small right pattern
+"    ksh bash : ${parameter%%pattern} remove large right pattern
+"        bash : ${parameter^pattern}  Case modification
+"        bash : ${parameter^^pattern} Case modification
+"        bash : ${parameter,pattern}  Case modification
+"        bash : ${parameter,,pattern} Case modification
 syn cluster shDerefPatternList	contains=shDerefPattern,shDerefString
 if !exists("g:sh_no_error")
  syn match shDerefOpError	contained	":[[:punct:]]"
@@ -576,7 +577,7 @@ hi def link shDoubleQuote	shString
 hi def link shEcho	shString
 hi def link shEchoDelim	shOperator
 hi def link shEchoQuote	shString
-hi def link shForPP	shLoop
+"hi def link shForPP	shLoop
 hi def link shEmbeddedEcho	shString
 hi def link shEscape	shCommandSub
 hi def link shExDoubleQuote	shDoubleQuote
@@ -598,12 +599,12 @@ hi def link shSetOption	shOption
 hi def link shSingleQuote	shString
 hi def link shSource	shOperator
 hi def link shStringSpecial	shSpecial
-hi def link shStringSpecial	Unique
 hi def link shSubShRegion	shOperator
 hi def link shTestOpr	shConditional
 hi def link shTestPattern	shString
 hi def link shTestDoubleQuote	shString
 hi def link shTestSingleQuote	shString
+hi def link shBQpairs	shString
 hi def link shVariable	shSetList
 hi def link shWrapLineOperator	shOperator
 
diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim
index 2f9e6d7d01..48df7e5789 100644
--- a/runtime/syntax/sm.vim
+++ b/runtime/syntax/sm.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	sendmail
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 06, 2005
-" Version:	4
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:	5
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/tags.vim b/runtime/syntax/tags.vim
index 051d65aa6e..c86f17a618 100644
--- a/runtime/syntax/tags.vim
+++ b/runtime/syntax/tags.vim
@@ -1,8 +1,8 @@
 " Language:		tags
-" Maintainer:	Dr. Charles E. Campbell, Jr.  <NdrOchip@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 06, 2005
-" Version:		3
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Maintainer:	Charles E. Campbell  <NdrOchip@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:		4
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TAGS
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim
index 3f719e8244..dcdeca2e6c 100644
--- a/runtime/syntax/tex.vim
+++ b/runtime/syntax/tex.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	TeX
 " Maintainer:	Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
-" Last Change:	Sep 09, 2014
-" Version:	82
+" Last Change:	Nov 18, 2014
+" Version:	83
 " URL:		http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
 "
 " Notes: {{{1
@@ -64,6 +64,8 @@ if version >= 508 || !exists("did_tex_syntax_inits")
 endif
 if exists("g:tex_no_error") && g:tex_no_error
  let s:tex_no_error= 1
+else
+ let s:tex_no_error= 0
 endif
 
 " by default, enable all region-based highlighting
@@ -76,7 +78,6 @@ if exists("g:tex_fast")
  else
   let s:tex_fast= g:tex_fast
  endif
- let s:tex_no_error= 1
 else
  let s:tex_fast= "bcmMprsSvV"
 endif
@@ -141,7 +142,7 @@ endif
 " Clusters: {{{1
 " --------
 syn cluster texCmdGroup		contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
  syn cluster texCmdGroup	add=texMathError
 endif
 syn cluster texEnvGroup		contains=texMatcher,texMathDelim,texSpecialChar,texStatement
@@ -157,13 +158,13 @@ else
 endif
 syn cluster texPreambleMatchGroup	contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
 syn cluster texRefGroup		contains=texMatcher,texComment,texDelimiter
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
  syn cluster texMathZones	contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
  syn cluster texMatchGroup	add=@texMathZones
  syn cluster texMathDelimGroup	contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
  syn cluster texMathMatchGroup	contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone
  syn cluster texMathZoneGroup	contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle
- if !exists("s:tex_no_error")
+ if !exists("s:tex_no_error") || !s:tex_no_error
   syn cluster texMathMatchGroup	add=texMathError
   syn cluster texMathZoneGroup	add=texMathError
  endif
@@ -185,7 +186,7 @@ endif
 
 " Try to flag {} and () mismatches: {{{1
 if s:tex_fast =~ 'm'
-  if !exists("s:tex_no_error")
+  if !exists("s:tex_no_error") || !s:tex_no_error
    syn region texMatcher		matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]"	end="}"		contains=@texMatchGroup,texError
    syn region texMatcher		matchgroup=Delimiter start="\["				end="]"		contains=@texMatchGroup,texError,@NoSpell
   else
@@ -198,12 +199,12 @@ if s:tex_fast =~ 'm'
    syn region texParen		start="("						end=")"		contains=@texMatchGroup
   endif
 endif
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
  syn match  texError		"[}\])]"
 endif
 if s:tex_fast =~ 'M'
-  if !exists("tex_no_math")
-   if !exists("s:tex_no_error")
+  if !exists("g:tex_no_math")
+   if !exists("s:tex_no_error") || !s:tex_no_error
     syn match  texMathError	"}"	contained
    endif
    syn region texMathMatcher	matchgroup=Delimiter	start="{"          skip="\\\\\|\\}"     end="}" end="%stopzone\>"	contained contains=@texMathMatchGroup
@@ -217,7 +218,7 @@ if exists("g:tex_tex") || b:tex_stylish
   syn match texStatement	"\\[a-zA-Z@]\+"
 else
   syn match texStatement	"\\\a\+"
-  if !exists("s:tex_no_error")
+  if !exists("s:tex_no_error") || !s:tex_no_error
    syn match texError		"\\\a*@[a-zA-Z@]*"
   endif
 endif
@@ -358,6 +359,7 @@ if s:tex_fast =~ 'p'
     syn region texSubParaZone		matchgroup=texSection start='\\subparagraph\>'		 end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)'	contains=@texFoldGroup,@Spell
     syn region texTitle			matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}'													contains=@texFoldGroup,@Spell
     syn region texAbstract		matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}'											contains=@texFoldGroup,@Spell
+    syn region texSpellZone		matchgroup=texSpellZone start="%spellzone_start"	 end="%spellzone_end"												contains=@Spell
    endif
   else
    if g:tex_fold_enabled && has("folding")
@@ -397,14 +399,14 @@ if s:tex_fast =~ 'b'
 endif
 
 " Bad Math (mismatched): {{{1
-if !exists("g:tex_no_math") && !exists("s:tex_no_error")
+if !exists("g:tex_no_math") && (!exists("s:tex_no_error") || !s:tex_no_error)
  syn match texBadMath		"\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
  syn match texBadMath		"\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
  syn match texBadMath		"\\[\])]"
 endif
 
 " Math Zones: {{{1
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
  " TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2
  "                 Starred forms are created if starform is true.  Starred
  "                 forms have syntax group and synchronization groups with a
@@ -541,7 +543,7 @@ else
   syn match texSpecialChar	"\\[SP@]\A"me=e-1
 endif
 syn match texSpecialChar	"\\\\"
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
  syn match texOnlyMath		"[_^]"
 endif
 syn match texSpecialChar	"\^\^[0-9a-f]\{2}\|\^\^\S"
@@ -574,12 +576,14 @@ else
    syn match  texComment	"%.*$"			contains=@texCommentGroup
    if s:tex_fast =~ 'c'
     syn region texComment	start="^\zs\s*%.*\_s*%"	skip="^\s*%"	end='^\ze\s*[^%]' fold
-    syn region texNoSpell	contained fold		matchgroup=texComment start="%\s*nospell\s*{"	end="%\s*nospell\s*}"	contains=@texFoldGroup,@NoSpell
+    syn region texNoSpell	contained	matchgroup=texComment start="%\s*nospell\s*{"		end="%\s*nospell\s*}"	fold contains=@texFoldGroup,@NoSpell
+    syn region texSpellZone		 	matchgroup=texComment start="%\s*spellzone_start"	end="%\s*spellzone_end"	fold contains=@Spell,@texFoldGroup
    endif
   else
-   syn match texComment		"%.*$"			contains=@texCommentGroup
+   syn match texComment		"%.*$"		contains=@texCommentGroup
    if s:tex_fast =~ 'c'
-    syn region texNoSpell	contained		matchgroup=texComment start="%\s*nospell\s*{"	end="%\s*nospell\s*}"	contains=@texFoldGroup,@NoSpell
+    syn region texNoSpell	contained	matchgroup=texComment start="%\s*nospell\s*{"		end="%\s*nospell\s*}"	contains=@texFoldGroup,@NoSpell
+    syn region  texSpellZone		 	matchgroup=texComment start="%\s*spellzone_start"	end="%\s*spellzone_end"	contains=@Spell,@texFoldGroup
    endif
   endif
 endif
@@ -663,7 +667,7 @@ syn match  texLength		"\<\d\+\([.,]\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\
 syn match texString		"\(``\|''\|,,\)"
 
 " makeatletter -- makeatother sections
-if !exists("s:tex_no_error")
+if !exists("s:tex_no_error") || !s:tex_no_error
  if s:tex_fast =~ 'S'
   syn region texStyle			matchgroup=texStatement start='\\makeatletter' end='\\makeatother'	contains=@texStyleGroup contained
  endif
@@ -794,8 +798,8 @@ if has("conceal") && &enc == 'utf-8'
     \ ['left('		, '('],
     \ ['left\['		, '['],
     \ ['left\\{'	, '{'],
-    \ ['leftarrow'	, '⟵'],
-    \ ['Leftarrow'	, '⟸'],
+    \ ['leftarrow'	, '←'],
+    \ ['Leftarrow'	, '⇐'],
     \ ['leftarrowtail'	, '↢'],
     \ ['leftharpoondown', '↽'],
     \ ['leftharpoonup'	, '↼'],
@@ -881,8 +885,8 @@ if has("conceal") && &enc == 'utf-8'
     \ ['right)'		, ')'],
     \ ['right]'		, ']'],
     \ ['right\\}'	, '}'],
-    \ ['rightarrow'	, '⟶'],
-    \ ['Rightarrow'	, '⟹'],
+    \ ['rightarrow'	, '→'],
+    \ ['Rightarrow'	, '⇒'],
     \ ['rightarrowtail'	, '↣'],
     \ ['rightleftharpoons', '⇌'],
     \ ['rightsquigarrow', '↝'],
@@ -995,6 +999,7 @@ if has("conceal") && &enc == 'utf-8'
   syn match texMathSymbol '\\hat{W}' contained conceal cchar=Ŵ
   syn match texMathSymbol '\\hat{y}' contained conceal cchar=ŷ
   syn match texMathSymbol '\\hat{Y}' contained conceal cchar=Ŷ
+"  syn match texMathSymbol '\\bar{a}' contained conceal cchar=a̅
  endif
 
  " Greek {{{2
@@ -1011,7 +1016,7 @@ if has("conceal") && &enc == 'utf-8'
   call s:Greek('texGreek','\\zeta\>'		,'ζ')
   call s:Greek('texGreek','\\eta\>'		,'η')
   call s:Greek('texGreek','\\theta\>'		,'θ')
-  call s:Greek('texGreek','\\vartheta\>'		,'ϑ')
+  call s:Greek('texGreek','\\vartheta\>'	,'ϑ')
   call s:Greek('texGreek','\\kappa\>'		,'κ')
   call s:Greek('texGreek','\\lambda\>'		,'λ')
   call s:Greek('texGreek','\\mu\>'		,'μ')
@@ -1022,11 +1027,11 @@ if has("conceal") && &enc == 'utf-8'
   call s:Greek('texGreek','\\rho\>'		,'ρ')
   call s:Greek('texGreek','\\varrho\>'		,'ϱ')
   call s:Greek('texGreek','\\sigma\>'		,'σ')
-  call s:Greek('texGreek','\\varsigma\>'		,'ς')
+  call s:Greek('texGreek','\\varsigma\>'	,'ς')
   call s:Greek('texGreek','\\tau\>'		,'τ')
   call s:Greek('texGreek','\\upsilon\>'		,'υ')
-  call s:Greek('texGreek','\\phi\>'		,'φ')
-  call s:Greek('texGreek','\\varphi\>'		,'ϕ')
+  call s:Greek('texGreek','\\phi\>'		,'ϕ')
+  call s:Greek('texGreek','\\varphi\>'		,'φ')
   call s:Greek('texGreek','\\chi\>'		,'χ')
   call s:Greek('texGreek','\\psi\>'		,'ψ')
   call s:Greek('texGreek','\\omega\>'		,'ω')
@@ -1245,7 +1250,7 @@ syn  sync match texSyncStop			groupthere NONE		"%stopzone\>"
 " (one can't tell if a "$$" starts or stops a math zone by itself)
 " The following grouptheres coupled with minlines above
 " help improve the odds of good syncing.
-if !exists("tex_no_math")
+if !exists("g:tex_no_math")
  syn sync match texSyncMathZoneA		groupthere NONE		"\\end{abstract}"
  syn sync match texSyncMathZoneA		groupthere NONE		"\\end{center}"
  syn sync match texSyncMathZoneA		groupthere NONE		"\\end{description}"
@@ -1285,7 +1290,7 @@ if did_tex_syntax_inits == 1
   HiLink texInputFileOpt	texCmdArgs
   HiLink texInputCurlies	texDelimiter
   HiLink texLigature		texSpecialChar
-  if !exists("tex_no_math")
+  if !exists("g:tex_no_math")
    HiLink texMathDelimSet1	texMathDelim
    HiLink texMathDelimSet2	texMathDelim
    HiLink texMathDelimKey	texMathDelim
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 8d98f7d7d8..1d97998462 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	Vim 7.4 script
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Mar 20, 2014
-" Version:	7.4-27
+" Last Change:	Nov 28, 2014
+" Version:	7.4-19
 " Automatically generated keyword lists: {{{1
 
 " Quit when a syntax file was already loaded {{{2
@@ -14,26 +14,27 @@ set cpo&vim
 
 " vimTodo: contains common special-notices for comments {{{2
 " Use the vimCommentGroup cluster to add your own.
+syn keyword vimTodo contained	COMBAK	FIXME	TODO	XXX
 syn cluster vimCommentGroup	contains=vimTodo,@Spell
 
 " regular vim commands {{{2
-syn keyword vimCommand contained	a arga[dd] ar[gs] bd[elete] bN[ext] breakd[el] bufdo cabc[lear] cat[ch] cex[pr] c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpt[ags] iabc[lear] intro k l lan lc[d] lefta[bove] lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] r[ead] redr[aw] retu[rn] rub[y] rv[iminfo] sba[ll] sbN[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu
-syn keyword vimCommand contained	ab argd[elete] argu[ment] bel[owright] bo[tright] breakl[ist] b[uffer] cad cb[uffer] cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h hi if is[earch] keepa la lan[guage] lch[dir] lex[pr] lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] rec[over] redraws[tatus] rew[ind] rubyd[o] sal[l] sbf[irst] sbp[revious] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme
-syn keyword vimCommand contained	abc[lear] argdo as[cii] bf[irst] bp[revious] br[ewind] buffers caddb[uffer] cc cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] red reg[isters] ri[ght] rubyf[ile] san[dbox] sbl[ast] sbr[ewind] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu
-syn keyword vimCommand contained	abo[veleft] arge[dit] au bl[ast] br bro[wse] bun[load] cad[dexpr] ccl[ose] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r redi[r] res[ize] rightb[elow] rundo sa[rgument] sbm[odified] sb[uffer] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo
-syn keyword vimCommand contained	al[l] argg[lobal] bad[d] bm[odified] brea[k] bu bw[ipeout] caddf[ile] cd cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re red[o] ret[ab] ru ru[ntime] sav[eas] sbn[ext] scrip se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank]
-syn keyword vimCommand contained	ar argl[ocal] ba[ll] bn[ext] breaka[dd] buf c cal[l] ce[nter] cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] le[ft] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q 
-syn match   vimCommand contained	"\<z[-+^.=]\="
+syn keyword vimCommand contained	a arga[dd] ar[gs] bd[elete] bN[ext] breakl[ist] b[uffer] cad cb[uffer] cf[ile] changes cl[ist] cn[ext] col[der] conf[irm] cq[uit] cw[indow] delc[ommand] deletl delp diffpu[t] dir doau ea e[dit] endfo[r] ene[w] files fini[sh] foldd[oopen] g h helpt[ags] iabc[lear] intro k l lan lc[d] lefta[bove] lg[etfile] lla[st] lnew[er] lNf[ile] lockv[ar] ls lvimgrepa[dd] mat[ch] mk[exrc] mo n n[ext] nu[mber] opt[ions] pe[rl] pr prof[ile] ptj[ump] ptp[revious] py3 q r[ead] redr[aw] retu[rn] rub[y] rv[iminfo] sba[ll] sbN[ext] scripte[ncoding] setf[iletype] sh[ell] sim[alt] sm[ap] sni[ff] sor[t] spelli[nfo] spr[evious] start st[op] sunmenu syn ta tabf[ind] tabnew tabr[ewind] tcld[o] tj[ump] tN tr tu[nmenu] undoj[oin] uns[ilent] ve[rsion] vimgrepa[dd] vs[plit] winc[md] wN[ext] ws[verb] x[it] xnoremenu
+syn keyword vimCommand contained	ab argd[elete] argu[ment] bel[owright] bo[tright] br[ewind] buffers caddb[uffer] cc cfir[st] chd[ir] clo[se] cN[ext] colo[rscheme] con[tinue] cr[ewind] d delel deletp dep diffs[plit] di[splay] dp earlier el[se] endfun ex filet fir[st] foldo[pen] go[to] ha[rdcopy] hi if is[earch] keepa la lan[guage] lch[dir] lex[pr] lgr[ep] lli[st] lne[xt] lo lol[der] lt[ag] lw[indow] menut mks[ession] mod[e] nbc[lose] nmapc[lear] o ownsyntax perld[o] pre[serve] promptf[ind] ptl[ast] ptr[ewind] py3do qa[ll] rec[over] redraws[tatus] rew[ind] rubyd[o] sal[l] sbf[irst] sbp[revious] scrip[tnames] setg[lobal] si sl sme sno[magic] so[urce] spellr[epall] sre[wind] startg[replace] stopi[nsert] sus[pend] sync tab tabfir[st] tabn[ext] tabs tclf[ile] tl[ast] tn[ext] tr[ewind] u undol[ist] up[date] vert[ical] vi[sual] w windo wp[revious] wundo xmapc[lear] xunme
+syn keyword vimCommand contained	abc[lear] argdo as[cii] bf[irst] bp[revious] bro[wse] bun[load] cad[dexpr] ccl[ose] cgetb[uffer] che[ckpath] cmapc[lear] cnf com cope[n] cs de delep delf di difft[his] dj[ump] dr[op] ec elsei[f] endf[unction] exi[t] filetype fix[del] for gr[ep] h[elp] hid[e] ij[ump] isp[lit] keepalt lad la[st] lcl[ose] lf[ile] lgrepa[dd] lmak[e] lN[ext] loadk lop[en] lua ma menut[ranslate] mksp[ell] m[ove] nb[key] noa ol[dfiles] p po[p] prev[ious] promptr[epl] ptn pts[elect] pydo q[uit] red reg[isters] ri[ght] rubyf[ile] san[dbox] sbl[ast] sbr[ewind] scs setl[ocal] sig sla[st] smenu snoreme spe spellu[ndo] st star[tinsert] sts[elect] sv[iew] syncbind tabc[lose] tabl[ast] tabN[ext] ta[g] te[aroff] tm tN[ext] try un unh[ide] v vi viu[sage] wa[ll] winp[os] wq wv[iminfo] xme xunmenu
+syn keyword vimCommand contained	abo[veleft] arge[dit] au bl[ast] brea[k] bu bw[ipeout] caddf[ile] cd cgete[xpr] checkt[ime] cn cNf comc[lear] co[py] cscope debug d[elete] delf[unction] diffg[et] diffu[pdate] dl ds[earch] echoe[rr] em[enu] en[dif] exu[sage] fin fo[ld] fu grepa[dd] helpc[lose] his[tory] il[ist] iuna[bbrev] keepj[umps] laddb[uffer] lat lcs lfir[st] lh[elpgrep] lmapc[lear] lnf loadkeymap lpf[ile] luado mak[e] mes mkv mz nbs[tart] noautocmd omapc[lear] pc[lose] popu p[rint] ps[earch] ptN pu[t] pyf[ile] quita[ll] redi[r] res[ize] rightb[elow] rundo sa[rgument] sbm[odified] sb[uffer] scscope sf[ind] sign sl[eep] sn[ext] snoremenu spelld[ump] spellw[rong] sta[g] startr[eplace] sun[hide] sw[apname] syntime tabd[o] tabm[ove] tabo[nly] tags tf[irst] tm[enu] to[pleft] ts[elect] una[bbreviate] unl ve vie[w] vmapc[lear] wh[ile] win[size] wqa[ll] x xmenu xwininfo
+syn keyword vimCommand contained	al[l] argg[lobal] bad[d] bm[odified] breaka[dd] buf c cal[l] ce[nter] cg[etfile] cl cN cnf[ile] comp[iler] cpf[ile] cstag debugg[reedy] deletel dell diffo[ff] dig dli[st] dsp[lit] echom[sg] en endt[ry] f fina[lly] foldc[lose] fun gui helpf[ind] i imapc[lear] j[oin] kee[pmarks] lad[dexpr] later lcscope lgetb[uffer] l[ist] lN lNf lo[adview] lp[revious] luafile ma[rk] messages mkvie[w] mzf[ile] ne noh[lsearch] on[ly] pe popu[p] pro pta[g] ptn[ext] pw[d] py[thon] r red[o] ret[ab] ru ru[ntime] sav[eas] sbn[ext] scrip se[t] sfir[st] sil[ent] sm[agic] sN[ext] so spe[llgood] sp[lit] star stj[ump] sunme sy t tabe[dit] tabN tabp[revious] tc[l] th[row] tn tp[revious] tu u[ndo] unlo[ckvar] verb[ose] vim[grep] vne[w] win wn[ext] w[rite] xa[ll] xnoreme y[ank]
+syn keyword vimCommand contained	ar argl[ocal] ba[ll] bn[ext] breakd[el] bufdo cabc[lear] cat[ch] cex[pr] c[hange] cla[st] cnew[er] cNf[ile] con cp[revious] cuna[bbrev] del deletep delm[arks] diffp[atch] dig[raphs] do e echon endf endw[hile] f[ile] fin[d] folddoc[losed] fu[nction] gvim helpg[rep] ia in ju[mps] keepp[atterns] laddf[ile] lb[uffer] le[ft] lgete[xpr] ll lne lnf[ile] loc[kmarks] lr[ewind] lv[imgrep] marks mk mkv[imrc] mz[scheme] new noswap[file] o[pen] ped[it] pp[op] profd[el] ptf[irst] ptN[ext] py python3 re 
+syn match   vimCommand contained	"\<z[-+^.=]\=\>"
 syn keyword vimStdPlugin contained	DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns 
 
 " vimOptions are caught only when contained in a vimSet {{{2
-syn keyword vimOption contained	acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap lines lmap ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleftcmd ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wcm whichwrap wildignore winaltkeys winminwidth wmnu write
-syn keyword vimOption contained	ai ambw ari aw backupext beval biosk brk buflisted cdpath cin cinwords cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu linespace loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rl ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa wd wi wildignorecase window winwidth wmw writeany
-syn keyword vimOption contained	akm anti arshape awa backupskip bex bioskey browsedir buftype cedit cindent clipboard cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel laststatus lisp lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt report rlc ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak weirdinvert wic wildmenu winfixheight wiv wop writebackup
-syn keyword vimOption contained	al antialias autochdir background balloondelay bexpr bk bs casemap cf cink cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg lazyredraw lispwords ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re restorescreen rnu rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfh wig wildmode winfixwidth wiw wrap writedelay
-syn keyword vimOption contained	aleph ar autoindent backspace ballooneval bg bkc bsdir cb cfu cinkeys cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lbr list lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly revins ro runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wfw wildchar wildoptions winheight wm wrapmargin ws
-syn keyword vimOption contained	allowrevins arab autoread backup balloonexpr bh bl bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lcs listchars lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime ri rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc wh wildcharm wim winminheight wmh wrapscan ww
-syn keyword vimOption contained	altkeymap arabic autowrite backupcopy bdir bin bomb bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp linebreak lm lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine rightleft rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell 
+syn keyword vimOption contained	acd ambiwidth arabicshape autowriteall backupdir bdlay binary breakat bs casemap cf cink cmdheight colorcolumn completefunc copyindent cryptmethod cscopeverbose csverb debug dict dir eb enc errorbells expandtab fdl fenc fileencodings fkmap foldenable foldminlines formatprg gdefault gp guifontset helpfile hidden hl ignorecase imcmdline imsf indentexpr is isp keywordprg laststatus lisp loadplugins macatsui maxcombine mef mls modelines mousehide mp nu omnifunc paragraphs penc pm printdevice printoptions quoteescape remap rightleftcmd rtp sbo scrolljump sel shell shelltype shortname shq sm so spellfile spr st sts swapsync syn tag tb termbidi tgst titleold top ttimeoutlen ttyscroll ul ur verbosefile visualbell wcm wi wildmenu winfixwidth wm wrapscan
+syn keyword vimOption contained	ai ambw ari aw backupext beval biosk breakindent bsdir cb cfu cinkeys cmdwinheight columns completeopt cot cscopepathcomp cspc cuc deco dictionary directory ed encoding errorfile exrc fdls fencs fileformat flp foldexpr foldnestmax fp gfm grepformat guifontwide helpheight highlight hlg im imd imstatusfunc indentkeys isf isprint km lazyredraw lispwords lpl magic maxfuncdepth menuitems mm modifiable mousem mps number opendevice paste pex pmbcs printencoding prompt rdt renderoptions rl ru sbr scrolloff selection shellcmdflag shellxescape showbreak si smartcase softtabstop spelllang sps sta su swb synmaxcol tagbsearch tbi termencoding thesaurus titlestring tpm ttm ttytype undodir ut vfile vop wd wic wildmode winheight wmh write
+syn keyword vimOption contained	akm anti arshape awa backupskip bex bioskey breakindentopt bsk cc ch cino cmp com concealcursor cp cscopeprg csprg cul def diff display edcompatible endofline errorformat fcl fdm fex fileformats fml foldignore foldopen fs gfn grepprg guiheadroom helplang history hls imactivatefunc imdisable inc indk isfname joinspaces kmp lbr list ls makeef maxmapdepth mfd mmd modified mousemodel msm numberwidth operatorfunc pastetoggle pexpr pmbfn printexpr pt re report rlc ruf sc scrollopt selectmode shellpipe shellxquote showcmd sidescroll smartindent sol spellsuggest sr stal sua swf syntax taglength tbidi terse tildeop tl tr tty tw undofile vb vi wa weirdinvert wig wildoptions winminheight wmnu writeany
+syn keyword vimOption contained	al antialias autochdir background balloondelay bexpr bk bri bt ccv charconvert cinoptions cms comments conceallevel cpo cscopequickfix csqf cursorbind define diffexpr dy ef eol esckeys fcs fdn ff fileignorecase fmr foldlevel foldtext fsync gfs gtl guioptions hf hk hlsearch imactivatekey imi include inex isi js kp lcs listchars lsp makeprg maxmem mh mmp more mouses mzq nuw opfunc patchexpr pfn popt printfont pumheight readonly restorescreen rnu ruler scb scs sessionoptions shellquote shiftround showfulltag sidescrolloff smarttab sp spf srr startofline suffixes switchbuf ta tagrelative tbis textauto timeout tm ts ttybuiltin tx undolevels vbs viewdir wak wfh wildchar wim winminwidth wmw writebackup
+syn keyword vimOption contained	aleph ar autoindent backspace ballooneval bg bkc briopt bufhidden cd ci cinw co commentstring confirm cpoptions cscoperelative csre cursorcolumn delcombine diffopt ea efm ep et fdc fdo ffs filetype fo foldlevelstart formatexpr ft gfw gtt guipty hh hkmap ic imaf iminsert includeexpr inf isident key langmap linebreak lm lw mat maxmempattern mis mmt mouse mouseshape mzquantum odev osfiletype patchmode ph preserveindent printheader pvh redrawtime revins ro rulerformat scr sect sft shellredir shiftwidth showmatch siso smc spc spl ss statusline suffixesadd sws tabline tags tbs textmode timeoutlen to tsl ttyfast uc undoreload vdir viewoptions warn wfw wildcharm winaltkeys winwidth wop writedelay
+syn keyword vimOption contained	allowrevins arab autoread backup balloonexpr bh bl brk buflisted cdpath cin cinwords cocu compatible consk cpt cscopetag cst cursorline dex digraph ead ei equalalways eventignore fde fdt fic fillchars foldclose foldmarker formatlistpat gcr ghr guicursor guitablabel hi hkmapp icon imak ims incsearch infercase isk keymap langmenu lines lmap lz matchpairs maxmemtot mkspellmem mod mousef mouset nf oft pa path pheader previewheight printmbcharset pvw regexpengine ri rop runtimepath scroll sections sh shellslash shm showmode sj smd spell splitbelow ssl stl sw sxe tabpagemax tagstack tenc textwidth title toolbar tsr ttym udf updatecount ve viminfo wb wh wildignore window wiv wrap ws
+syn keyword vimOption contained	altkeymap arabic autowrite backupcopy bdir bin bomb browsedir buftype cedit cindent clipboard cole complete conskey crb cscopetagorder csto cwh dg dip eadirection ek equalprg ex fdi fen fileencoding fk foldcolumn foldmethod formatoptions gd go guifont guitabtooltip hid hkp iconstring imc imsearch inde insertmode iskeyword keymodel langnoremap linespace lnr ma matchtime mco ml modeline mousefocus mousetime nrformats ofu para pdev pi previewwindow printmbfont qe relativenumber rightleft rs sb scrollbind secure shcf shelltemp shortmess showtabline slm sn spellcapcheck splitright ssop stmp swapfile sxq tabstop tal term tf titlelen toolbariconsize ttimeout ttymouse udir updatetime verbose virtualedit wc whichwrap wildignorecase winfixheight wiw wrapmargin ww
 
 " vimOptions: These are the turn-off setting variants {{{2
 syn keyword vimOption contained	noacd noallowrevins noantialias noarabic noarshape noautoread noaw noballooneval nobinary nobk nobuflisted nocin noconfirm nocopyindent nocscoperelative nocsre nocuc nocursorcolumn nodelcombine nodigraph noed noendofline noerrorbells noex nofen nofk nogd nohid nohkmap nohkp nohlsearch noicon noim noimcmdline noimdisable noinf noinsertmode nojoinspaces nolazyredraw nolinebreak nolist nolpl noma nomagic noml nomodeline nomodified nomousef nomousehide nonumber noopendevice nopi nopreviewwindow nopvw norelativenumber norestorescreen nori norl noro noru nosb noscb noscs nosft noshelltemp noshortname noshowfulltag noshowmode nosm nosmartindent nosmd nosol nosplitbelow nospr nossl nostartofline noswapfile nota notagrelative notbi notbs noterse notextmode notgst notimeout noto notr nottybuiltin notx noundofile novisualbell nowarn noweirdinvert nowfw nowildignorecase nowinfixheight nowiv nowrap nowrite nowritebackup
@@ -62,7 +63,7 @@ syn keyword vimErrSetting contained	hardtabs ht w1200 w300 w9600
 
 " AutoCmd Events {{{2
 syn case ignore
-syn keyword vimAutoEvent contained	BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave 
+syn keyword vimAutoEvent contained	BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdUndefined CmdwinEnter CmdwinLeave ColorScheme CompleteDone CursorHold CursorHoldI CursorMoved CursorMovedI EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave MenuPopup QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SessionLoadPost ShellCmdPost ShellFilterPost SourceCmd SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabEnter TabLeave TermChanged TermResponse TextChanged TextChangedI User UserGettingBored VimEnter VimLeave VimLeavePre VimResized WinEnter WinLeave 
 
 " Highlight commonly used Groupnames {{{2
 syn keyword vimGroup contained	Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo 
@@ -73,9 +74,9 @@ syn match vimHLGroup contained	"Conceal"
 syn case match
 
 " Function Names {{{2
-syn keyword vimFuncName contained	abs and argidx atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcwd getfsize getline getpid getreg gettabwinvar getwinvar has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setpos setreg settabwinvar sha256 shiftwidth sin sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
-syn keyword vimFuncName contained	acos append argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setline setmatches setqflist settabvar setwinvar shellescape simplify sinh soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagenr tagfiles tan tempname toupper trunc undofile values visualmode winbufnr winheight winnr winrestview winwidth xor
-syn keyword vimFuncName contained	add argc asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getfperm getftype getmatches getqflist gettabvar getwinposy globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client 
+syn keyword vimFuncName contained	abs and argidx asin browse buflisted bufnr byteidx ceil cindent complete confirm cosh cursor did_filetype empty eventhandler exists expr8 filereadable finddir floor fnamemodify foldlevel foreground get getchar getcmdpos getcwd getfsize getline getpid getreg gettabwinvar getwinvar has hasmapto histget hlID indent inputdialog inputsave invert items len line localtime luaeval mapcheck matchaddpos matchend max mode nr2char pow pumvisible range reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcmdpos setmatches setreg setwinvar shiftwidth sin sort spellbadword split str2float strchars strftime string strpart strtrans submatch synconcealed synIDattr synstack systemlist tabpagenr tagfiles tan tempname toupper trunc undofile uniq virtcol wildmenumode wincol winline winrestcmd winsaveview writefile
+syn keyword vimFuncName contained	acos append arglistid atan browsedir bufloaded bufwinnr byteidxcomp changenr clearmatches complete_add copy count deepcopy diff_filler escape executable exp extend filewritable findfile fmod foldclosed foldtext function getbufline getcharmod getcmdtype getfontname getftime getloclist getpos getregtype getwinposx glob has_key histadd histnr hostname index inputlist inputsecret isdirectory join libcall line2byte log map match matcharg matchlist min mzeval or prevnonblank py3eval readfile remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setline setpos settabvar sha256 simplify sinh soundfold spellsuggest sqrt str2nr strdisplaywidth stridx strlen strridx strwidth substitute synID synIDtrans system tabpagebuflist tabpagewinnr taglist tanh tolower tr type undotree values visualmode winbufnr winheight winnr winrestview winwidth xor
+syn keyword vimFuncName contained	add argc argv atan2 bufexists bufname byte2line call char2nr col complete_check cos cscope_connection delete diff_hlID eval exepath expand feedkeys filter float2nr fnameescape foldclosedend foldtextresult garbagecollect getbufvar getcmdline getcurpos getfperm getftype getmatches getqflist gettabvar getwinposy globpath haslocaldir histdel hlexists iconv input inputrestore insert islocked keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr mkdir nextnonblank pathshorten printf pyeval reltime remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setloclist setqflist settabwinvar shellescape 
 
 "--- syntax here and above generated by mkvimvim ---
 " Special Vim Highlighting (not automatic) {{{1
@@ -96,17 +97,17 @@ endif
 
 " Numbers {{{2
 " =======
-syn match vimNumber	"\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
-syn match vimNumber	"-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\="  skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
+syn match vimNumber	"\<\d\+\([lL]\|\.\d\+\)\="
+syn match vimNumber	"-\d\+\([lL]\|\.\d\+\)\="
 syn match vimNumber	"\<0[xX]\x\+"
-syn match vimNumber	"#\x\{6}"
+syn match vimNumber	"\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
 
 " All vimCommands are contained by vimIsCommands. {{{2
-syn match vimCmdSep	"[:|]\+"	skipwhite nextgroup=vimAddress,vimAutoCmd,vimCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
+syn match vimCmdSep	"[:|]\+"	skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd
 syn match vimIsCommand	"\<\h\w*\>"	contains=vimCommand
-syn match vimVar        contained	"\<\h[a-zA-Z0-9#_]*\>"
-syn match vimVar		"\<[bwglsav]:\h[a-zA-Z0-9#_]*\>"
-syn match vimFBVar      contained   "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>"
+syn match vimVar		"\<[bwglsav]:\K\k*\>"
+syn match vimVar        contained	"\<\K\k*\>"
+syn match vimFBVar      contained   "\<[bwglsav]:\K\k*\>"
 syn keyword vimCommand  contained	in
 
 " Insertions And Appends: insert append {{{2
@@ -134,26 +135,25 @@ syn keyword vimFTOption contained	detect indent off on plugin
 
 " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
-syn cluster vimAugroupList	contains=vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
+syn cluster vimAugroupList	contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'a'
- syn region  vimAugroup	fold start="\<aug\%[roup]\>\s\+\h\w*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>"	contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
+ syn region  vimAugroup	fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>"	contains=vimAutoCmd,@vimAugroupList
 else
- syn region  vimAugroup	start="\<aug\%[roup]\>\s\+\h\w*" end="\<aug\%[roup]\>\s\+[eE][nN][dD]\>"	contains=vimAugroupKey,vimAutoCmd,@vimAugroupList keepend
+ syn region  vimAugroup	matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>"	contains=vimAutoCmd,@vimAugroupList
 endif
 syn match   vimAugroup	"aug\%[roup]!" contains=vimAugroupKey
 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror")
  syn match   vimAugroupError	"\<aug\%[roup]\>\s\+[eE][nN][dD]\>"
 endif
-syn keyword vimAugroupKey contained	aug[roup]
+"syn keyword vimAugroupKey contained	aug[roup]
 
 " Operators: {{{2
 " =========
-" COMBAK: vimOperParen used to have "oneline"
-syn cluster	vimOperGroup	contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
+syn cluster	vimOperGroup	contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
 syn match	vimOper	"\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"	skipwhite nextgroup=vimString,vimSpecFile
 syn match	vimOper	"||\|&&\|[-+.]"	skipwhite nextgroup=vimString,vimSpecFile
-syn region	vimOperParen 	matchgroup=vimParenSep	start="(" end=")" contains=@vimOperGroup
-syn region	vimOperParen	matchgroup=vimSep	start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
+syn region	vimOperParen 	oneline matchgroup=vimParenSep	start="(" end=")" contains=@vimOperGroup
+syn region	vimOperParen	oneline matchgroup=vimSep	start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
  syn match	vimOperError	")"
 endif
@@ -161,7 +161,7 @@ endif
 " Functions : Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster	vimFuncList	contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
-syn cluster	vimFuncBodyList	contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
+syn cluster	vimFuncBodyList	contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUserCommand
 syn match	vimFunction	"\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*("	contains=@vimFuncList nextgroup=vimFuncBody
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
@@ -169,7 +169,7 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
 else
  syn region	vimFuncBody  contained	start="\ze("	matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)"		contains=@vimFuncBodyList
 endif
-syn match	vimFuncVar   contained	"a:\(\h\w*\|\d\+\)"
+syn match	vimFuncVar   contained	"a:\(\K\k*\|\d\+\)"
 syn match	vimFuncSID   contained	"\c<sid>\|\<s:"
 syn keyword	vimFuncKey   contained	fu[nction]
 syn match	vimFuncBlank contained	"\s\+"
@@ -203,9 +203,9 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
 endif
 syn case ignore
 syn keyword	vimUserAttrbKey   contained	bar	ban[g]	cou[nt]	ra[nge] com[plete]	n[args]	re[gister]
-syn keyword	vimUserAttrbCmplt contained	augroup buffer color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var
+syn keyword	vimUserAttrbCmplt contained	augroup buffer command dir environment event expression file function help highlight mapping menu option shellcmd something tag tag_listfiles var
 syn keyword	vimUserAttrbCmplt contained	custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
-syn match	vimUserAttrbCmpltFunc contained	",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
+syn match	vimUserAttrbCmpltFunc contained	",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\u\w*\)\+\|\u\w*\)"hs=s+1 nextgroup=vimUserCmdError
 
 syn case match
 syn match	vimUserAttrbCmplt contained	"custom,\u\w*"
@@ -232,8 +232,8 @@ syn region	vimPatSepZone	oneline   contained   matchgroup=vimPatSepZ start="\\%\
 syn region	vimPatRegion	contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)"	contains=@vimSubstList oneline
 syn match	vimNotPatSep	contained	"\\\\"
 syn cluster	vimStringGroup	contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
-syn region	vimString	oneline keepend	start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+	contains=@vimStringGroup
-syn region	vimString	oneline keepend	start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+
+syn region	vimString	oneline keepend	start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+	contains=@vimStringGroup
+syn region	vimString	oneline keepend	start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
 syn region	vimString	oneline	start=+=!+lc=1	skip=+\\\\\|\\!+ end=+!+	contains=@vimStringGroup
 syn region	vimString	oneline	start="=+"lc=1	skip="\\\\\|\\+" end="+"	contains=@vimStringGroup
 syn region	vimString	oneline	start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/"	contains=@vimStringGroup
@@ -245,7 +245,7 @@ syn match	vimStringCont	contained	+\(\\\\\|.\)\{-}[^\\]"+
 syn cluster	vimSubstList	contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
 syn cluster	vimSubstRepList	contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
 syn cluster	vimSubstList	add=vimCollection
-syn match	vimSubst	"\(:\+\s*\|^\s*\||\s*\)\<\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[:[:alpha:]]\@!" nextgroup=vimSubstPat
+syn match	vimSubst	"\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat
 syn match	vimSubst	"s\%[ubstitute][:#[:alpha:]]\@!"	nextgroup=vimSubstPat contained
 syn match	vimSubst	"/\zss\%[ubstitute]\ze/"	nextgroup=vimSubstPat
 syn match	vimSubst1       contained	"s\%[ubstitute]\>"	nextgroup=vimSubstPat
@@ -289,7 +289,7 @@ syn match	vimCmplxRepeat	'@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
 
 " Set command and associated set-options (vimOptions) with comment {{{2
 syn region	vimSet		matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
-syn region	vimSetEqual	contained	start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline
+syn region	vimSetEqual	contained	start="[=:]\|[-+^]=" skip="\%(\\\\\)*\\." end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation oneline
 syn region	vimSetString	contained	start=+="+hs=s+1	skip=+\\\\\|\\"+  end=+"+	contains=vimCtrlChar
 syn match	vimSetSep	contained	"[,:]"
 syn match	vimSetMod	contained	"&vim\=\|[!&?<]\|all&"
@@ -326,9 +326,9 @@ syn keyword	vimMap		mapc[lear] smapc[lear]
 syn keyword	vimUnmap		cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] unm[ap] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs
 syn match	vimMapLhs	contained	"\S\+"			contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs
 syn match	vimMapBang	contained	"!"			skipwhite nextgroup=vimMapMod,vimMapLhs
-syn match	vimMapMod	contained	"\c<\(buffer\|expr\|\(local\)\=leader\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
+syn match	vimMapMod	contained	"\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs
 syn match	vimMapRhs	contained	".*" contains=vimNotation,vimCtrlChar	skipnl nextgroup=vimMapRhsExtend
-syn match	vimMapRhsExtend	contained	"^\s*\\.*$"			contains=vimNotation,vimCtrlChar,vimContinue	skipnl nextgroup=vimMapRhsExtend
+syn match	vimMapRhsExtend	contained	"^\s*\\.*$"			contains=vimContinue
 syn case ignore
 syn keyword	vimMapModKey	contained	buffer	expr	leader	localleader	plug	script	sid	silent	unique
 syn case match
@@ -348,7 +348,7 @@ syn match	vimMenuBang	"!"	contained skipwhite nextgroup=@vimMenuList
 " Angle-Bracket Notation (tnx to Michael Geddes) {{{2
 " ======================
 syn case ignore
-syn match	vimNotation	"\(\\\|<lt>\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k\d\>\)\)>" contains=vimBracket
+syn match	vimNotation	"\(\\\|<lt>\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\|cr\|lf\|linefeed\|return\|k\=del\%[ete]\|bs\|backspace\|tab\|esc\|right\|left\|help\|undo\|insert\|ins\|k\=home\|k\=end\|kplus\|kminus\|kdivide\|kmultiply\|kenter\|kpoint\|space\|k\=\(page\)\=\(\|down\|up\|k[0-9]\)\)>" contains=vimBracket
 syn match	vimNotation	"\(\\\|<lt>\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>"	contains=vimBracket
 syn match	vimNotation	"\(\\\|<lt>\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>"		contains=vimBracket
 syn match	vimNotation	'\(\\\|<lt>\)\=<C-R>[0-9a-z"%#:.\-=]'he=e-1			contains=vimBracket
@@ -360,8 +360,8 @@ syn case match
 " User Function Highlighting {{{2
 " (following Gautam Iyer's suggestion)
 " ==========================
-syn match vimFunc		"\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*("		contains=vimFuncName,vimUserFunc,vimExecute
-syn match vimUserFunc contained	"\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>"	contains=vimNotation
+syn match vimFunc		"\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*("		contains=vimFuncName,vimUserFunc,vimExecute
+syn match vimUserFunc contained	"\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%([a-zA-Z0-9_.]\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>"	contains=vimNotation
 syn match vimNotFunc	"\<if\>\|\<el\%[seif]\>\|\<return\>\|\<while\>"
 
 " Errors And Warnings: {{{2
@@ -407,7 +407,7 @@ syn keyword	vimSynType	contained	clear	skipwhite nextgroup=vimGroupList
 
 " Syntax: cluster {{{2
 syn keyword	vimSynType	contained	cluster	skipwhite nextgroup=vimClusterName
-syn region	vimClusterName	contained	matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
+syn region	vimClusterName	contained	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="$\||" contains=vimGroupAdd,vimGroupRem,vimSynContains,vimSynError
 syn match	vimGroupAdd	contained	"add="	nextgroup=vimGroupList
 syn match	vimGroupRem	contained	"remove="	nextgroup=vimGroupList
 syn cluster vimFuncBodyList add=vimSynType,vimGroupAdd,vimGroupRem
@@ -419,17 +419,17 @@ syn cluster vimFuncBodyList add=vimSynType
 " Syntax: keyword {{{2
 syn cluster	vimSynKeyGroup	contains=vimSynNextgroup,vimSynKeyOpt,vimSynKeyContainedin
 syn keyword	vimSynType	contained	keyword	skipwhite nextgroup=vimSynKeyRegion
-syn region	vimSynKeyRegion	contained oneline keepend	matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
+syn region	vimSynKeyRegion	contained oneline keepend	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" matchgroup=vimSep end="|\|$" contains=@vimSynKeyGroup
 syn match	vimSynKeyOpt	contained	"\<\(conceal\|contained\|transparent\|skipempty\|skipwhite\|skipnl\)\>"
 syn cluster vimFuncBodyList add=vimSynType
 
 " Syntax: match {{{2
 syn cluster	vimSynMtchGroup	contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
 syn keyword	vimSynType	contained	match	skipwhite nextgroup=vimSynMatchRegion
-syn region	vimSynMatchRegion	contained keepend	matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
+syn region	vimSynMatchRegion	contained keepend	matchgroup=vimGroupName start="\k\+" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
 syn match	vimSynMtchOpt	contained	"\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
 if has("conceal")
- syn match	vimSynMtchOpt	contained	"\<cchar="	nextgroup=vimSynMtchCchar
+ syn match	vimSynMtchOpt	contained	"\<cchar="	nextgroup=VimSynMtchCchar
  syn match	vimSynMtchCchar	contained	"\S"
 endif
 syn cluster vimFuncBodyList add=vimSynMtchGroup
@@ -441,7 +441,7 @@ syn keyword	vimSynType	contained	enable	list	manual	off	on	reset
 syn cluster	vimSynRegPatGroup	contains=vimPatSep,vimNotPatSep,vimSynPatRange,vimSynNotPatRange,vimSubstSubstr,vimPatRegion,vimPatSepErr,vimNotation
 syn cluster	vimSynRegGroup	contains=vimSynContains,vimSynNextgroup,vimSynRegOpt,vimSynReg,vimSynMtchGrp
 syn keyword	vimSynType	contained	region	skipwhite nextgroup=vimSynRegion
-syn region	vimSynRegion	contained keepend	matchgroup=vimGroupName start="\h\w*" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
+syn region	vimSynRegion	contained keepend	matchgroup=vimGroupName start="\k\+" skip="\\\\\|\\|" end="|\|$" contains=@vimSynRegGroup
 syn match	vimSynRegOpt	contained	"\<\(conceal\(ends\)\=\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|keepend\|oneline\|extend\|skipnl\|fold\)\>"
 syn match	vimSynReg	contained	"\(start\|skip\|end\)="he=e-1	nextgroup=vimSynRegPat
 syn match	vimSynMtchGrp	contained	"matchgroup="	nextgroup=vimGroup,vimHLGroup
@@ -467,9 +467,9 @@ syn keyword	vimSyncRegion	contained	region	skipwhite	nextgroup=vimSynReg
 syn match	vimSyncLinebreak	contained	"\<linebreaks="	skipwhite	nextgroup=vimNumber
 syn keyword	vimSyncLinecont	contained	linecont	skipwhite	nextgroup=vimSynRegPat
 syn match	vimSyncLines	contained	"\(min\|max\)\=lines="	nextgroup=vimNumber
-syn match	vimSyncGroupName	contained	"\h\w*"	skipwhite	nextgroup=vimSyncKey
+syn match	vimSyncGroupName	contained	"\k\+"	skipwhite	nextgroup=vimSyncKey
 syn match	vimSyncKey	contained	"\<groupthere\|grouphere\>"	skipwhite nextgroup=vimSyncGroup
-syn match	vimSyncGroup	contained	"\h\w*"	skipwhite	nextgroup=vimSynRegPat,vimSyncNone
+syn match	vimSyncGroup	contained	"\k\+"	skipwhite	nextgroup=vimSynRegPat,vimSyncNone
 syn keyword	vimSyncNone	contained	NONE
 
 " Additional IsCommand, here by reasons of precedence {{{2
@@ -510,18 +510,17 @@ endif
 syn match	vimHiTerm	contained	"\cterm="he=e-1		nextgroup=vimHiAttribList
 syn match	vimHiStartStop	contained	"\c\(start\|stop\)="he=e-1	nextgroup=vimHiTermcap,vimOption
 syn match	vimHiCTerm	contained	"\ccterm="he=e-1		nextgroup=vimHiAttribList
-syn match	vimHiCtermFgBg	contained	"\ccterm[fb]g="he=e-1	nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
+syn match	vimHiCtermFgBg	contained	"\ccterm[fb]g="he=e-1	nextgroup=vimNumber,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError
 syn match	vimHiGui	contained	"\cgui="he=e-1		nextgroup=vimHiAttribList
 syn match	vimHiGuiFont	contained	"\cfont="he=e-1		nextgroup=vimHiFontname
 syn match	vimHiGuiFgBg	contained	"\cgui\%([fb]g\|sp\)="he=e-1	nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib
 syn match	vimHiTermcap	contained	"\S\+"		contains=vimNotation
-syn match	vimHiNmbr	contained	'\d\+'
 
 " Highlight: clear {{{2
 syn keyword	vimHiClear	contained	clear	nextgroup=vimHiGroup
 
 " Highlight: link {{{2
-syn region	vimHiLink	contained oneline matchgroup=vimCommand start="\(\<hi\%[ghlight]\s\+\)\@<=\(\(def\%[ault]\s\+\)\=link\>\|\<def\>\)" end="$"	contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
+syn region	vimHiLink	contained oneline matchgroup=vimCommand start="\<\(def\%[ault]\s\+\)\=link\>\|\<def\>" end="$"	contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation
 syn cluster vimFuncBodyList add=vimHiLink
 
 " Control Characters {{{2
@@ -540,8 +539,8 @@ syn match	vimCommentTitleLeader	'"\s\+'ms=s+1	contained
 " ====================
 syn match	vimSearch	'^\s*[/?].*'		contains=vimSearchDelim
 syn match	vimSearchDelim	'^\s*\zs[/?]\|[/?]$'	contained
-syn region	vimGlobal	matchgroup=Statement start='\<g\%[lobal]!\=/'  skip='\\.' end='/'	skipwhite nextgroup=vimSubst
-syn region	vimGlobal	matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'	skipwhite nextgroup=vimSubst
+syn region	vimGlobal	matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/'
+syn region	vimGlobal	matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'
 
 " Scripts  : perl,ruby : Benoit Cerrina {{{2
 " =======    python,tcl: Johannes Zellner
@@ -563,12 +562,7 @@ endif
 " [-- lua --] {{{3
 let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
 if !filereadable(s:luapath)
- for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
-  if filereadable(fnameescape(s:luapath))
-   let s:luapath= fnameescape(s:luapath)
-   break
-  endif
- endfor
+ let s:luapath= fnameescape(globpath(&rtp,"syntax/lua.vim"))
 endif
 if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath)
  unlet! b:current_syntax
@@ -590,12 +584,7 @@ unlet s:luapath
 " [-- perl --] {{{3
 let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
 if !filereadable(s:perlpath)
- for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
-  if filereadable(fnameescape(s:perlpath))
-   let s:perlpath= fnameescape(s:perlpath)
-   break
-  endif
- endfor
+ let s:perlpath= fnameescape(globpath(&rtp,"syntax/perl.vim"))
 endif
 if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath)
  unlet! b:current_syntax
@@ -617,12 +606,7 @@ unlet s:perlpath
 " [-- ruby --] {{{3
 let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
 if !filereadable(s:rubypath)
- for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
-  if filereadable(fnameescape(s:rubypath))
-   let s:rubypath= fnameescape(s:rubypath)
-   break
-  endif
- endfor
+ let s:rubypath= fnameescape(globpath(&rtp,"syntax/ruby.vim"))
 endif
 if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath)
  unlet! b:current_syntax
@@ -643,27 +627,28 @@ unlet s:rubypath
 " [-- python --] {{{3
 let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
 if !filereadable(s:pythonpath)
- for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
-  if filereadable(fnameescape(s:pythonpath))
-   let s:pythonpath= fnameescape(s:pythonpath)
-   break
-  endif
- endfor
+ let s:pythonpath= fnameescape(globpath(&rtp,"syntax/python.vim"))
 endif
-if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
+if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(s:pythonpath)
  unlet! b:current_syntax
  exe "syn include @vimPythonScript ".s:pythonpath
  if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'P'
   syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+	contains=@vimPythonScript
   syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+		contains=@vimPythonScript
+  syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+	contains=@vimPythonScript
+  syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+		contains=@vimPythonScript
  else
   syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+		contains=@vimPythonScript
   syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+		contains=@vimPythonScript
+  syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\z(.*\)$+ end=+^\z1$+		contains=@vimPythonScript
+  syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+		contains=@vimPythonScript
  endif
  syn cluster vimFuncBodyList	add=vimPythonRegion
 else
  syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
  syn region vimEmbedError start=+py\%[thon]3\=\s*<<\s*$+ end=+\.$+
+ syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*\z(.*\)$+ end=+^\z1$+
+ syn region vimEmbedError start=+Py\%[thon]2or3\=\s*<<\s*$+ end=+\.$+
 endif
 unlet s:pythonpath
 
@@ -677,12 +662,7 @@ endif
 if s:trytcl
  let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
  if !filereadable(s:tclpath)
-  for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
-   if filereadable(fnameescape(s:tclpath))
-    let s:tclpath= fnameescape(s:tclpath)
-    break
-   endif
-  endfor
+  let s:tclpath= fnameescape(globpath(&rtp,"syntax/tcl.vim"))
  endif
  if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath)
   unlet! b:current_syntax
@@ -709,12 +689,7 @@ unlet s:trytcl
 " [-- mzscheme --] {{{3
 let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
 if !filereadable(s:mzschemepath)
- for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
-  if filereadable(fnameescape(s:mzschemepath))
-   let s:mzschemepath= fnameescape(s:mzschemepath)
-   break
-  endif
- endfor
+ let s:mzschemepath= fnameescape(globpath(&rtp,"syntax/scheme.vim"))
 endif
 if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
  unlet! b:current_syntax
@@ -752,6 +727,9 @@ syn sync match vimAugroupSyncA	groupthere NONE	"\<aug\%[roup]\>\s\+[eE][nN][dD]"
 " Highlighting Settings {{{2
 " ====================
 
+hi def link vimAuHighlight	vimHighlight
+hi def link vimSubst1	vimSubst
+hi def link vimBehaveModel	vimBehave
 
 if !exists("g:vimsyn_noerror")
  hi def link vimBehaveError	vimError
@@ -774,43 +752,22 @@ endif
 hi def link vimAbb	vimCommand
 hi def link vimAddress	vimMark
 hi def link vimAugroupKey	vimCommand
-hi def link vimAuHighlight	vimHighlight
 hi def link vimAutoCmdOpt	vimOption
 hi def link vimAutoCmd	vimCommand
-hi def link vimAutoEvent	Type
 hi def link vimAutoSet	vimCommand
-hi def link vimBehaveModel	vimBehave
 hi def link vimBehave	vimCommand
-hi def link vimBracket	Delimiter
-hi def link vimCmplxRepeat	SpecialChar
-hi def link vimCommand	Statement
-hi def link vimComment	Comment
 hi def link vimCommentString	vimString
-hi def link vimCommentTitle	PreProc
 hi def link vimCondHL	vimCommand
-hi def link vimContinue	Special
-hi def link vimCtrlChar	SpecialChar
 hi def link vimEchoHLNone	vimGroup
 hi def link vimEchoHL	vimCommand
-hi def link vimElseIfErr	Error
 hi def link vimElseif	vimCondHL
-hi def link vimEnvvar	PreProc
-hi def link vimError	Error
-hi def link vimFBVar	vimVar
 hi def link vimFgBgAttrib	vimHiAttrib
-hi def link vimFold	Folded
 hi def link vimFTCmd	vimCommand
 hi def link vimFTOption	vimSynType
 hi def link vimFuncKey	vimCommand
-hi def link vimFuncName	Function
-hi def link vimFuncSID	Special
-hi def link vimFuncVar	Identifier
 hi def link vimGroupAdd	vimSynOption
 hi def link vimGroupName	vimGroup
 hi def link vimGroupRem	vimSynOption
-hi def link vimGroupSpecial	Special
-hi def link vimGroup	Type
-hi def link vimHiAttrib	PreProc
 hi def link vimHiClear	vimHighlight
 hi def link vimHiCtermFgBg	vimHiTerm
 hi def link vimHiCTerm	vimHiTerm
@@ -820,94 +777,111 @@ hi def link vimHiGuiFgBg	vimHiTerm
 hi def link vimHiGuiFont	vimHiTerm
 hi def link vimHiGuiRgb	vimNumber
 hi def link vimHiGui	vimHiTerm
-hi def link vimHiNmbr	Number
 hi def link vimHiStartStop	vimHiTerm
-hi def link vimHiTerm	Type
 hi def link vimHLGroup	vimGroup
-hi def link vimHLMod	PreProc
 hi def link vimInsert	vimString
 hi def link vimKeyCode	vimSpecFile
-hi def link vimKeyword	Statement
 hi def link vimLet	vimCommand
 hi def link vimLineComment	vimComment
 hi def link vimMapBang	vimCommand
 hi def link vimMapModKey	vimFuncSID
 hi def link vimMapMod	vimBracket
 hi def link vimMap	vimCommand
-hi def link vimMark	Number
 hi def link vimMarkNumber	vimNumber
 hi def link vimMenuMod	vimMapMod
 hi def link vimMenuNameMore	vimMenuName
-hi def link vimMenuName	PreProc
 hi def link vimMtchComment	vimComment
 hi def link vimNorm	vimCommand
-hi def link vimNotation	Special
 hi def link vimNotFunc	vimCommand
 hi def link vimNotPatSep	vimString
-hi def link vimNumber	Number
-hi def link vimOperError	Error
-hi def link vimOper	Operator
-hi def link vimOption	PreProc
-hi def link vimParenSep	Delimiter
 hi def link vimPatSepErr	vimPatSep
 hi def link vimPatSepR	vimPatSep
-hi def link vimPatSep	SpecialChar
 hi def link vimPatSepZone	vimString
 hi def link vimPatSepZ	vimPatSep
-hi def link vimPattern	Type
 hi def link vimPlainMark	vimMark
 hi def link vimPlainRegister	vimRegister
-hi def link vimRegister	SpecialChar
-hi def link vimScriptDelim	Comment
-hi def link vimSearchDelim	Statement
 hi def link vimSearch	vimString
-hi def link vimSep	Delimiter
 hi def link vimSetMod	vimOption
-hi def link vimSetSep	Statement
 hi def link vimSetString	vimString
-hi def link vimSpecFile	Identifier
 hi def link vimSpecFileMod	vimSpecFile
-hi def link vimSpecial	Type
-hi def link vimStatement	Statement
 hi def link vimStringCont	vimString
-hi def link vimString	String
-hi def link vimSubst1	vimSubst
-hi def link vimSubstDelim	Delimiter
-hi def link vimSubstFlags	Special
-hi def link vimSubstSubstr	SpecialChar
 hi def link vimSubstTwoBS	vimString
 hi def link vimSubst	vimCommand
-hi def link vimSynCaseError	Error
-hi def link vimSynCase	Type
-hi def link vimSyncC	Type
-hi def link vimSyncError	Error
 hi def link vimSyncGroupName	vimGroupName
 hi def link vimSyncGroup	vimGroupName
-hi def link vimSyncKey	Type
-hi def link vimSyncNone	Type
 hi def link vimSynContains	vimSynOption
-hi def link vimSynError	Error
 hi def link vimSynKeyContainedin	vimSynContains
 hi def link vimSynKeyOpt	vimSynOption
 hi def link vimSynMtchGrp	vimSynOption
 hi def link vimSynMtchOpt	vimSynOption
 hi def link vimSynNextgroup	vimSynOption
 hi def link vimSynNotPatRange	vimSynRegPat
-hi def link vimSynOption	Special
 hi def link vimSynPatRange	vimString
 hi def link vimSynRegOpt	vimSynOption
 hi def link vimSynRegPat	vimString
-hi def link vimSynReg	Type
 hi def link vimSyntax	vimCommand
 hi def link vimSynType	vimSpecial
-hi def link vimTodo	Todo
 hi def link vimUnmap	vimMap
-hi def link vimUserAttrbCmpltFunc	Special
 hi def link vimUserAttrbCmplt	vimSpecial
 hi def link vimUserAttrbKey	vimOption
 hi def link vimUserAttrb	vimSpecial
-hi def link vimUserCmdError	Error
 hi def link vimUserCommand	vimCommand
+
+hi def link vimAutoEvent	Type
+hi def link vimBracket	Delimiter
+hi def link vimCmplxRepeat	SpecialChar
+hi def link vimCommand	Statement
+hi def link vimComment	Comment
+hi def link vimCommentTitle	PreProc
+hi def link vimContinue	Special
+hi def link vimCtrlChar	SpecialChar
+hi def link vimElseIfErr	Error
+hi def link vimEnvvar	PreProc
+hi def link vimError	Error
+hi def link vimFold	Folded
+hi def link vimFuncName	Function
+hi def link vimFuncSID	Special
+hi def link vimFuncVar	Identifier
+hi def link vimGroupSpecial	Special
+hi def link vimGroup	Type
+hi def link vimHiAttrib	PreProc
+hi def link vimHiTerm	Type
+hi def link vimHLMod	PreProc
+hi def link vimKeyword	Statement
+hi def link vimMark	Number
+hi def link vimMenuName	PreProc
+hi def link vimNotation	Special
+hi def link vimNumber	Number
+hi def link vimOperError	Error
+hi def link vimOper	Operator
+hi def link vimOption	PreProc
+hi def link vimParenSep	Delimiter
+hi def link vimPatSep	SpecialChar
+hi def link vimPattern	Type
+hi def link vimRegister	SpecialChar
+hi def link vimScriptDelim	Comment
+hi def link vimSearchDelim	Statement
+hi def link vimSep	Delimiter
+hi def link vimSetSep	Statement
+hi def link vimSpecFile	Identifier
+hi def link vimSpecial	Type
+hi def link vimStatement	Statement
+hi def link vimString	String
+hi def link vimSubstDelim	Delimiter
+hi def link vimSubstFlags	Special
+hi def link vimSubstSubstr	SpecialChar
+hi def link vimSynCaseError	Error
+hi def link vimSynCase	Type
+hi def link vimSyncC	Type
+hi def link vimSyncError	Error
+hi def link vimSyncKey	Type
+hi def link vimSyncNone	Type
+hi def link vimSynError	Error
+hi def link vimSynOption	Special
+hi def link vimSynReg	Type
+hi def link vimTodo	Todo
+hi def link vimUserAttrbCmpltFunc	Special
+hi def link vimUserCmdError	Error
 hi def link vimUserFunc	Normal
 hi def link vimVar	Identifier
 hi def link vimWarn	WarningMsg
diff --git a/runtime/syntax/xmath.vim b/runtime/syntax/xmath.vim
index 83efb08db2..5434f928c7 100644
--- a/runtime/syntax/xmath.vim
+++ b/runtime/syntax/xmath.vim
@@ -1,9 +1,9 @@
 " Vim syntax file
 " Language:	xmath (a simulation tool)
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
 " Last Change:	Sep 11, 2006
-" Version:	6
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" Version:	7
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/xxd.vim b/runtime/syntax/xxd.vim
index 50594e1fcf..b2b1e44603 100644
--- a/runtime/syntax/xxd.vim
+++ b/runtime/syntax/xxd.vim
@@ -1,10 +1,10 @@
 " Vim syntax file
 " Language:		bin using xxd
-" Maintainer:	Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Sep 06, 2005
-" Version:		7
+" Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
+" Last Change:	Oct 23, 2014
+" Version:		8
 " Notes:		use :help xxd   to see how to invoke it
-" URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
+" URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD
 
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim
index 17a1cab6b7..cc1c847747 100644
--- a/runtime/syntax/yacc.vim
+++ b/runtime/syntax/yacc.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:	Yacc
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Mar 20, 2014
+" Last Change:	Nov 14, 2012
 " Version:	11
 " URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
 "
@@ -42,7 +42,7 @@ exe "syn include @yaccCode ".s:Cpath
 " ---------------------------------------------------------------------
 "  Yacc Clusters: {{{1
 syn cluster yaccInitCluster	contains=yaccKey,yaccKeyActn,yaccBrkt,yaccType,yaccString,yaccUnionStart,yaccHeader2,yaccComment,yaccDefines,yaccParseParam,yaccParseOption
-syn cluster yaccRulesCluster	contains=yaccNonterminal,yaccString,yaccComment
+syn cluster yaccRulesCluster	contains=yaccNonterminal,yaccString
 
 " ---------------------------------------------------------------------
 "  Yacc Sections: {{{1

From c767fc9fd27d091da5953b532036038ae61dc80f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 11:25:05 +0100
Subject: [PATCH 389/473] updated for version 7.4.568 Problem:    Giving an
 error for ":0wincmd w" is a problem for some plugins. Solution:   Allow the
 zero in the range. (Marcin Szamotulski)

---
 src/ex_docmd.c                    | 3 +--
 src/testdir/test_command_count.ok | 4 ++--
 src/version.c                     | 2 ++
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 3276abfdbc..c36f407406 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4686,8 +4686,7 @@ invalid_range(eap)
 		    return (char_u *)_(e_invrange);
 		break;
 	    case ADDR_WINDOWS:
-		if (eap->line1 < 1
-			|| eap->line2 > LAST_WIN_NR)
+		if (eap->line2 > LAST_WIN_NR)
 		    return (char_u *)_(e_invrange);
 		break;
 	    case ADDR_TABS:
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
index a936715b36..d554ae765d 100644
--- a/src/testdir/test_command_count.ok
+++ b/src/testdir/test_command_count.ok
@@ -21,8 +21,8 @@ LocalRangeLines 2 5
 4argu d
 1argu a
 100b E16: Invalid range
-0close E16: Invalid range
-$close 4
+0close 
+$close 3
 $+close E16: Invalid range
 $tabe 2
 $+tabe E16: Invalid range
diff --git a/src/version.c b/src/version.c
index 8b3ecbe90c..4f9777ffa9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    568,
 /**/
     567,
 /**/

From 94a0602a679ee94e33a176f53720fad0d7157771 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 11:25:05 +0100
Subject: [PATCH 390/473] Added tag v7-4-568 for changeset 747cbac7047b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index dcdbc48d61..48e9ecadf5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3290,3 +3290,4 @@ b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 22f95a018b13dc9d8a3246d990a1ea0b5b3a264d v7-4-565
 a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
 0b245c8dbd19755e08b5248110a537a74ddb92c4 v7-4-567
+747cbac7047bf8d003ff0672b25b60e0236fdb1b v7-4-568

From 419a1f19e0a1df1348825006d6510b8e9c6115eb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 12:44:41 +0100
Subject: [PATCH 391/473] updated for version 7.4.569 Problem:    Having CTRL-C
 interrupt or not does not check the mode of the 	    mapping. (Ingo
 Karkat) Solution:   Use a bitmask with the map mode. (Christian Brabandt)

---
 src/getchar.c               | 14 ++++++++++++--
 src/globals.h               |  2 +-
 src/structs.h               |  1 +
 src/testdir/test_mapping.in |  9 +++++++++
 src/testdir/test_mapping.ok |  2 ++
 src/ui.c                    |  2 +-
 src/version.c               |  2 ++
 7 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/getchar.c b/src/getchar.c
index 174cfa892f..3ae5f40609 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3708,8 +3708,13 @@ do_map(maptype, arg, mode, abbrev)
 	if (!did_it)
 	    retval = 2;			    /* no match */
 	else if (*keys == Ctrl_C)
+	{
 	    /* If CTRL-C has been unmapped, reuse it for Interrupting. */
-	    mapped_ctrl_c = FALSE;
+	    if (map_table == curbuf->b_maphash)
+		curbuf->b_mapped_ctrl_c &= ~mode;
+	    else
+		mapped_ctrl_c &= ~mode;
+	}
 	goto theend;
     }
 
@@ -3744,7 +3749,12 @@ do_map(maptype, arg, mode, abbrev)
 
     /* If CTRL-C has been mapped, don't always use it for Interrupting. */
     if (*keys == Ctrl_C)
-	mapped_ctrl_c = TRUE;
+    {
+	if (map_table == curbuf->b_maphash)
+	    curbuf->b_mapped_ctrl_c |= mode;
+	else
+	    mapped_ctrl_c |= mode;
+    }
 
     mp->m_keys = vim_strsave(keys);
     mp->m_str = vim_strsave(rhs);
diff --git a/src/globals.h b/src/globals.h
index d1fdc33acc..a26a8b535a 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -958,7 +958,7 @@ EXTERN char_u	*exe_name;		/* the name of the executable */
 #ifdef USE_ON_FLY_SCROLL
 EXTERN int	dont_scroll INIT(= FALSE);/* don't use scrollbars when TRUE */
 #endif
-EXTERN int	mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
+EXTERN int	mapped_ctrl_c INIT(= FALSE); /* modes where CTRL-C is mapped */
 EXTERN int	ctrl_c_interrupts INIT(= TRUE);	/* CTRL-C sets got_int */
 
 EXTERN cmdmod_T	cmdmod;			/* Ex command modifiers */
diff --git a/src/structs.h b/src/structs.h
index d24175320f..7e60a387a2 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -1802,6 +1802,7 @@ struct file_buffer
     cryptstate_T *b_cryptstate;	/* Encryption state while reading or writing
 				 * the file. NULL when not using encryption. */
 #endif
+    int		b_mapped_ctrl_c; /* modes where CTRL-C is mapped */
 
 }; /* file_buffer */
 
diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
index 5f895a46f2..c957569f4d 100644
--- a/src/testdir/test_mapping.in
+++ b/src/testdir/test_mapping.in
@@ -8,6 +8,15 @@ STARTTEST
 :inoreab чкпр   vim
 GAчкпр 
 
+:" mapping of ctrl-c in insert mode
+:set cpo-=< cpo-=k
+:inoremap <c-c> <ctrl-c>
+:cnoremap <c-c> dummy
+:cunmap <c-c>
+GA
+TEST2: CTRL-C |A|
+
+:nunmap <c-c>
 
 : " langmap should not get remapped in insert mode
 :inoremap { FAIL_ilangmap
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
index 8d94976582..cd0e2e1ca1 100644
--- a/src/testdir/test_mapping.ok
+++ b/src/testdir/test_mapping.ok
@@ -1,4 +1,6 @@
 test starts here:
 vim
+TEST2: CTRL-C |<ctrl-c>A|
+
 +
 +
diff --git a/src/ui.c b/src/ui.c
index b268cd78d4..6fc5bde21c 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -180,7 +180,7 @@ ui_inchar(buf, maxlen, wtime, tb_change_cnt)
 
 	/* ... there is no need for CTRL-C to interrupt something, don't let
 	 * it set got_int when it was mapped. */
-	if (mapped_ctrl_c)
+	if ((mapped_ctrl_c | curbuf->b_mapped_ctrl_c) & State)
 	    ctrl_c_interrupts = FALSE;
     }
 
diff --git a/src/version.c b/src/version.c
index 4f9777ffa9..a1b14941fd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    569,
 /**/
     568,
 /**/

From 2d664c6f5f34a34fa5a50087bf041ee2d06a4385 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 12:44:42 +0100
Subject: [PATCH 392/473] Added tag v7-4-569 for changeset ccb6962585f1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 48e9ecadf5..01b3acb361 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3291,3 +3291,4 @@ b5df99582638f6f6cad794b7049453d7ff2c70b2 v7-4-562
 a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
 0b245c8dbd19755e08b5248110a537a74ddb92c4 v7-4-567
 747cbac7047bf8d003ff0672b25b60e0236fdb1b v7-4-568
+ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569

From 305c764db4ed4b51ae12487b7821c8b88d593e9c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 12:52:36 +0100
Subject: [PATCH 393/473] Updated runtime files.

---
 runtime/doc/todo.txt      | 29 +++++++++++-----
 runtime/indent/html.vim   |  4 +--
 runtime/syntax/rpcgen.vim | 10 ++----
 runtime/syntax/sm.vim     | 10 ++----
 runtime/syntax/vim.vim    | 73 +++++++++++++++++++++++++++------------
 runtime/syntax/yacc.vim   |  6 ++--
 6 files changed, 82 insertions(+), 50 deletions(-)

diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index fe4b5ec31a..12fc033180 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 10
+*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 14
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -34,6 +34,8 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+Crash report from Stephen Martin, 2015 Jan 12.
+
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
@@ -56,6 +58,10 @@ Regexp problems:
   "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
 - Diff highlighting can be very slow. (Issue 309)
 
+Patch to make Dynamic Ruby work with Ruby 2.2.0. (Ken Takata 2015 Jan 10)
+
+Update J runtime files. (glts, 2015 Jan 11)
+
 The range for :wincmd is not always a window number, can also be a column
 count.  Remove the range check.  What to use for ":$wincmd"?
 
@@ -90,6 +96,9 @@ inconsistent with the documentation.
 
 Ukrainian vimtutor. (Issue 288)
 
+Patch to fix that eval('$') does not give an error.  Yasuhiro Matsumoto, 2015
+Jan 12.
+
 Regenerate the Unicode tables in mbyte.c.
 Diff from ZyX, 2014 Dec 6.
 
@@ -106,19 +115,24 @@ Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
 
 Better greek spell checking.  Issue 299.
 
+Patch for wrong cursor positioning when 'linebreak' is set. (Christian
+Brabandt, 2015 Jan 11)
+
 Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
 Nov 12)
 
+Patch for fixing a problem of the combination of conceal and linebreak.
+(Christian Brabandt, 2014 Dec 11)
+
+Any more changes from 
+https://github.com/chrisbra/vim-mq-patches/blob/master/linebreak_bug
+?
+
 Patch to avoid recognizing polkit as hog files. (Issue 292)
 
 ":0argedit foo" puts new argument in second place instead of first.
 Patch from Ingo Karkat, 2014 Dec 19.
 
-Patch 7.4.468 changed how CTRL-C is handled.  It does not take care of mapping
-CTRL-C in different modes. (Ingo Karkat, 2014 Dec 12)
-Patch from Christian Brabandt, 2014 Dec 13.
-Needs to be improved.
-
 Patch for greek characters on MS-Windows console. (Yasuhiro Matsumoto, 2014
 Dec 17)
 
@@ -198,9 +212,6 @@ Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
 Patch to add the EndOfBuffer highlight group, used instead of NonText for "~"
 lines. (Marco Hinz, 2014 Nov 2)
 
-Patch for fixing a problem of the combination of conceal and linebreak.
-(Christian Brabandt, 2014 Dec 11)
-
 Adding "~" to 'cdpath' doesn't work for completion?  (Davido, 2013 Aug 19)
 
 Plugins need to make a lot of effort, lots of mappings, to know what happened
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index d64a0e5cd3..b97a905988 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
 " Header: "{{{
 " Maintainer:	Bram Moolenaar
 " Original Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change:	2014 Aug 23
+" Last Change:	2015 Jan 11
 " Version:	1.0
 " Description:	HTML indent script with cached state for faster indenting on a
 "		range of lines.
@@ -883,7 +883,7 @@ endfunc "}}}
 " THE MAIN INDENT FUNCTION. Return the amount of indent for v:lnum.
 func! HtmlIndent()
   "{{{
-  if prevnonblank(v:lnum - 1) <= 1
+  if prevnonblank(v:lnum - 1) < 1
     " First non-blank line has no indent.
     return 0
   endif
diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim
index 86b997c29c..85036dc049 100644
--- a/runtime/syntax/rpcgen.vim
+++ b/runtime/syntax/rpcgen.vim
@@ -1,15 +1,11 @@
 " Vim syntax file
 " Language:	rpcgen
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Oct 23, 2014
-" Version:	9
+" Last Change:	Jan 13, 2015
+" Version:	10
 " URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN
 
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
-  syntax clear
-elseif exists("b:current_syntax")
+if exists("b:current_syntax")
   finish
 endif
 
diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim
index 48df7e5789..ad96cdb3b5 100644
--- a/runtime/syntax/sm.vim
+++ b/runtime/syntax/sm.vim
@@ -1,15 +1,11 @@
 " Vim syntax file
 " Language:	sendmail
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Oct 23, 2014
-" Version:	5
+" Last Change:	Jan 13, 2015
+" Version:	6
 " URL:	http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM
 
-" For version 5.x: Clear all syntax items
-" For version 6.x: Quit when a syntax file was already loaded
-if version < 600
-  syntax clear
-elseif exists("b:current_syntax")
+if exists("b:current_syntax")
   finish
 endif
 
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 1d97998462..358237d46d 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	Vim 7.4 script
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Nov 28, 2014
-" Version:	7.4-19
+" Last Change:	Jan 13, 2015
+" Version:	7.4-28
 " Automatically generated keyword lists: {{{1
 
 " Quit when a syntax file was already loaded {{{2
@@ -97,8 +97,8 @@ endif
 
 " Numbers {{{2
 " =======
-syn match vimNumber	"\<\d\+\([lL]\|\.\d\+\)\="
-syn match vimNumber	"-\d\+\([lL]\|\.\d\+\)\="
+syn match vimNumber	"\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
+syn match vimNumber	"-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\="  skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
 syn match vimNumber	"\<0[xX]\x\+"
 syn match vimNumber	"\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
 
@@ -149,7 +149,7 @@ endif
 
 " Operators: {{{2
 " =========
-syn cluster	vimOperGroup	contains=vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
+syn cluster	vimOperGroup	contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
 syn match	vimOper	"\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}"	skipwhite nextgroup=vimString,vimSpecFile
 syn match	vimOper	"||\|&&\|[-+.]"	skipwhite nextgroup=vimString,vimSpecFile
 syn region	vimOperParen 	oneline matchgroup=vimParenSep	start="(" end=")" contains=@vimOperGroup
@@ -161,7 +161,7 @@ endif
 " Functions : Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster	vimFuncList	contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
-syn cluster	vimFuncBodyList	contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUserCommand
+syn cluster	vimFuncBodyList	contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
 syn match	vimFunction	"\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*("	contains=@vimFuncList nextgroup=vimFuncBody
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
@@ -203,9 +203,9 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror")
 endif
 syn case ignore
 syn keyword	vimUserAttrbKey   contained	bar	ban[g]	cou[nt]	ra[nge] com[plete]	n[args]	re[gister]
-syn keyword	vimUserAttrbCmplt contained	augroup buffer command dir environment event expression file function help highlight mapping menu option shellcmd something tag tag_listfiles var
+syn keyword	vimUserAttrbCmplt contained	augroup buffer color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var
 syn keyword	vimUserAttrbCmplt contained	custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
-syn match	vimUserAttrbCmpltFunc contained	",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\u\w*\)\+\|\u\w*\)"hs=s+1 nextgroup=vimUserCmdError
+syn match	vimUserAttrbCmpltFunc contained	",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError
 
 syn case match
 syn match	vimUserAttrbCmplt contained	"custom,\u\w*"
@@ -232,8 +232,8 @@ syn region	vimPatSepZone	oneline   contained   matchgroup=vimPatSepZ start="\\%\
 syn region	vimPatRegion	contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)"	contains=@vimSubstList oneline
 syn match	vimNotPatSep	contained	"\\\\"
 syn cluster	vimStringGroup	contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
-syn region	vimString	oneline keepend	start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+	contains=@vimStringGroup
-syn region	vimString	oneline keepend	start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
+syn region	vimString	oneline keepend	start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+	contains=@vimStringGroup
+syn region	vimString	oneline keepend	start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+
 syn region	vimString	oneline	start=+=!+lc=1	skip=+\\\\\|\\!+ end=+!+	contains=@vimStringGroup
 syn region	vimString	oneline	start="=+"lc=1	skip="\\\\\|\\+" end="+"	contains=@vimStringGroup
 syn region	vimString	oneline	start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/"	contains=@vimStringGroup
@@ -245,7 +245,7 @@ syn match	vimStringCont	contained	+\(\\\\\|.\)\{-}[^\\]"+
 syn cluster	vimSubstList	contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
 syn cluster	vimSubstRepList	contains=vimSubstSubstr,vimSubstTwoBS,vimNotation
 syn cluster	vimSubstList	add=vimCollection
-syn match	vimSubst	"\(:\+\s*\|^\s*\||\s*\)\<s\%[ubstitute][:[:alpha:]]\@!" nextgroup=vimSubstPat
+syn match	vimSubst	"\(:\+\s*\|^\s*\||\s*\)\<\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[:[:alpha:]]\@!" nextgroup=vimSubstPat
 syn match	vimSubst	"s\%[ubstitute][:#[:alpha:]]\@!"	nextgroup=vimSubstPat contained
 syn match	vimSubst	"/\zss\%[ubstitute]\ze/"	nextgroup=vimSubstPat
 syn match	vimSubst1       contained	"s\%[ubstitute]\>"	nextgroup=vimSubstPat
@@ -289,7 +289,7 @@ syn match	vimCmplxRepeat	'@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
 
 " Set command and associated set-options (vimOptions) with comment {{{2
 syn region	vimSet		matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\." end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend oneline contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vimSetString,vimSetMod
-syn region	vimSetEqual	contained	start="[=:]\|[-+^]=" skip="\%(\\\\\)*\\." end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation oneline
+syn region	vimSetEqual	contained	start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]\|$"me=e-1 contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar oneline
 syn region	vimSetString	contained	start=+="+hs=s+1	skip=+\\\\\|\\"+  end=+"+	contains=vimCtrlChar
 syn match	vimSetSep	contained	"[,:]"
 syn match	vimSetMod	contained	"&vim\=\|[!&?<]\|all&"
@@ -539,8 +539,8 @@ syn match	vimCommentTitleLeader	'"\s\+'ms=s+1	contained
 " ====================
 syn match	vimSearch	'^\s*[/?].*'		contains=vimSearchDelim
 syn match	vimSearchDelim	'^\s*\zs[/?]\|[/?]$'	contained
-syn region	vimGlobal	matchgroup=Statement start='\<g\%[lobal]!\=/' skip='\\.' end='/'
-syn region	vimGlobal	matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'
+syn region	vimGlobal	matchgroup=Statement start='\<g\%[lobal]!\=/'  skip='\\.' end='/'	skipwhite nextgroup=vimSubst
+syn region	vimGlobal	matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' end='/'	skipwhite nextgroup=vimSubst
 
 " Scripts  : perl,ruby : Benoit Cerrina {{{2
 " =======    python,tcl: Johannes Zellner
@@ -562,7 +562,12 @@ endif
 " [-- lua --] {{{3
 let s:luapath= fnameescape(expand("<sfile>:p:h")."/lua.vim")
 if !filereadable(s:luapath)
- let s:luapath= fnameescape(globpath(&rtp,"syntax/lua.vim"))
+ for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n")
+  if filereadable(fnameescape(s:luapath))
+   let s:luapath= fnameescape(s:luapath)
+   break
+  endif
+ endfor
 endif
 if (g:vimsyn_embed =~ 'l' && has("lua")) && filereadable(s:luapath)
  unlet! b:current_syntax
@@ -584,7 +589,12 @@ unlet s:luapath
 " [-- perl --] {{{3
 let s:perlpath= fnameescape(expand("<sfile>:p:h")."/perl.vim")
 if !filereadable(s:perlpath)
- let s:perlpath= fnameescape(globpath(&rtp,"syntax/perl.vim"))
+ for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n")
+  if filereadable(fnameescape(s:perlpath))
+   let s:perlpath= fnameescape(s:perlpath)
+   break
+  endif
+ endfor
 endif
 if (g:vimsyn_embed =~ 'p' && has("perl")) && filereadable(s:perlpath)
  unlet! b:current_syntax
@@ -606,7 +616,12 @@ unlet s:perlpath
 " [-- ruby --] {{{3
 let s:rubypath= fnameescape(expand("<sfile>:p:h")."/ruby.vim")
 if !filereadable(s:rubypath)
- let s:rubypath= fnameescape(globpath(&rtp,"syntax/ruby.vim"))
+ for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n")
+  if filereadable(fnameescape(s:rubypath))
+   let s:rubypath= fnameescape(s:rubypath)
+   break
+  endif
+ endfor
 endif
 if (g:vimsyn_embed =~ 'r' && has("ruby")) && filereadable(s:rubypath)
  unlet! b:current_syntax
@@ -627,9 +642,14 @@ unlet s:rubypath
 " [-- python --] {{{3
 let s:pythonpath= fnameescape(expand("<sfile>:p:h")."/python.vim")
 if !filereadable(s:pythonpath)
- let s:pythonpath= fnameescape(globpath(&rtp,"syntax/python.vim"))
+ for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n")
+  if filereadable(fnameescape(s:pythonpath))
+   let s:pythonpath= fnameescape(s:pythonpath)
+   break
+  endif
+ endfor
 endif
-if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(s:pythonpath)
+if g:vimsyn_embed =~ 'P' && (has("python") || has("python3")) && filereadable(s:pythonpath)
  unlet! b:current_syntax
  exe "syn include @vimPythonScript ".s:pythonpath
  if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'P'
@@ -662,7 +682,12 @@ endif
 if s:trytcl
  let s:tclpath= fnameescape(expand("<sfile>:p:h")."/tcl.vim")
  if !filereadable(s:tclpath)
-  let s:tclpath= fnameescape(globpath(&rtp,"syntax/tcl.vim"))
+  for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n")
+   if filereadable(fnameescape(s:tclpath))
+    let s:tclpath= fnameescape(s:tclpath)
+    break
+   endif
+  endfor
  endif
  if (g:vimsyn_embed =~ 't' && has("tcl")) && filereadable(s:tclpath)
   unlet! b:current_syntax
@@ -689,7 +714,12 @@ unlet s:trytcl
 " [-- mzscheme --] {{{3
 let s:mzschemepath= fnameescape(expand("<sfile>:p:h")."/scheme.vim")
 if !filereadable(s:mzschemepath)
- let s:mzschemepath= fnameescape(globpath(&rtp,"syntax/scheme.vim"))
+ for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n")
+  if filereadable(fnameescape(s:mzschemepath))
+   let s:mzschemepath= fnameescape(s:mzschemepath)
+   break
+  endif
+ endfor
 endif
 if (g:vimsyn_embed =~ 'm' && has("mzscheme")) && filereadable(s:mzschemepath)
  unlet! b:current_syntax
@@ -727,7 +757,6 @@ syn sync match vimAugroupSyncA	groupthere NONE	"\<aug\%[roup]\>\s\+[eE][nN][dD]"
 " Highlighting Settings {{{2
 " ====================
 
-hi def link vimAuHighlight	vimHighlight
 hi def link vimSubst1	vimSubst
 hi def link vimBehaveModel	vimBehave
 
diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim
index cc1c847747..714432be9d 100644
--- a/runtime/syntax/yacc.vim
+++ b/runtime/syntax/yacc.vim
@@ -1,8 +1,8 @@
 " Vim syntax file
 " Language:	Yacc
 " Maintainer:	Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
-" Last Change:	Nov 14, 2012
-" Version:	11
+" Last Change:	Jan 14, 2015
+" Version:	12
 " URL:	http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
 "
 " Options: {{{1
@@ -42,7 +42,7 @@ exe "syn include @yaccCode ".s:Cpath
 " ---------------------------------------------------------------------
 "  Yacc Clusters: {{{1
 syn cluster yaccInitCluster	contains=yaccKey,yaccKeyActn,yaccBrkt,yaccType,yaccString,yaccUnionStart,yaccHeader2,yaccComment,yaccDefines,yaccParseParam,yaccParseOption
-syn cluster yaccRulesCluster	contains=yaccNonterminal,yaccString
+syn cluster yaccRulesCluster	contains=yaccNonterminal,yaccString,yaccComment
 
 " ---------------------------------------------------------------------
 "  Yacc Sections: {{{1

From 9b556e69c29aa0a6d3b50efb920cd2c718630d44 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 14:04:10 +0100
Subject: [PATCH 394/473] updated for version 7.4.570 Problem:    Building with
 dynamic library does not work for Ruby 2.2.0 Solution:   Change #ifdefs and
 #defines. (Ken Takata)

---
 src/if_ruby.c | 32 ++++++++++++++++++++++++++++++--
 src/version.c |  2 ++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/src/if_ruby.c b/src/if_ruby.c
index eb6141fbc3..3b9f476619 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -96,11 +96,15 @@
 # define rb_num2int rb_num2int_stub
 #endif
 
-#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 21
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 /* Ruby 2.1 adds new GC called RGenGC and RARRAY_PTR uses
  * rb_gc_writebarrier_unprotect_promoted if USE_RGENGC  */
 # define rb_gc_writebarrier_unprotect_promoted rb_gc_writebarrier_unprotect_promoted_stub
 #endif
+#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
+# define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub
+# define rb_check_type rb_check_type_stub
+#endif
 
 #include <ruby.h>
 #ifdef RUBY19_OR_LATER
@@ -180,7 +184,9 @@ static void ruby_vim_init(void);
  */
 # define rb_assoc_new			dll_rb_assoc_new
 # define rb_cObject			(*dll_rb_cObject)
-# define rb_check_type			dll_rb_check_type
+# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER < 22
+#  define rb_check_type			dll_rb_check_type
+# endif
 # define rb_class_path			dll_rb_class_path
 # define rb_data_object_alloc		dll_rb_data_object_alloc
 # define rb_define_class_under		dll_rb_define_class_under
@@ -382,7 +388,11 @@ static void* (*ruby_process_options)(int, char**);
 # endif
 
 # if defined(USE_RGENGC) && USE_RGENGC
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 static void (*dll_rb_gc_writebarrier_unprotect_promoted)(VALUE);
+#  else
+static void (*dll_rb_gc_writebarrier_unprotect)(VALUE obj);
+#  endif
 # endif
 
 # if defined(RUBY19_OR_LATER) && !defined(PROTO)
@@ -420,10 +430,24 @@ VALUE rb_num2ulong(VALUE x)
 
    /* Do not generate a prototype here, VALUE isn't always defined. */
 # if defined(USE_RGENGC) && USE_RGENGC && !defined(PROTO)
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
 void rb_gc_writebarrier_unprotect_promoted_stub(VALUE obj)
 {
     dll_rb_gc_writebarrier_unprotect_promoted(obj);
 }
+#  else
+void rb_gc_writebarrier_unprotect_stub(VALUE obj)
+{
+    dll_rb_gc_writebarrier_unprotect(obj);
+}
+#  endif
+# endif
+
+# if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 22
+void rb_check_type_stub(VALUE v, int i)
+{
+    dll_rb_check_type(v, i);
+}
 # endif
 
 static HINSTANCE hinstRuby = NULL; /* Instance of ruby.dll */
@@ -542,7 +566,11 @@ static struct
     {"ruby_init_stack", (RUBY_PROC*)&dll_ruby_init_stack},
 # endif
 # if defined(USE_RGENGC) && USE_RGENGC
+#  if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER == 21
     {"rb_gc_writebarrier_unprotect_promoted", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect_promoted},
+#  else
+    {"rb_gc_writebarrier_unprotect", (RUBY_PROC*)&dll_rb_gc_writebarrier_unprotect},
+#  endif
 # endif
     {"", NULL},
 };
diff --git a/src/version.c b/src/version.c
index a1b14941fd..b6e75563a0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    570,
 /**/
     569,
 /**/

From f8f179cc46eb53947563fe81300a81030706e6aa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 14:04:10 +0100
Subject: [PATCH 395/473] Added tag v7-4-570 for changeset 816c584ff174

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 01b3acb361..d1dcce188a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3292,3 +3292,4 @@ a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
 0b245c8dbd19755e08b5248110a537a74ddb92c4 v7-4-567
 747cbac7047bf8d003ff0672b25b60e0236fdb1b v7-4-568
 ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
+816c584ff1740cd118d5a35fbea98ed28ed2e2e2 v7-4-570

From 91bdfc93cc8e5e830864356e650e998c4c4b9d2e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 14:08:44 +0100
Subject: [PATCH 396/473] updated for version 7.4.571 Problem:    Can't build
 with tiny features. (Ike Devolder) Solution:   Add #ifdef.

---
 src/getchar.c | 4 ++++
 src/version.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/getchar.c b/src/getchar.c
index 3ae5f40609..54bce315f3 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3710,9 +3710,11 @@ do_map(maptype, arg, mode, abbrev)
 	else if (*keys == Ctrl_C)
 	{
 	    /* If CTRL-C has been unmapped, reuse it for Interrupting. */
+#ifdef FEAT_LOCALMAP
 	    if (map_table == curbuf->b_maphash)
 		curbuf->b_mapped_ctrl_c &= ~mode;
 	    else
+#endif
 		mapped_ctrl_c &= ~mode;
 	}
 	goto theend;
@@ -3750,9 +3752,11 @@ do_map(maptype, arg, mode, abbrev)
     /* If CTRL-C has been mapped, don't always use it for Interrupting. */
     if (*keys == Ctrl_C)
     {
+#ifdef FEAT_LOCALMAP
 	if (map_table == curbuf->b_maphash)
 	    curbuf->b_mapped_ctrl_c |= mode;
 	else
+#endif
 	    mapped_ctrl_c |= mode;
     }
 
diff --git a/src/version.c b/src/version.c
index b6e75563a0..39191f5004 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    571,
 /**/
     570,
 /**/

From afb8dfd438310f5c197cc25235a7424d3b48d8eb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 14:08:45 +0100
Subject: [PATCH 397/473] Added tag v7-4-571 for changeset 97b2ff29ae3a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d1dcce188a..e540c50354 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3293,3 +3293,4 @@ a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
 747cbac7047bf8d003ff0672b25b60e0236fdb1b v7-4-568
 ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
 816c584ff1740cd118d5a35fbea98ed28ed2e2e2 v7-4-570
+97b2ff29ae3a213b5c72bd8ea3aa2442ef355e08 v7-4-571

From 1b8c50901d541ac226a3779331eab53db0103b82 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 15:47:36 +0100
Subject: [PATCH 398/473] updated for version 7.4.572 Problem:    Address type
 of :wincmd depends on the argument. Solution:   Check the argument.

---
 src/ex_docmd.c       |  51 +++++++++++----------
 src/proto/window.pro |   1 +
 src/version.c        |   2 +
 src/window.c         | 104 +++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 135 insertions(+), 23 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index c36f407406..3edc1a2247 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2130,22 +2130,23 @@ do_one_cmd(cmdlinep, sourcing,
  * is equal to the lower.
  */
 
-    if (ea.cmdidx != CMD_SIZE
-#ifdef FEAT_USR_CMDS
-	&& ea.cmdidx != CMD_USER
-	&& ea.cmdidx != CMD_USER_BUF
-#endif
-       )
-	ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
-    else
-#ifdef FEAT_USR_CMDS
-	if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_USER_BUF)
-#endif
-	ea.addr_type = ADDR_LINES;
     /* ea.addr_type for user commands is set by find_ucmd */
-    ea.cmd = cmd;
+    if (!IS_USER_CMDIDX(ea.cmdidx))
+    {
+	if (ea.cmdidx != CMD_SIZE)
+	    ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type;
+	else
+	    ea.addr_type = ADDR_LINES;
+
+#ifdef FEAT_WINDOWS
+	/* :wincmd range depends on the argument. */
+	if (ea.cmdidx == CMD_wincmd)
+	    get_wincmd_addr_type(p, &ea);
+#endif
+    }
 
     /* repeat for all ',' or ';' separated addresses */
+    ea.cmd = cmd;
     for (;;)
     {
 	ea.line1 = ea.line2;
@@ -2181,7 +2182,6 @@ do_one_cmd(cmdlinep, sourcing,
 	{
 	    if (*ea.cmd == '%')		    /* '%' - all lines */
 	    {
-		buf_T	*buf;
 		++ea.cmd;
 		switch (ea.addr_type)
 		{
@@ -2190,15 +2190,20 @@ do_one_cmd(cmdlinep, sourcing,
 			ea.line2 = curbuf->b_ml.ml_line_count;
 			break;
 		    case ADDR_LOADED_BUFFERS:
-			buf = firstbuf;
-			while (buf->b_next != NULL && buf->b_ml.ml_mfp == NULL)
-			    buf = buf->b_next;
-			ea.line1 = buf->b_fnum;
-			buf = lastbuf;
-			while (buf->b_prev != NULL && buf->b_ml.ml_mfp == NULL)
-			    buf = buf->b_prev;
-			ea.line2 = buf->b_fnum;
-			break;
+			{
+			    buf_T	*buf = firstbuf;
+
+			    while (buf->b_next != NULL
+						  && buf->b_ml.ml_mfp == NULL)
+				buf = buf->b_next;
+			    ea.line1 = buf->b_fnum;
+			    buf = lastbuf;
+			    while (buf->b_prev != NULL
+						  && buf->b_ml.ml_mfp == NULL)
+				buf = buf->b_prev;
+			    ea.line2 = buf->b_fnum;
+			    break;
+			}
 		    case ADDR_BUFFERS:
 			ea.line1 = firstbuf->b_fnum;
 			ea.line2 = lastbuf->b_fnum;
diff --git a/src/proto/window.pro b/src/proto/window.pro
index b89cf085a0..15bd4725d2 100644
--- a/src/proto/window.pro
+++ b/src/proto/window.pro
@@ -1,5 +1,6 @@
 /* window.c */
 void do_window __ARGS((int nchar, long Prenum, int xchar));
+void get_wincmd_addr_type __ARGS((char_u *arg, exarg_T *eap));
 int win_split __ARGS((int size, int flags));
 int win_split_ins __ARGS((int size, int flags, win_T *new_wp, int dir));
 int win_valid __ARGS((win_T *win));
diff --git a/src/version.c b/src/version.c
index 39191f5004..b049ea2295 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    572,
 /**/
     571,
 /**/
diff --git a/src/window.c b/src/window.c
index 79c97d8a9e..6ca288ead2 100644
--- a/src/window.c
+++ b/src/window.c
@@ -624,6 +624,110 @@ do_window(nchar, Prenum, xchar)
     }
 }
 
+/*
+ * Figure out the address type for ":wnncmd".
+ */
+    void
+get_wincmd_addr_type(arg, eap)
+    char_u	*arg;
+    exarg_T	*eap;
+{
+    switch (*arg)
+    {
+    case 'S':
+    case Ctrl_S:
+    case 's':
+    case Ctrl_N:
+    case 'n':
+    case 'j':
+    case Ctrl_J:
+    case 'k':
+    case Ctrl_K:
+    case 'T':
+    case Ctrl_R:
+    case 'r':
+    case 'R':
+    case 'K':
+    case 'J':
+    case '+':
+    case '-':
+    case Ctrl__:
+    case '_':
+    case '|':
+    case ']':
+    case Ctrl_RSB:
+    case 'g':
+    case Ctrl_G:
+#ifdef FEAT_VERTSPLIT
+    case Ctrl_V:
+    case 'v':
+    case 'h':
+    case Ctrl_H:
+    case 'l':
+    case Ctrl_L:
+    case 'H':
+    case 'L':
+    case '>':
+    case '<':
+#endif
+#if defined(FEAT_QUICKFIX)
+    case '}':
+#endif
+#ifdef FEAT_SEARCHPATH
+    case 'f':
+    case 'F':
+    case Ctrl_F:
+#endif
+#ifdef FEAT_FIND_ID
+    case 'i':
+    case Ctrl_I:
+    case 'd':
+    case Ctrl_D:
+#endif
+		/* window size or any count */
+		eap->addr_type = ADDR_LINES;
+		break;
+
+    case Ctrl_HAT:
+    case '^':
+		/* buffer number */
+		eap->addr_type = ADDR_BUFFERS;
+		break;
+
+    case Ctrl_Q:
+    case 'q':
+    case Ctrl_C:
+    case 'c':
+    case Ctrl_O:
+    case 'o':
+    case Ctrl_W:
+    case 'w':
+    case 'W':
+    case 'x':
+    case Ctrl_X:
+		/* window number */
+		eap->addr_type = ADDR_WINDOWS;
+		break;
+
+#if defined(FEAT_QUICKFIX)
+    case Ctrl_Z:
+    case 'z':
+    case 'P':
+#endif
+    case 't':
+    case Ctrl_T:
+    case 'b':
+    case Ctrl_B:
+    case 'p':
+    case Ctrl_P:
+    case '=':
+    case CAR:
+		/* no count */
+		eap->addr_type = 0;
+		break;
+    }
+}
+
     static void
 cmd_with_count(cmd, bufp, bufsize, Prenum)
     char	*cmd;

From 0259b4e80bda4c35442706e2e5a2c77eaeb2fab5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 15:47:36 +0100
Subject: [PATCH 399/473] Added tag v7-4-572 for changeset cba15023c403

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index e540c50354..4000ef7239 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3294,3 +3294,4 @@ a88d4dc02bf438ff9e6ee119be8188e342ea459e v7-4-566
 ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
 816c584ff1740cd118d5a35fbea98ed28ed2e2e2 v7-4-570
 97b2ff29ae3a213b5c72bd8ea3aa2442ef355e08 v7-4-571
+cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572

From 08a8e59c50221720755351c2415d08c41bed1506 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 16:08:32 +0100
Subject: [PATCH 400/473] updated for version 7.4.573 Problem:    Mapping
 CTRL-C in Visual mode doesn't work. (Ingo Karkat) Solution:   Call
 get_real_state() instead of using State directly.

---
 src/testdir/test_mapping.in | 14 ++++++++++----
 src/testdir/test_mapping.ok |  1 +
 src/ui.c                    |  2 +-
 src/version.c               |  2 ++
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/testdir/test_mapping.in b/src/testdir/test_mapping.in
index c957569f4d..7ac578f086 100644
--- a/src/testdir/test_mapping.in
+++ b/src/testdir/test_mapping.in
@@ -8,7 +8,7 @@ STARTTEST
 :inoreab чкпр   vim
 GAчкпр 
 
-:" mapping of ctrl-c in insert mode
+:" mapping of ctrl-c in Insert mode
 :set cpo-=< cpo-=k
 :inoremap <c-c> <ctrl-c>
 :cnoremap <c-c> dummy
@@ -16,9 +16,15 @@ GAчкпр
 GA
 TEST2: CTRL-C |A|
 
-:nunmap <c-c>
-
-: " langmap should not get remapped in insert mode
+:unmap <c-c>
+:unmap! <c-c>
+:"
+:" mapping of ctrl-c in Visual mode
+:vnoremap <c-c> :<C-u>$put ='vmap works'
+GV
+:vunmap <c-c>
+:"
+:" langmap should not get remapped in insert mode
 :inoremap { FAIL_ilangmap
 :set langmap=+{ langnoremap
 o+
diff --git a/src/testdir/test_mapping.ok b/src/testdir/test_mapping.ok
index cd0e2e1ca1..bf21e514ba 100644
--- a/src/testdir/test_mapping.ok
+++ b/src/testdir/test_mapping.ok
@@ -2,5 +2,6 @@ test starts here:
 vim
 TEST2: CTRL-C |<ctrl-c>A|
 
+vmap works
 +
 +
diff --git a/src/ui.c b/src/ui.c
index 6fc5bde21c..59794829d8 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -180,7 +180,7 @@ ui_inchar(buf, maxlen, wtime, tb_change_cnt)
 
 	/* ... there is no need for CTRL-C to interrupt something, don't let
 	 * it set got_int when it was mapped. */
-	if ((mapped_ctrl_c | curbuf->b_mapped_ctrl_c) & State)
+	if ((mapped_ctrl_c | curbuf->b_mapped_ctrl_c) & get_real_state())
 	    ctrl_c_interrupts = FALSE;
     }
 
diff --git a/src/version.c b/src/version.c
index b049ea2295..ed1a6e341c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    573,
 /**/
     572,
 /**/

From 5b6cc8fa625ccecc91bd8fa5f8357062d3303dcb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 16:08:33 +0100
Subject: [PATCH 401/473] Added tag v7-4-573 for changeset 8cfbc34ae4aa

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 4000ef7239..4b48abe19c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3295,3 +3295,4 @@ ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
 816c584ff1740cd118d5a35fbea98ed28ed2e2e2 v7-4-570
 97b2ff29ae3a213b5c72bd8ea3aa2442ef355e08 v7-4-571
 cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
+8cfbc34ae4aa2b91b5b012b2e8dfe86327b449c9 v7-4-573

From 4d8d54cf4f74fbb3b56d198f92c5d8a346b7621c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:15:05 +0100
Subject: [PATCH 402/473] updated for version 7.4.574 Problem:    No error for
 eval('$'). Solution:   Check for empty name. (Yasuhiro Matsumoto)

---
 src/eval.c    | 8 ++++++--
 src/version.c | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/eval.c b/src/eval.c
index fbe824eec1..50e87081f7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -7867,7 +7867,7 @@ get_env_tv(arg, rettv, evaluate)
     if (evaluate)
     {
 	if (len == 0)
-           return FAIL; /* can't be an environment variable */
+	    return FAIL; /* invalid empty name */
 
 	cc = name[len];
 	name[len] = NUL;
@@ -10117,14 +10117,18 @@ f_eval(argvars, rettv)
     typval_T	*argvars;
     typval_T	*rettv;
 {
-    char_u	*s;
+    char_u	*s, *p;
 
     s = get_tv_string_chk(&argvars[0]);
     if (s != NULL)
 	s = skipwhite(s);
 
+    p = s;
     if (s == NULL || eval1(&s, rettv, TRUE) == FAIL)
     {
+	if (p != NULL && !aborting())
+	    EMSG2(_(e_invexpr2), p);
+	need_clr_eos = FALSE;
 	rettv->v_type = VAR_NUMBER;
 	rettv->vval.v_number = 0;
     }
diff --git a/src/version.c b/src/version.c
index ed1a6e341c..51a1a1609b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    574,
 /**/
     573,
 /**/

From 59cd725b6e25f11e4eec0fdec375b614d1a28943 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:15:05 +0100
Subject: [PATCH 403/473] Added tag v7-4-574 for changeset 45ff9dd354ea

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 4b48abe19c..36a5c60cc0 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3296,3 +3296,4 @@ ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
 97b2ff29ae3a213b5c72bd8ea3aa2442ef355e08 v7-4-571
 cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
 8cfbc34ae4aa2b91b5b012b2e8dfe86327b449c9 v7-4-573
+45ff9dd354eaff958c0ba646134e1f5cd6e9186f v7-4-574

From 3a5281d2e4901506a387145beac185dafe5b4721 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:40:09 +0100
Subject: [PATCH 404/473] updated for version 7.4.575 Problem:    Unicode
 character properties are outdated. Solution:   Update the tables with the
 latest version.

---
 src/mbyte.c   | 188 ++++++++++++++++++++++++++++++++++----------------
 src/version.c |   2 +
 2 files changed, 129 insertions(+), 61 deletions(-)

diff --git a/src/mbyte.c b/src/mbyte.c
index 0531f18116..1edc4b8781 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -1244,20 +1244,17 @@ utf_char2cells(c)
     static struct interval doublewidth[] =
     {
 	{0x1100, 0x115f},
-	{0x11a3, 0x11a7},
-	{0x11fa, 0x11ff},
 	{0x2329, 0x232a},
 	{0x2e80, 0x2e99},
 	{0x2e9b, 0x2ef3},
 	{0x2f00, 0x2fd5},
 	{0x2ff0, 0x2ffb},
-	{0x3000, 0x3029},
-	{0x3030, 0x303e},
+	{0x3000, 0x303e},
 	{0x3041, 0x3096},
-	{0x309b, 0x30ff},
+	{0x3099, 0x30ff},
 	{0x3105, 0x312d},
 	{0x3131, 0x318e},
-	{0x3190, 0x31b7},
+	{0x3190, 0x31ba},
 	{0x31c0, 0x31e3},
 	{0x31f0, 0x321e},
 	{0x3220, 0x3247},
@@ -1267,8 +1264,6 @@ utf_char2cells(c)
 	{0xa490, 0xa4c6},
 	{0xa960, 0xa97c},
 	{0xac00, 0xd7a3},
-	{0xd7b0, 0xd7c6},
-	{0xd7cb, 0xd7fb},
 	{0xf900, 0xfaff},
 	{0xfe10, 0xfe19},
 	{0xfe30, 0xfe52},
@@ -1276,12 +1271,15 @@ utf_char2cells(c)
 	{0xfe68, 0xfe6b},
 	{0xff01, 0xff60},
 	{0xffe0, 0xffe6},
-	{0x1f200, 0x1f200},
-	{0x1f210, 0x1f231},
+	{0x1b000, 0x1b001},
+	{0x1f200, 0x1f202},
+	{0x1f210, 0x1f23a},
 	{0x1f240, 0x1f248},
+	{0x1f250, 0x1f251},
 	{0x20000, 0x2fffd},
 	{0x30000, 0x3fffd}
     };
+
     /* Sorted list of non-overlapping intervals of East Asian Ambiguous
      * characters, generated with ../runtime/tools/unicode.vim. */
     static struct interval ambiguous[] =
@@ -1339,6 +1337,7 @@ utf_char2cells(c)
 	{0x02d8, 0x02db},
 	{0x02dd, 0x02dd},
 	{0x02df, 0x02df},
+	{0x0300, 0x036f},
 	{0x0391, 0x03a1},
 	{0x03a3, 0x03a9},
 	{0x03b1, 0x03c1},
@@ -1449,22 +1448,13 @@ utf_char2cells(c)
 	{0x2b55, 0x2b59},
 	{0x3248, 0x324f},
 	{0xe000, 0xf8ff},
+	{0xfe00, 0xfe0f},
 	{0xfffd, 0xfffd},
 	{0x1f100, 0x1f10a},
 	{0x1f110, 0x1f12d},
-	{0x1f131, 0x1f131},
-	{0x1f13d, 0x1f13d},
-	{0x1f13f, 0x1f13f},
-	{0x1f142, 0x1f142},
-	{0x1f146, 0x1f146},
-	{0x1f14a, 0x1f14e},
-	{0x1f157, 0x1f157},
-	{0x1f15f, 0x1f15f},
-	{0x1f179, 0x1f179},
-	{0x1f17b, 0x1f17c},
-	{0x1f17f, 0x1f17f},
-	{0x1f18a, 0x1f18d},
-	{0x1f190, 0x1f190},
+	{0x1f130, 0x1f169},
+	{0x1f170, 0x1f19a},
+	{0xe0100, 0xe01ef},
 	{0xf0000, 0xffffd},
 	{0x100000, 0x10fffd}
     };
@@ -2261,10 +2251,10 @@ utf_iscomposing(c)
 	{0x05c4, 0x05c5},
 	{0x05c7, 0x05c7},
 	{0x0610, 0x061a},
-	{0x064b, 0x065e},
+	{0x064b, 0x065f},
 	{0x0670, 0x0670},
 	{0x06d6, 0x06dc},
-	{0x06de, 0x06e4},
+	{0x06df, 0x06e4},
 	{0x06e7, 0x06e8},
 	{0x06ea, 0x06ed},
 	{0x0711, 0x0711},
@@ -2275,10 +2265,11 @@ utf_iscomposing(c)
 	{0x081b, 0x0823},
 	{0x0825, 0x0827},
 	{0x0829, 0x082d},
-	{0x0900, 0x0903},
-	{0x093c, 0x093c},
-	{0x093e, 0x094e},
-	{0x0951, 0x0955},
+	{0x0859, 0x085b},
+	{0x08e4, 0x0903},
+	{0x093a, 0x093c},
+	{0x093e, 0x094f},
+	{0x0951, 0x0957},
 	{0x0962, 0x0963},
 	{0x0981, 0x0983},
 	{0x09bc, 0x09bc},
@@ -2313,20 +2304,20 @@ utf_iscomposing(c)
 	{0x0bc6, 0x0bc8},
 	{0x0bca, 0x0bcd},
 	{0x0bd7, 0x0bd7},
-	{0x0c01, 0x0c03},
+	{0x0c00, 0x0c03},
 	{0x0c3e, 0x0c44},
 	{0x0c46, 0x0c48},
 	{0x0c4a, 0x0c4d},
 	{0x0c55, 0x0c56},
 	{0x0c62, 0x0c63},
-	{0x0c82, 0x0c83},
+	{0x0c81, 0x0c83},
 	{0x0cbc, 0x0cbc},
 	{0x0cbe, 0x0cc4},
 	{0x0cc6, 0x0cc8},
 	{0x0cca, 0x0ccd},
 	{0x0cd5, 0x0cd6},
 	{0x0ce2, 0x0ce3},
-	{0x0d02, 0x0d03},
+	{0x0d01, 0x0d03},
 	{0x0d3e, 0x0d44},
 	{0x0d46, 0x0d48},
 	{0x0d4a, 0x0d4d},
@@ -2352,7 +2343,7 @@ utf_iscomposing(c)
 	{0x0f3e, 0x0f3f},
 	{0x0f71, 0x0f84},
 	{0x0f86, 0x0f87},
-	{0x0f90, 0x0f97},
+	{0x0f8d, 0x0f97},
 	{0x0f99, 0x0fbc},
 	{0x0fc6, 0x0fc6},
 	{0x102b, 0x103e},
@@ -2364,12 +2355,12 @@ utf_iscomposing(c)
 	{0x1082, 0x108d},
 	{0x108f, 0x108f},
 	{0x109a, 0x109d},
-	{0x135f, 0x135f},
+	{0x135d, 0x135f},
 	{0x1712, 0x1714},
 	{0x1732, 0x1734},
 	{0x1752, 0x1753},
 	{0x1772, 0x1773},
-	{0x17b6, 0x17d3},
+	{0x17b4, 0x17d3},
 	{0x17dd, 0x17dd},
 	{0x180b, 0x180d},
 	{0x18a9, 0x18a9},
@@ -2381,25 +2372,30 @@ utf_iscomposing(c)
 	{0x1a55, 0x1a5e},
 	{0x1a60, 0x1a7c},
 	{0x1a7f, 0x1a7f},
+	{0x1ab0, 0x1abe},
 	{0x1b00, 0x1b04},
 	{0x1b34, 0x1b44},
 	{0x1b6b, 0x1b73},
 	{0x1b80, 0x1b82},
-	{0x1ba1, 0x1baa},
+	{0x1ba1, 0x1bad},
+	{0x1be6, 0x1bf3},
 	{0x1c24, 0x1c37},
 	{0x1cd0, 0x1cd2},
 	{0x1cd4, 0x1ce8},
 	{0x1ced, 0x1ced},
-	{0x1cf2, 0x1cf2},
-	{0x1dc0, 0x1de6},
-	{0x1dfd, 0x1dff},
+	{0x1cf2, 0x1cf4},
+	{0x1cf8, 0x1cf9},
+	{0x1dc0, 0x1df5},
+	{0x1dfc, 0x1dff},
 	{0x20d0, 0x20f0},
 	{0x2cef, 0x2cf1},
+	{0x2d7f, 0x2d7f},
 	{0x2de0, 0x2dff},
 	{0x302a, 0x302f},
 	{0x3099, 0x309a},
 	{0xa66f, 0xa672},
-	{0xa67c, 0xa67d},
+	{0xa674, 0xa67d},
+	{0xa69f, 0xa69f},
 	{0xa6f0, 0xa6f1},
 	{0xa802, 0xa802},
 	{0xa806, 0xa806},
@@ -2412,34 +2408,69 @@ utf_iscomposing(c)
 	{0xa947, 0xa953},
 	{0xa980, 0xa983},
 	{0xa9b3, 0xa9c0},
+	{0xa9e5, 0xa9e5},
 	{0xaa29, 0xaa36},
 	{0xaa43, 0xaa43},
 	{0xaa4c, 0xaa4d},
-	{0xaa7b, 0xaa7b},
+	{0xaa7b, 0xaa7d},
 	{0xaab0, 0xaab0},
 	{0xaab2, 0xaab4},
 	{0xaab7, 0xaab8},
 	{0xaabe, 0xaabf},
 	{0xaac1, 0xaac1},
+	{0xaaeb, 0xaaef},
+	{0xaaf5, 0xaaf6},
 	{0xabe3, 0xabea},
 	{0xabec, 0xabed},
 	{0xfb1e, 0xfb1e},
 	{0xfe00, 0xfe0f},
-	{0xfe20, 0xfe26},
+	{0xfe20, 0xfe2d},
 	{0x101fd, 0x101fd},
+	{0x102e0, 0x102e0},
+	{0x10376, 0x1037a},
 	{0x10a01, 0x10a03},
 	{0x10a05, 0x10a06},
 	{0x10a0c, 0x10a0f},
 	{0x10a38, 0x10a3a},
 	{0x10a3f, 0x10a3f},
-	{0x11080, 0x11082},
+	{0x10ae5, 0x10ae6},
+	{0x11000, 0x11002},
+	{0x11038, 0x11046},
+	{0x1107f, 0x11082},
 	{0x110b0, 0x110ba},
+	{0x11100, 0x11102},
+	{0x11127, 0x11134},
+	{0x11173, 0x11173},
+	{0x11180, 0x11182},
+	{0x111b3, 0x111c0},
+	{0x1122c, 0x11237},
+	{0x112df, 0x112ea},
+	{0x11301, 0x11303},
+	{0x1133c, 0x1133c},
+	{0x1133e, 0x11344},
+	{0x11347, 0x11348},
+	{0x1134b, 0x1134d},
+	{0x11357, 0x11357},
+	{0x11362, 0x11363},
+	{0x11366, 0x1136c},
+	{0x11370, 0x11374},
+	{0x114b0, 0x114c3},
+	{0x115af, 0x115b5},
+	{0x115b8, 0x115c0},
+	{0x11630, 0x11640},
+	{0x116ab, 0x116b7},
+	{0x16af0, 0x16af4},
+	{0x16b30, 0x16b36},
+	{0x16f51, 0x16f7e},
+	{0x16f8f, 0x16f92},
+	{0x1bc9d, 0x1bc9e},
 	{0x1d165, 0x1d169},
 	{0x1d16d, 0x1d172},
 	{0x1d17b, 0x1d182},
 	{0x1d185, 0x1d18b},
 	{0x1d1aa, 0x1d1ad},
 	{0x1d242, 0x1d244},
+	{0x1e8d0, 0x1e8d6},
 	{0xe0100, 0xe01ef}
     };
 
@@ -2679,6 +2710,7 @@ static convertStruct foldCase[] =
 	{0x345,0x345,-1,116},
 	{0x370,0x372,2,1},
 	{0x376,0x376,-1,1},
+	{0x37f,0x37f,-1,116},
 	{0x386,0x386,-1,38},
 	{0x388,0x38a,1,37},
 	{0x38c,0x38c,-1,64},
@@ -2706,9 +2738,10 @@ static convertStruct foldCase[] =
 	{0x48a,0x4be,2,1},
 	{0x4c0,0x4c0,-1,15},
 	{0x4c1,0x4cd,2,1},
-	{0x4d0,0x524,2,1},
+	{0x4d0,0x52e,2,1},
 	{0x531,0x556,1,48},
 	{0x10a0,0x10c5,1,7264},
+	{0x10c7,0x10cd,6,7264},
 	{0x1e00,0x1e94,2,1},
 	{0x1e9b,0x1e9b,-1,-58},
 	{0x1e9e,0x1e9e,-1,-7615},
@@ -2758,17 +2791,27 @@ static convertStruct foldCase[] =
 	{0x2c7e,0x2c7f,1,-10815},
 	{0x2c80,0x2ce2,2,1},
 	{0x2ceb,0x2ced,2,1},
-	{0xa640,0xa65e,2,1},
-	{0xa662,0xa66c,2,1},
-	{0xa680,0xa696,2,1},
+	{0x2cf2,0xa640,31054,1},
+	{0xa642,0xa66c,2,1},
+	{0xa680,0xa69a,2,1},
 	{0xa722,0xa72e,2,1},
 	{0xa732,0xa76e,2,1},
 	{0xa779,0xa77b,2,1},
 	{0xa77d,0xa77d,-1,-35332},
 	{0xa77e,0xa786,2,1},
 	{0xa78b,0xa78b,-1,1},
+	{0xa78d,0xa78d,-1,-42280},
+	{0xa790,0xa792,2,1},
+	{0xa796,0xa7a8,2,1},
+	{0xa7aa,0xa7aa,-1,-42308},
+	{0xa7ab,0xa7ab,-1,-42319},
+	{0xa7ac,0xa7ac,-1,-42315},
+	{0xa7ad,0xa7ad,-1,-42305},
+	{0xa7b0,0xa7b0,-1,-42258},
+	{0xa7b1,0xa7b1,-1,-42282},
 	{0xff21,0xff3a,1,32},
-	{0x10400,0x10427,1,40}
+	{0x10400,0x10427,1,40},
+	{0x118a0,0x118bf,1,32}
 };
 
 static int utf_convert __ARGS((int a, convertStruct table[], int tableSize));
@@ -2885,6 +2928,7 @@ static convertStruct toLower[] =
 	{0x246,0x24e,2,1},
 	{0x370,0x372,2,1},
 	{0x376,0x376,-1,1},
+	{0x37f,0x37f,-1,116},
 	{0x386,0x386,-1,38},
 	{0x388,0x38a,1,37},
 	{0x38c,0x38c,-1,64},
@@ -2904,9 +2948,10 @@ static convertStruct toLower[] =
 	{0x48a,0x4be,2,1},
 	{0x4c0,0x4c0,-1,15},
 	{0x4c1,0x4cd,2,1},
-	{0x4d0,0x524,2,1},
+	{0x4d0,0x52e,2,1},
 	{0x531,0x556,1,48},
 	{0x10a0,0x10c5,1,7264},
+	{0x10c7,0x10cd,6,7264},
 	{0x1e00,0x1e94,2,1},
 	{0x1e9e,0x1e9e,-1,-7615},
 	{0x1ea0,0x1efe,2,1},
@@ -2954,24 +2999,34 @@ static convertStruct toLower[] =
 	{0x2c7e,0x2c7f,1,-10815},
 	{0x2c80,0x2ce2,2,1},
 	{0x2ceb,0x2ced,2,1},
-	{0xa640,0xa65e,2,1},
-	{0xa662,0xa66c,2,1},
-	{0xa680,0xa696,2,1},
+	{0x2cf2,0xa640,31054,1},
+	{0xa642,0xa66c,2,1},
+	{0xa680,0xa69a,2,1},
 	{0xa722,0xa72e,2,1},
 	{0xa732,0xa76e,2,1},
 	{0xa779,0xa77b,2,1},
 	{0xa77d,0xa77d,-1,-35332},
 	{0xa77e,0xa786,2,1},
 	{0xa78b,0xa78b,-1,1},
+	{0xa78d,0xa78d,-1,-42280},
+	{0xa790,0xa792,2,1},
+	{0xa796,0xa7a8,2,1},
+	{0xa7aa,0xa7aa,-1,-42308},
+	{0xa7ab,0xa7ab,-1,-42319},
+	{0xa7ac,0xa7ac,-1,-42315},
+	{0xa7ad,0xa7ad,-1,-42305},
+	{0xa7b0,0xa7b0,-1,-42258},
+	{0xa7b1,0xa7b1,-1,-42282},
 	{0xff21,0xff3a,1,32},
-	{0x10400,0x10427,1,40}
+	{0x10400,0x10427,1,40},
+	{0x118a0,0x118bf,1,32}
 };
 
 static convertStruct toUpper[] =
 {
 	{0x61,0x7a,1,-32},
 	{0xb5,0xb5,-1,743},
-	{0xe0,0xf6,1,-32},  /* 0xdf (German sharp s) is not upper-cased */
+	{0xe0,0xf6,1,-32},
 	{0xf8,0xfe,1,-32},
 	{0xff,0xff,-1,121},
 	{0x101,0x12f,2,-1},
@@ -3021,22 +3076,29 @@ static convertStruct toUpper[] =
 	{0x256,0x257,1,-205},
 	{0x259,0x259,-1,-202},
 	{0x25b,0x25b,-1,-203},
+	{0x25c,0x25c,-1,42319},
 	{0x260,0x260,-1,-205},
+	{0x261,0x261,-1,42315},
 	{0x263,0x263,-1,-207},
+	{0x265,0x265,-1,42280},
+	{0x266,0x266,-1,42308},
 	{0x268,0x268,-1,-209},
 	{0x269,0x269,-1,-211},
 	{0x26b,0x26b,-1,10743},
+	{0x26c,0x26c,-1,42305},
 	{0x26f,0x26f,-1,-211},
 	{0x271,0x271,-1,10749},
 	{0x272,0x272,-1,-213},
 	{0x275,0x275,-1,-214},
 	{0x27d,0x27d,-1,10727},
 	{0x280,0x283,3,-218},
+	{0x287,0x287,-1,42282},
 	{0x288,0x288,-1,-218},
 	{0x289,0x289,-1,-69},
 	{0x28a,0x28b,1,-217},
 	{0x28c,0x28c,-1,-71},
 	{0x292,0x292,-1,-219},
+	{0x29e,0x29e,-1,42258},
 	{0x345,0x345,-1,84},
 	{0x371,0x373,2,-1},
 	{0x377,0x377,-1,-1},
@@ -3057,6 +3119,7 @@ static convertStruct toUpper[] =
 	{0x3f0,0x3f0,-1,-86},
 	{0x3f1,0x3f1,-1,-80},
 	{0x3f2,0x3f2,-1,7},
+	{0x3f3,0x3f3,-1,-116},
 	{0x3f5,0x3f5,-1,-96},
 	{0x3f8,0x3fb,3,-1},
 	{0x430,0x44f,1,-32},
@@ -3065,7 +3128,7 @@ static convertStruct toUpper[] =
 	{0x48b,0x4bf,2,-1},
 	{0x4c2,0x4ce,2,-1},
 	{0x4cf,0x4cf,-1,-15},
-	{0x4d1,0x525,2,-1},
+	{0x4d1,0x52f,2,-1},
 	{0x561,0x586,1,-48},
 	{0x1d79,0x1d79,-1,35332},
 	{0x1d7d,0x1d7d,-1,3814},
@@ -3108,19 +3171,22 @@ static convertStruct toUpper[] =
 	{0x2c73,0x2c76,3,-1},
 	{0x2c81,0x2ce3,2,-1},
 	{0x2cec,0x2cee,2,-1},
+	{0x2cf3,0x2cf3,-1,-1},
 	{0x2d00,0x2d25,1,-7264},
-	{0xa641,0xa65f,2,-1},
-	{0xa663,0xa66d,2,-1},
-	{0xa681,0xa697,2,-1},
+	{0x2d27,0x2d2d,6,-7264},
+	{0xa641,0xa66d,2,-1},
+	{0xa681,0xa69b,2,-1},
 	{0xa723,0xa72f,2,-1},
 	{0xa733,0xa76f,2,-1},
 	{0xa77a,0xa77c,2,-1},
 	{0xa77f,0xa787,2,-1},
-	{0xa78c,0xa78c,-1,-1},
+	{0xa78c,0xa791,5,-1},
+	{0xa793,0xa797,4,-1},
+	{0xa799,0xa7a9,2,-1},
 	{0xff41,0xff5a,1,-32},
-	{0x10428,0x1044f,1,-40}
+	{0x10428,0x1044f,1,-40},
+	{0x118c0,0x118df,1,-32}
 };
-
 /*
  * Return the upper-case equivalent of "a", which is a UCS-4 character.  Use
  * simple case folding.
diff --git a/src/version.c b/src/version.c
index 51a1a1609b..6870528154 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    575,
 /**/
     574,
 /**/

From 43cd6339f0cf0e24545b76d614e4ee08740c571c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:40:09 +0100
Subject: [PATCH 405/473] Added tag v7-4-575 for changeset fe0f33ac63af

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 36a5c60cc0..641b222fd2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3297,3 +3297,4 @@ ccb6962585f1ea5e7f872d79e59565e7a95234db v7-4-569
 cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
 8cfbc34ae4aa2b91b5b012b2e8dfe86327b449c9 v7-4-573
 45ff9dd354eaff958c0ba646134e1f5cd6e9186f v7-4-574
+fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575

From 780e0a40737bf1401d1f053446cd4ffc91ea12be Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:52:30 +0100
Subject: [PATCH 406/473] updated for version 7.4.576 Problem:    Redrawing
 problem with 'relativenumber' and 'linebreak'. Solution:   Temporarily reset
 'linebreak' and restore it in more places. 	    (Christian Brabandt)

---
 src/normal.c  | 51 ++++++++++++++++++++++++++++++++++++++++++++++-----
 src/version.c |  2 ++
 2 files changed, 48 insertions(+), 5 deletions(-)

diff --git a/src/normal.c b/src/normal.c
index bd5bacd59a..cb1a7d154a 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1393,10 +1393,6 @@ do_pending_operator(cap, old_col, gui_yank)
     int		    include_line_break = FALSE;
 #endif
 
-#ifdef FEAT_LINEBREAK
-    curwin->w_p_lbr = FALSE;	/* Avoid a problem with unwanted linebreaks in
-				 * block mode. */
-#endif
 #if defined(FEAT_CLIPBOARD)
     /*
      * Yank the visual area into the GUI selection register before we operate
@@ -1420,6 +1416,10 @@ do_pending_operator(cap, old_col, gui_yank)
      */
     if ((finish_op || VIsual_active) && oap->op_type != OP_NOP)
     {
+#ifdef FEAT_LINEBREAK
+	/* Avoid a problem with unwanted linebreaks in block mode. */
+	curwin->w_p_lbr = FALSE;
+#endif
 	oap->is_VIsual = VIsual_active;
 	if (oap->motion_force == 'V')
 	    oap->motion_type = MLINE;
@@ -1819,7 +1819,13 @@ do_pending_operator(cap, old_col, gui_yank)
 			    || oap->op_type == OP_FUNCTION
 			    || oap->op_type == OP_FILTER)
 			&& oap->motion_force == NUL)
+		{
+#ifdef FEAT_LINEBREAK
+		    /* make sure redrawing is correct */
+		    curwin->w_p_lbr = lbr_saved;
+#endif
 		    redraw_curbuf_later(INVERTED);
+		}
 	    }
 	}
 
@@ -1863,7 +1869,12 @@ do_pending_operator(cap, old_col, gui_yank)
 		    || oap->op_type == OP_FOLD
 #endif
 		    ))
+	{
+#ifdef FEAT_LINEBREAK
+	    curwin->w_p_lbr = lbr_saved;
+#endif
 	    redraw_curbuf_later(INVERTED);
+	}
 
 	/*
 	 * If the end of an operator is in column one while oap->motion_type
@@ -1947,7 +1958,12 @@ do_pending_operator(cap, old_col, gui_yank)
 		}
 	    }
 	    else
+	    {
+#ifdef FEAT_LINEBREAK
+		curwin->w_p_lbr = lbr_saved;
+#endif
 		(void)op_yank(oap, FALSE, !gui_yank);
+	    }
 	    check_cursor_col();
 	    break;
 
@@ -1969,6 +1985,11 @@ do_pending_operator(cap, old_col, gui_yank)
 		else
 		    restart_edit_save = 0;
 		restart_edit = 0;
+#ifdef FEAT_LINEBREAK
+		/* Restore linebreak, so that when the user edits it looks as
+		 * before. */
+		curwin->w_p_lbr = lbr_saved;
+#endif
 		/* Reset finish_op now, don't want it set inside edit(). */
 		finish_op = FALSE;
 		if (op_change(oap))	/* will call edit() */
@@ -2064,8 +2085,16 @@ do_pending_operator(cap, old_col, gui_yank)
 		 * Visual mode.  But do this only once. */
 		restart_edit_save = restart_edit;
 		restart_edit = 0;
-
+#ifdef FEAT_LINEBREAK
+		/* Restore linebreak, so that when the user edits it looks as
+		 * before. */
+		curwin->w_p_lbr = lbr_saved;
+#endif
 		op_insert(oap, cap->count1);
+#ifdef FEAT_LINEBREAK
+		/* Reset linebreak, so that formatting works correctly. */
+		curwin->w_p_lbr = FALSE;
+#endif
 
 		/* TODO: when inserting in several lines, should format all
 		 * the lines. */
@@ -2090,7 +2119,14 @@ do_pending_operator(cap, old_col, gui_yank)
 	    }
 #ifdef FEAT_VISUALEXTRA
 	    else
+	    {
+#ifdef FEAT_LINEBREAK
+		/* Restore linebreak, so that when the user edits it looks as
+		 * before. */
+		curwin->w_p_lbr = lbr_saved;
+#endif
 		op_replace(oap, cap->nchar);
+	    }
 #endif
 	    break;
 
@@ -2134,7 +2170,12 @@ do_pending_operator(cap, old_col, gui_yank)
 	    if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted
 		    && (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT
 						|| oap->op_type == OP_DELETE))
+	    {
+#ifdef FEAT_LINEBREAK
+		curwin->w_p_lbr = FALSE;
+#endif
 		coladvance(curwin->w_curswant = old_col);
+	    }
 	}
 	else
 	{
diff --git a/src/version.c b/src/version.c
index 6870528154..4f310058d6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    576,
 /**/
     575,
 /**/

From 9ecb3d5b35daaa17ec09398ce30fbc8bde15b09b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 17:52:30 +0100
Subject: [PATCH 407/473] Added tag v7-4-576 for changeset 749fc929da45

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 641b222fd2..ac587b5bed 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3298,3 +3298,4 @@ cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
 8cfbc34ae4aa2b91b5b012b2e8dfe86327b449c9 v7-4-573
 45ff9dd354eaff958c0ba646134e1f5cd6e9186f v7-4-574
 fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575
+749fc929da45d07efc5352dd8a0c00f8ed9f2163 v7-4-576

From 5ada51e9fb9a060f1b9903f3ee2f91273ee9a6a6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 18:40:28 +0100
Subject: [PATCH 408/473] updated for version 7.4.577 Problem:    Matching with
 a virtual column has a lot of overhead on very long 	    lines. (Issue 310)
 Solution:   Bail out early if there can't be a match. (Christian Brabandt) 
     Also check for CTRL-C at every position.

---
 src/regexp_nfa.c | 29 ++++++++++++++++++++++-------
 src/version.c    |  2 ++
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 8e069f3519..369d96f9f0 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -6438,14 +6438,24 @@ nfa_regmatch(prog, start, submatch, m)
 	    case NFA_VCOL:
 	    case NFA_VCOL_GT:
 	    case NFA_VCOL_LT:
-		result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_VCOL,
-		    (long_u)win_linetabsize(
-			    reg_win == NULL ? curwin : reg_win,
-			    regline, (colnr_T)(reginput - regline)) + 1);
-		if (result)
 		{
-		    add_here = TRUE;
-		    add_state = t->state->out;
+		    int     op = t->state->c - NFA_VCOL;
+		    colnr_T col = (colnr_T)(reginput - regline);
+
+		    /* Bail out quickly when there can't be a match, avoid the
+		     * overhead of win_linetabsize() on long lines. */
+		    if ((col > t->state->val && op != 1)
+			    || (col - 1 > t->state->val && op == 1))
+			break;
+		    result = nfa_re_num_cmp(t->state->val, op,
+			(long_u)win_linetabsize(
+				reg_win == NULL ? curwin : reg_win,
+							   regline, col) + 1);
+		    if (result)
+		    {
+			add_here = TRUE;
+			add_state = t->state->out;
+		    }
 		}
 		break;
 
@@ -6744,6 +6754,11 @@ nfa_regmatch(prog, start, submatch, m)
 	    reg_nextline();
 	else
 	    break;
+
+	/* Allow interrupting with CTRL-C. */
+	fast_breakcheck();
+	if (got_int)
+	    break;
     }
 
 #ifdef ENABLE_LOG
diff --git a/src/version.c b/src/version.c
index 4f310058d6..1367621f4e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    577,
 /**/
     576,
 /**/

From 1ea1a5d75ea5fd64dad54e1409edcbc6c28ee46e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 18:40:29 +0100
Subject: [PATCH 409/473] Added tag v7-4-577 for changeset bcf9d3a6007f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index ac587b5bed..398b12ddde 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3299,3 +3299,4 @@ cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
 45ff9dd354eaff958c0ba646134e1f5cd6e9186f v7-4-574
 fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575
 749fc929da45d07efc5352dd8a0c00f8ed9f2163 v7-4-576
+bcf9d3a6007fff06d0521339f93dc870e5231eaa v7-4-577

From f78e7475ee15e8b928254fe6d74b2e99b588aead Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 19:00:38 +0100
Subject: [PATCH 410/473] updated for version 7.4.578 Problem:    Using
 getcurpos() after "$" in an empty line returns a negative 	    number.
 Solution:   Don't add one when this would overflow. (Hirohito Higashi)

---
 src/eval.c    | 3 ++-
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/eval.c b/src/eval.c
index 50e87081f7..e6175f6ba9 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -11941,7 +11941,8 @@ getpos_both(argvars, rettv, getcurpos)
 #endif
 							      (varnumber_T)0);
 	if (getcurpos)
-	    list_append_number(l, (varnumber_T)curwin->w_curswant + 1);
+	    list_append_number(l, curwin->w_curswant == MAXCOL ?
+		    (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 1);
     }
     else
 	rettv->vval.v_number = FALSE;
diff --git a/src/version.c b/src/version.c
index 1367621f4e..7a54fc2851 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    578,
 /**/
     577,
 /**/

From b361d0b13d5bf02e36276ebeb47d40751c81b9bb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 19:00:38 +0100
Subject: [PATCH 411/473] Added tag v7-4-578 for changeset b7b3afcae90e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 398b12ddde..c1d84c5136 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3300,3 +3300,4 @@ cba15023c40371ed51ee0ed50fbdf23d6860f0ba v7-4-572
 fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575
 749fc929da45d07efc5352dd8a0c00f8ed9f2163 v7-4-576
 bcf9d3a6007fff06d0521339f93dc870e5231eaa v7-4-577
+b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578

From 830d9b3d326a2e4e419fc0e761a04d4651673fd3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 19:35:14 +0100
Subject: [PATCH 412/473] updated for version 7.4.579 Problem:    Wrong cursor
 positioning when 'linebreak' is set and lines wrap. Solution:   (Christian
 Brabandt)

---
 src/charset.c | 34 ++++++++++++++++++++++++++++------
 src/screen.c  | 14 +++++++++++++-
 src/version.c |  2 ++
 3 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/src/charset.c b/src/charset.c
index e9745c09a2..53d2a60a40 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1178,28 +1178,50 @@ win_lbr_chartabsize(wp, line, s, col, headp)
     added = 0;
     if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0)
     {
-	numberextra = win_col_off(wp);
+	colnr_T sbrlen = 0;
+	int	numberwidth = win_col_off(wp);
+
+	numberextra = numberwidth;
 	col += numberextra + mb_added;
 	if (col >= (colnr_T)W_WIDTH(wp))
 	{
 	    col -= W_WIDTH(wp);
 	    numberextra = W_WIDTH(wp) - (numberextra - win_col_off2(wp));
-	    if (numberextra > 0)
+	    if (col >= numberextra && numberextra > 0)
 		col %= numberextra;
 	    if (*p_sbr != NUL)
 	    {
-		colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
+		sbrlen = (colnr_T)MB_CHARLEN(p_sbr);
 		if (col >= sbrlen)
 		    col -= sbrlen;
 	    }
-	    if (numberextra > 0)
+	    if (col >= numberextra && numberextra > 0)
 		col = col % numberextra;
+	    else if (col > 0 && numberextra > 0)
+		col += numberwidth - win_col_off2(wp);
+
+	    numberwidth -= win_col_off2(wp);
 	}
-	if (col == 0 || col + size > (colnr_T)W_WIDTH(wp))
+	if (col == 0 || col + size + sbrlen > (colnr_T)W_WIDTH(wp))
 	{
 	    added = 0;
 	    if (*p_sbr != NUL)
-		added += vim_strsize(p_sbr);
+	    {
+		if (size + sbrlen + numberwidth > (colnr_T)W_WIDTH(wp))
+		{
+		    /* calculate effective window width */
+		    int width = (colnr_T)W_WIDTH(wp) - sbrlen - numberwidth;
+		    int prev_width = col ? ((colnr_T)W_WIDTH(wp) - (sbrlen + col)) : 0;
+		    if (width == 0)
+			width = (colnr_T)W_WIDTH(wp);
+		    added += ((size - prev_width) / width) * vim_strsize(p_sbr);
+		    if ((size - prev_width) % width)
+			/* wrapped, add another length of 'sbr' */
+			added += vim_strsize(p_sbr);
+		}
+		else
+		    added += vim_strsize(p_sbr);
+	    }
 	    if (wp->w_p_bri)
 		added += get_breakindent_win(wp, line);
 
diff --git a/src/screen.c b/src/screen.c
index bbf57b1121..b767ec3c15 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2842,6 +2842,9 @@ win_line(wp, lnum, startrow, endrow, nochange)
     unsigned	off;			/* offset in ScreenLines/ScreenAttrs */
     int		c = 0;			/* init for GCC */
     long	vcol = 0;		/* virtual column (for tabs) */
+#ifdef FEAT_LINEBREAK
+    long	vcol_sbr = -1;		/* virtual column after showbreak */
+#endif
     long	vcol_prev = -1;		/* "vcol" of previous character */
     char_u	*line;			/* current line */
     char_u	*ptr;			/* current position in "line" */
@@ -3759,6 +3762,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		    n_extra = (int)STRLEN(p_sbr);
 		    char_attr = hl_attr(HLF_AT);
 		    need_showbreak = FALSE;
+		    vcol_sbr = vcol + MB_CHARLEN(p_sbr);
 		    /* Correct end of highlighted area for 'showbreak',
 		     * required when 'linebreak' is also set. */
 		    if (tocol == vcol)
@@ -4516,9 +4520,17 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		if (c == TAB && (!wp->w_p_list || lcs_tab1))
 		{
 		    int tab_len = 0;
+		    long vcol_adjusted = vcol; /* removed showbreak length */
+#ifdef FEAT_LINEBREAK
+		    /* only adjust the tab_len, when at the first column
+		     * after the showbreak value was drawn */
+		    if (*p_sbr != NUL && vcol == vcol_sbr && wp->w_p_wrap)
+			vcol_adjusted = vcol - MB_CHARLEN(p_sbr);
+#endif
 		    /* tab amount depends on current column */
 		    tab_len = (int)wp->w_buffer->b_p_ts
-					- vcol % (int)wp->w_buffer->b_p_ts - 1;
+					- vcol_adjusted % (int)wp->w_buffer->b_p_ts - 1;
+
 #ifdef FEAT_LINEBREAK
 		    if (!wp->w_p_lbr || !wp->w_p_list)
 #endif
diff --git a/src/version.c b/src/version.c
index 7a54fc2851..e6ab37e5a1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    579,
 /**/
     578,
 /**/

From 0089ebd8f34666fc360b55750c3df267b803ae83 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 19:35:14 +0100
Subject: [PATCH 413/473] Added tag v7-4-579 for changeset 134a7d55f9fa

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index c1d84c5136..59c12f4e8c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3301,3 +3301,4 @@ fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575
 749fc929da45d07efc5352dd8a0c00f8ed9f2163 v7-4-576
 bcf9d3a6007fff06d0521339f93dc870e5231eaa v7-4-577
 b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578
+134a7d55f9fa170c8c4591328eb550e70b756616 v7-4-579

From 229c0e0472bcffecbc3881bad97b716ec9e0fdc1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 19:42:21 +0100
Subject: [PATCH 414/473] Updated runtime files.

---
 runtime/doc/todo.txt      | 35 -----------------------------------
 runtime/filetype.vim      |  6 +++++-
 runtime/ftplugin/j.vim    | 32 +++++++++++++++++---------------
 runtime/indent/j.vim      | 22 +++++++++++-----------
 runtime/syntax/config.vim | 20 ++++++++++++++------
 runtime/syntax/j.vim      | 16 ++++++++--------
 6 files changed, 55 insertions(+), 76 deletions(-)

diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 12fc033180..7d53f86867 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -34,8 +34,6 @@ not be repeated below, unless there is extra information.
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
-Crash report from Stephen Martin, 2015 Jan 12.
-
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
@@ -58,13 +56,6 @@ Regexp problems:
   "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
 - Diff highlighting can be very slow. (Issue 309)
 
-Patch to make Dynamic Ruby work with Ruby 2.2.0. (Ken Takata 2015 Jan 10)
-
-Update J runtime files. (glts, 2015 Jan 11)
-
-The range for :wincmd is not always a window number, can also be a column
-count.  Remove the range check.  What to use for ":$wincmd"?
-
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
 More info Jul 24.  Not clear why.
 
@@ -77,10 +68,6 @@ work. (ZyX, 2013 Sep 28)
 
 Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
 
-Patch on Issue 292, recognizing polkit filetype.
-
-Issue 133: patch for config.vim, maintainer not responding.
-
 ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
 directory exists. (Sergio Gallelli, 2013 Dec 29)
 
@@ -94,30 +81,8 @@ wrong name. (Aram, 2014 Nov 7)  Vim 7.4.
 Value returned by virtcol() changes depending on how lines wrap.  This is
 inconsistent with the documentation.
 
-Ukrainian vimtutor. (Issue 288)
-
-Patch to fix that eval('$') does not give an error.  Yasuhiro Matsumoto, 2015
-Jan 12.
-
-Regenerate the Unicode tables in mbyte.c.
-Diff from ZyX, 2014 Dec 6.
-
-Patch to fix relative numbers. (Christian Brabandt, 2014 Nov 17)
-Update Nov 26.
-
-Patch to improve config.vim syntax.  Issue 305.  Maintainer last update was in
-2008.
-
-Patch on issue 310, matchadd() seems to hang.
-
-Patch to fix that getcurpos() returns a negative number, instead of MAXCOL.
-(Hirohito Higashi, 2014 Dec 8)
-
 Better greek spell checking.  Issue 299.
 
-Patch for wrong cursor positioning when 'linebreak' is set. (Christian
-Brabandt, 2015 Jan 11)
-
 Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
 Nov 12)
 
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 019345baf7..5ad76cc634 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2015 Jan 07
+" Last Change:	2015 Jan 14
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
@@ -2029,6 +2029,10 @@ func! s:FTRules()
     setf conf  " Better than hog
     return
   endif
+  if path =~ '^/\(etc\|usr/share\)/polkit-1/rules\.d'
+    setf javascript
+    return
+  endif
   try
     let config_lines = readfile('/etc/udev/udev.conf')
   catch /^Vim\%((\a\+)\)\=:E484/
diff --git a/runtime/ftplugin/j.vim b/runtime/ftplugin/j.vim
index bcd606ffa0..71ac4c5418 100644
--- a/runtime/ftplugin/j.vim
+++ b/runtime/ftplugin/j.vim
@@ -2,7 +2,7 @@
 " Language:	J
 " Maintainer:	David Bürgin <676c7473@gmail.com>
 " URL:		https://github.com/glts/vim-j
-" Last Change:	2014-04-05
+" Last Change:	2015-01-11
 
 if exists('b:did_ftplugin')
   finish
@@ -16,39 +16,41 @@ setlocal iskeyword=48-57,A-Z,_,a-z
 setlocal comments=:NB.
 setlocal commentstring=NB.\ %s
 setlocal formatoptions-=t
-setlocal shiftwidth=2 softtabstop=2 expandtab
+setlocal shiftwidth=2
+setlocal softtabstop=2
+setlocal expandtab
 setlocal matchpairs=(:)
 
 let b:undo_ftplugin = 'setlocal matchpairs< expandtab< softtabstop< shiftwidth< formatoptions< commentstring< comments< iskeyword<'
 
 " Section movement with ]] ][ [[ []. The start/end patterns below are amended
 " inside the function in order to avoid matching on the current cursor line.
-let s:sectionstart = '.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>.*'
+let s:sectionstart = '\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\)\>.*'
 let s:sectionend = '\s*)\s*'
 
 function! s:SearchSection(end, backwards, visualmode) abort
   if a:visualmode !=# ''
     normal! gv
   endif
-  let flags = a:backwards ? 'bsW' : 'sW'
+  let l:flags = a:backwards ? 'bsW' : 'sW'
   if a:end
-    call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
+    call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)
   else
-    call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
+    call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), l:flags)
   endif
 endfunction
 
-noremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>
-xnoremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>
+noremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>
+xnoremap <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>
 sunmap <buffer> ]]
-noremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>
-xnoremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>
+noremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>
+xnoremap <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>
 sunmap <buffer> ][
-noremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>
-xnoremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>
+noremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>
+xnoremap <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>
 sunmap <buffer> [[
-noremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>
-xnoremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>
+noremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>
+xnoremap <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>
 sunmap <buffer> []
 
 let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"'
@@ -66,7 +68,7 @@ endif
 " Enhanced "%" matching (see ":help matchit")
 if exists('loaded_matchit') && !exists('b:match_words')
   let b:match_ignorecase = 0
-  let b:match_words = '^.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>:^\s*\:\s*$:^\s*)\s*$'
+  let b:match_words = '^\%(\s*Note\|.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>:^\s*\:\s*$:^\s*)\s*$'
                   \ . ',\<\%(for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.:\<\%(case\|catch[dt]\=\|else\%(if\)\=\|fcase\)\.:\<end\.'
   let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
 endif
diff --git a/runtime/indent/j.vim b/runtime/indent/j.vim
index e268e1fcd3..ea3d50936b 100644
--- a/runtime/indent/j.vim
+++ b/runtime/indent/j.vim
@@ -2,7 +2,7 @@
 " Language:	J
 " Maintainer:	David Bürgin <676c7473@gmail.com>
 " URL:		https://github.com/glts/vim-j
-" Last Change:	2014-04-05
+" Last Change:	2015-01-11
 
 if exists('b:did_indent')
   finish
@@ -26,25 +26,25 @@ if !exists('g:j_indent_definitions')
 endif
 
 function GetJIndent() abort
-  let prevlnum = prevnonblank(v:lnum-1)
-  if prevlnum == 0
+  let l:prevlnum = prevnonblank(v:lnum - 1)
+  if l:prevlnum == 0
     return 0
   endif
-  let indent = indent(prevlnum)
-  let prevline = getline(prevlnum)
-  if prevline =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.\%(\%(\<end\.\)\@!.\)*$'
+  let l:indent = indent(l:prevlnum)
+  let l:prevline = getline(l:prevlnum)
+  if l:prevline =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.\%(\%(\<end\.\)\@!.\)*$'
     " Increase indentation after an initial control word that starts or
     " continues a block and is not terminated by "end."
-    let indent += shiftwidth()
-  elseif g:j_indent_definitions && (prevline =~# '\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>' || prevline =~# '^\s*:\s*$')
+    let l:indent += shiftwidth()
+  elseif g:j_indent_definitions && (l:prevline =~# '\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>' || l:prevline =~# '^\s*:\s*$')
     " Increase indentation in explicit definitions of adverbs, conjunctions,
     " and verbs
-    let indent += shiftwidth()
+    let l:indent += shiftwidth()
   endif
   " Decrease indentation in lines that start with either control words that
   " continue or end a block, or the special items ")" and ":"
   if getline(v:lnum) =~# '^\s*\%()\|:\|\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)'
-    let indent -= shiftwidth()
+    let l:indent -= shiftwidth()
   endif
-  return indent
+  return l:indent
 endfunction
diff --git a/runtime/syntax/config.vim b/runtime/syntax/config.vim
index 20ca19ced0..cd83b24352 100644
--- a/runtime/syntax/config.vim
+++ b/runtime/syntax/config.vim
@@ -1,11 +1,13 @@
 " Vim syntax file
 " Language:		configure.in script: M4 with sh
 " Maintainer:	Christian Hammesr <ch@lathspell.westend.com>
-" Last Change:	2008 Sep 03
+" Last Change:	2015 Jan 14
+" 				(patch from Yngve Inntjore Levinsen to detect AC_MSG)
+" 				(patch from Khym Chanur to add @Spell)
 
 " Well, I actually even do not know much about m4. This explains why there
 " is probably very much missing here, yet !
-" But I missed a good hilighting when editing my GNU autoconf/automake
+" But I missed good highlighting when editing my GNU autoconf/automake
 " script, so I wrote this quick and dirty patch.
 
 
@@ -20,14 +22,19 @@ endif
 " define the config syntax
 syn match   configdelimiter "[()\[\];,]"
 syn match   configoperator  "[=|&\*\+\<\>]"
-syn match   configcomment   "\(dnl.*\)\|\(#.*\)"
+syn match   configcomment   "\(dnl.*\)\|\(#.*\)" contains=configDnl,@Spell
 syn match   configfunction  "\<[A-Z_][A-Z0-9_]*\>"
 syn match   confignumber    "[-+]\=\<\d\+\(\.\d*\)\=\>"
+syn keyword configDnl   	dnl contained
 syn keyword configkeyword   if then else fi test for in do done
 syn keyword configspecial   cat rm eval
-syn region  configstring    start=+"+ skip=+\\"+ end=+"+
-syn region  configstring    start=+'+ skip=+\\'+ end=+'+
-syn region  configstring    start=+`+ skip=+\\'+ end=+`+
+
+" This shortens the script, see syn-ext-match..
+syn region  configstring    start=+\z(["'`]\)+ skip=+\\\z1+ end=+\z1+ contains=@Spell
+
+" Anything inside AC_MSG_TYPE([...])  and AC_MSG_TYPE(...) is a string.
+syn region  configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze(\[" matchgroup=configdelimiter end="\])" contains=configdelimiter,@Spell
+syn region  configstring matchgroup=configfunction start="AC_MSG_[A-Z]*\ze([^[]" matchgroup=configdelimiter end=")" contains=configdelimiter,@Spell
 
 " Define the default highlighting.
 " For version 5.7 and earlier: only when not done already
@@ -43,6 +50,7 @@ if version >= 508 || !exists("did_config_syntax_inits")
   HiLink configdelimiter Delimiter
   HiLink configoperator  Operator
   HiLink configcomment   Comment
+  HiLink configDnl  	 Comment
   HiLink configfunction  Function
   HiLink confignumber    Number
   HiLink configkeyword   Keyword
diff --git a/runtime/syntax/j.vim b/runtime/syntax/j.vim
index 0cdd59b887..4912942e8b 100644
--- a/runtime/syntax/j.vim
+++ b/runtime/syntax/j.vim
@@ -2,7 +2,7 @@
 " Language:	J
 " Maintainer:	David Bürgin <676c7473@gmail.com>
 " URL:		https://github.com/glts/vim-j
-" Last Change:	2014-10-05
+" Last Change:	2015-01-11
 
 if exists('b:current_syntax')
   finish
@@ -23,12 +23,12 @@ syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./
 " Standard library names. A few names need to be defined with ":syntax match"
 " because they would otherwise take precedence over the corresponding jControl
 " and jDefineExpression items.
-syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB andurl dbhelp libjqt
-syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows table
+syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB dbhelp libjqt
+syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows rxapply rxmerge table
 syntax keyword jStdlibConjunction bind cuts def on
-syntax keyword jStdlibVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpathsep jsystemdefs list ljust load loadd mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc script scriptd setbreak show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep
+syntax keyword jStdlibVerb AND Endian IFDEF OR XOR anddf android_exec_am android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring cleartags clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert compare coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcompare fcompares fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getalpha getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpath jpathsep jsystemdefs launch list ljust load loadd loadtags mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc rxE rxall rxcomp rxcut rxeq rxerror rxfirst rxfree rxfrom rxhandles rxin rxindex rxinfo rxmatch rxmatches rxrplc rxutf8 script scriptd scripts setalpha setbreak shell show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset ta tagcp tagopen tagselect take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep xedit
 syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
-syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
+syntax match jStdlibVerb /\<\%(Note\|\%(assert\|break\|do\)\.\@!\)\>/
 
 " Numbers. Matching J numbers is difficult. In fact, the job cannot be done
 " with regular expressions alone. Below is a sketch of the pattern used. It
@@ -75,12 +75,12 @@ syntax match jConjunction /;\.\|\^:\|![.:]/
 " the next line. The trick is to split the problem into two regions and link
 " them with "nextgroup=". The fold wrapper provides syntax folding.
 syntax region jNounDefineFold
-    \ matchgroup=NONE start=/\<\%(\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>\)\@=/
+    \ matchgroup=NONE start=/\%(\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>\)\@=/
     \ keepend matchgroup=NONE end=/^\s*)\s*$/
     \ contains=jNounDefineStart
     \ fold
 syntax region jNounDefineStart
-    \ matchgroup=jDefineExpression start=/\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>/
+    \ matchgroup=jDefineExpression start=/\%(\%(^\s*Note\)\|\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\)\>/
     \ keepend matchgroup=NONE end=/$/
     \ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment
     \ contained oneline skipempty nextgroup=jDefineEnd,jNounDefine
@@ -112,7 +112,7 @@ syntax region jParenGroup
     \ oneline transparent
 
 syntax keyword jTodo contained TODO FIXME XXX
-syntax match jComment /NB\..*$/ contains=jTodo,@Spell
+syntax match jComment /\<NB\..*$/ contains=jTodo,@Spell
 
 syntax match jSharpBang /\%^#!.*$/
 

From fdce91ddba704a56329ad23a4df47b82d0b2f49a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 21:22:01 +0100
Subject: [PATCH 415/473] updated for version 7.4.580 Problem:    ":52wincmd v"
 still gives an invalid range error. (Charles 	    Campbell) Solution:   Skip
 over white space.

---
 src/ex_docmd.c | 4 ++--
 src/version.c  | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 3edc1a2247..a59bbd1bbd 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2140,8 +2140,8 @@ do_one_cmd(cmdlinep, sourcing,
 
 #ifdef FEAT_WINDOWS
 	/* :wincmd range depends on the argument. */
-	if (ea.cmdidx == CMD_wincmd)
-	    get_wincmd_addr_type(p, &ea);
+	if (ea.cmdidx == CMD_wincmd && p != NULL)
+	    get_wincmd_addr_type(skipwhite(p), &ea);
 #endif
     }
 
diff --git a/src/version.c b/src/version.c
index e6ab37e5a1..cdde7ca528 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    580,
 /**/
     579,
 /**/

From 1f90bbf1da1fd18c341a637effcd9625d898cda8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Wed, 14 Jan 2015 21:22:01 +0100
Subject: [PATCH 416/473] Added tag v7-4-580 for changeset a5a6f1467b1e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 59c12f4e8c..5bd41767f1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3302,3 +3302,4 @@ fe0f33ac63af3c16a9920fe08bd3582aa0f02f50 v7-4-575
 bcf9d3a6007fff06d0521339f93dc870e5231eaa v7-4-577
 b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578
 134a7d55f9fa170c8c4591328eb550e70b756616 v7-4-579
+a5a6f1467b1ea73697b3265d8f12805bd998c81e v7-4-580

From e53203971fe70c597404d78e1c3e58211e6e1209 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 18 Jan 2015 14:08:56 +0100
Subject: [PATCH 417/473] updated for version 7.4.581 Problem:    Compiler
 warnings for unitinialized variables. (John Little) Solution:   Initialize
 the variables.

---
 src/ops.c     | 5 +++--
 src/version.c | 2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/ops.c b/src/ops.c
index 0c3d11b87f..f0d372d898 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5663,8 +5663,8 @@ read_viminfo_register(virp, force)
     int		set_prev = FALSE;
     char_u	*str;
     char_u	**array = NULL;
-    int		new_type;
-    colnr_T	new_width;
+    int		new_type = MCHAR; /* init to shut up compiler */
+    colnr_T	new_width = 0; /* init to shut up compiler */
 
     /* We only get here (hopefully) if line[0] == '"' */
     str = virp->vir_line + 1;
@@ -5747,6 +5747,7 @@ read_viminfo_register(virp, force)
 		do_it = FALSE;
 	}
     }
+
     if (do_it)
     {
 	/* free y_array[] */
diff --git a/src/version.c b/src/version.c
index cdde7ca528..4e8559ccc1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    581,
 /**/
     580,
 /**/

From 1794c3dcf1d606306f817a5b90a24c9f2d7240e5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 18 Jan 2015 14:08:56 +0100
Subject: [PATCH 418/473] Added tag v7-4-581 for changeset e1874a4524f8

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 5bd41767f1..f301eb23a2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3303,3 +3303,4 @@ bcf9d3a6007fff06d0521339f93dc870e5231eaa v7-4-577
 b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578
 134a7d55f9fa170c8c4591328eb550e70b756616 v7-4-579
 a5a6f1467b1ea73697b3265d8f12805bd998c81e v7-4-580
+e1874a4524f8c97efed78e215fd5ff91f3569351 v7-4-581

From 2930b255939bdb3abef42a8818753f5008bc8355 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 18 Jan 2015 16:46:32 +0100
Subject: [PATCH 419/473] updated for version 7.4.582 Problem:    Can't match
 "%>80v" properly. (Axel Bender) Solution:   Correctly handle ">". (Christian
 Brabandt)

---
 src/regexp_nfa.c      | 22 ++++++++++++++++------
 src/testdir/test64.in |  4 ++++
 src/testdir/test64.ok |  3 +++
 src/version.c         |  2 ++
 4 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 369d96f9f0..03d7868fa9 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -6441,16 +6441,26 @@ nfa_regmatch(prog, start, submatch, m)
 		{
 		    int     op = t->state->c - NFA_VCOL;
 		    colnr_T col = (colnr_T)(reginput - regline);
+		    win_T   *wp = reg_win == NULL ? curwin : reg_win;
 
 		    /* Bail out quickly when there can't be a match, avoid the
 		     * overhead of win_linetabsize() on long lines. */
-		    if ((col > t->state->val && op != 1)
-			    || (col - 1 > t->state->val && op == 1))
+		    if (op != 1 && col > t->state->val)
 			break;
-		    result = nfa_re_num_cmp(t->state->val, op,
-			(long_u)win_linetabsize(
-				reg_win == NULL ? curwin : reg_win,
-							   regline, col) + 1);
+		    result = FALSE;
+		    if (op == 1 && col - 1 > t->state->val && col > 100)
+		    {
+			int ts = wp->w_buffer->b_p_ts;
+
+			/* Guess that a character won't use more columns than
+			 * 'tabstop', with a minimum of 4. */
+			if (ts < 4)
+			    ts = 4;
+			result = col > t->state->val * ts;
+		    }
+		    if (!result)
+			result = nfa_re_num_cmp(t->state->val, op,
+				(long_u)win_linetabsize(wp, regline, col) + 1);
 		    if (result)
 		    {
 			add_here = TRUE;
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index f2452fc0f3..fd19d3af32 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -7,6 +7,7 @@ actually tried.
 STARTTEST
 :so small.vim
 :" tl is a List of Lists with:
+:"    regexp engine
 :"    regexp pattern
 :"    text to test the pattern on
 :"    expected match (optional)
@@ -451,6 +452,9 @@ STARTTEST
 :"""" Skip adding state twice
 :call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO'])
 :"
+:""" Test \%V atom
+:call add(tl, [2, '\%>70vGesamt', 'Jean-Michel Charlier & Victor Hubinon\Gesamtausgabe [Salleck]    Buck Danny {Jean-Michel Charlier & Victor Hubinon}\Gesamtausgabe', 'Gesamt'])
+:"
 :"""" Run the tests
 :"
 :for t in tl
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index ffc0b5341f..92f06ea9f3 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -1030,6 +1030,9 @@ OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}
 OK 0 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
 OK 1 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
 OK 2 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=
+OK 0 - \%>70vGesamt
+OK 1 - \%>70vGesamt
+OK 2 - \%>70vGesamt
 multi-line tests
 OK 0 - ^.\(.\).\_..\1.
 OK 1 - ^.\(.\).\_..\1.
diff --git a/src/version.c b/src/version.c
index 4e8559ccc1..57089fa481 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    582,
 /**/
     581,
 /**/

From 9e945cecf6fa42a2e398c97e5676709ab8c04d68 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 18 Jan 2015 16:46:33 +0100
Subject: [PATCH 420/473] Added tag v7-4-582 for changeset dfd593d81818

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f301eb23a2..bc57126c1e 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3304,3 +3304,4 @@ b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578
 134a7d55f9fa170c8c4591328eb550e70b756616 v7-4-579
 a5a6f1467b1ea73697b3265d8f12805bd998c81e v7-4-580
 e1874a4524f8c97efed78e215fd5ff91f3569351 v7-4-581
+dfd593d81818468ad60cad4fc66c561299f8d969 v7-4-582

From ce4d65c7672ef5a4a36a1d15dc1c0d1f2ded3306 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 12:14:01 +0100
Subject: [PATCH 421/473] updated for version 7.4.583 Problem:    With tiny
 features test 16 may fail. Solution:   Source small.vim. (Christian Brabandt)

---
 src/testdir/test16.in | 1 +
 src/version.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/testdir/test16.in b/src/testdir/test16.in
index b2cd159a8c..760ac675cd 100644
--- a/src/testdir/test16.in
+++ b/src/testdir/test16.in
@@ -2,6 +2,7 @@ Tests for resetting "secure" flag after GUI has started.
 For KDE set a font, empty 'guifont' may cause a hang.
 
 STARTTEST
+:so small.vim
 :if $DISPLAY == "" | e! test.ok | wq! test.out | endif
 :set exrc secure
 :if has("gui_kde")
diff --git a/src/version.c b/src/version.c
index 57089fa481..8b35b7e921 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    583,
 /**/
     582,
 /**/

From 0ea83267510c281a9440aa636a6ab7f3aa26385e Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 12:14:01 +0100
Subject: [PATCH 422/473] Added tag v7-4-583 for changeset f2978794e801

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bc57126c1e..43048b6cb2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3305,3 +3305,4 @@ b7b3afcae90e5b8e9f57ec3b172fed14f6912579 v7-4-578
 a5a6f1467b1ea73697b3265d8f12805bd998c81e v7-4-580
 e1874a4524f8c97efed78e215fd5ff91f3569351 v7-4-581
 dfd593d81818468ad60cad4fc66c561299f8d969 v7-4-582
+f2978794e801bfe8a587865492302cc0a16783cc v7-4-583

From c8e773a10191534f6396bd9e85e8df63becc94cd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 12:39:39 +0100
Subject: [PATCH 423/473] updated for version 7.4.584 Problem:    With tiny
 features test_command_count may fail. Solution:   Source small.vim.
 (Christian Brabandt)

---
 src/testdir/test_command_count.in | 2 +-
 src/version.c                     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index 16daad0b2d..fd528c6854 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -1,7 +1,7 @@
 Test for user command counts	    vim: set ft=vim :
 
 STARTTEST
-:so tiny.vim
+:so small.vim
 :let g:lines = []
 :com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
 :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
diff --git a/src/version.c b/src/version.c
index 8b35b7e921..b38e20b378 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    584,
 /**/
     583,
 /**/

From 978185d40ea61c1720d13619cdcfa4362daaaa68 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 12:39:39 +0100
Subject: [PATCH 424/473] Added tag v7-4-584 for changeset 79b3d83592c5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 43048b6cb2..83f88c3ca7 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3306,3 +3306,4 @@ a5a6f1467b1ea73697b3265d8f12805bd998c81e v7-4-580
 e1874a4524f8c97efed78e215fd5ff91f3569351 v7-4-581
 dfd593d81818468ad60cad4fc66c561299f8d969 v7-4-582
 f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
+79b3d83592c5ad63ce0c8d276d15f570e95dd941 v7-4-584

From 7a85889fbd4bb893741c5a0a40a8bc9e3834d003 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 13:29:49 +0100
Subject: [PATCH 425/473] updated for version 7.4.585 Problem:    Range for
 :bdelete does not work. (Ronald Schild) Solution:   Also allow unloaded
 buffers.

---
 src/ex_cmds.h                     |  2 +-
 src/testdir/test_command_count.in | 28 +++++++++++++++++++++++++++-
 src/testdir/test_command_count.ok |  5 ++++-
 src/version.c                     |  2 ++
 4 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 50e82521a6..941a97d0d9 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -173,7 +173,7 @@ EX(CMD_badd,		"badd",		ex_edit,
 			ADDR_LINES),
 EX(CMD_bdelete,		"bdelete",	ex_bunload,
 			BANG|RANGE|NOTADR|BUFNAME|COUNT|EXTRA|TRLBAR,
-			ADDR_LOADED_BUFFERS),
+			ADDR_BUFFERS),
 EX(CMD_behave,		"behave",	ex_behave,
 			NEEDARG|WORD1|TRLBAR|CMDWIN,
 			ADDR_LINES),
diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index fd528c6854..c87b4c909a 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -92,11 +92,37 @@ STARTTEST
 :call append(0, g:lines)
 :unlet g:lines
 :w|bd
-:se hidden
 :b1
 ENDTEST
 
 STARTTEST
+:let g:lines = []
+:func BufStatus()
+:  call add(g:lines, 'aaa: ' . buflisted(g:buf_aaa) . ' bbb: ' . buflisted(g:buf_bbb) . ' ccc: ' . buflisted(g:buf_ccc))
+:endfunc
+:se nohidden
+:e aaa
+:let buf_aaa = bufnr('%')
+:e bbb
+:let buf_bbb = bufnr('%')
+:e ccc
+:let buf_ccc = bufnr('%')
+:b1
+:call BufStatus()
+:exe buf_bbb . "," . buf_ccc . "bdelete"
+:call BufStatus()
+:exe buf_aaa . "bdelete"
+:call BufStatus()
+:e! test.out
+:call append('$', g:lines)
+:unlet g:lines
+:delfunc BufStatus
+:w|bd
+:b1
+ENDTEST
+
+STARTTEST
+:se hidden
 :only!
 :let g:lines = []
 :%argd
diff --git a/src/testdir/test_command_count.ok b/src/testdir/test_command_count.ok
index d554ae765d..8fdbc7748d 100644
--- a/src/testdir/test_command_count.ok
+++ b/src/testdir/test_command_count.ok
@@ -28,8 +28,11 @@ $tabe 2
 $+tabe E16: Invalid range
 0tabm x
 
+aaa: 1 bbb: 1 ccc: 1
+aaa: 1 bbb: 0 ccc: 0
+aaa: 0 bbb: 0 ccc: 0
 argdo: c d e
 windo: 2 3 4
-bufdo: 2 3 4 5 6 7 8 9 10 12
+bufdo: 2 3 4 5 6 7 8 9 10 15
 bufdo: 3 4 5 6 7
 tabdo: 2 3 4
diff --git a/src/version.c b/src/version.c
index b38e20b378..6fe2b32ce1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    585,
 /**/
     584,
 /**/

From 11c3e93c4f583f326bbc7ef6c1d1291ef3a40f36 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 13:29:50 +0100
Subject: [PATCH 426/473] Added tag v7-4-585 for changeset 1d3139ae6ce6

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 83f88c3ca7..eb2ce8568b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3307,3 +3307,4 @@ e1874a4524f8c97efed78e215fd5ff91f3569351 v7-4-581
 dfd593d81818468ad60cad4fc66c561299f8d969 v7-4-582
 f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 79b3d83592c5ad63ce0c8d276d15f570e95dd941 v7-4-584
+1d3139ae6ce67d69ce8bc221bfc67dc1b47e95d9 v7-4-585

From adb8bc77fd2f0e6b3464a3382c7356ebdc8a7541 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 17:27:22 +0100
Subject: [PATCH 427/473] updated for version 7.4.586 Problem:    Parallel
 building of the documentation html files is not reliable. Solution:   Remove
 a cyclic dependency. (Reiner Herrmann)

---
 runtime/doc/Makefile | 1 -
 src/version.c        | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile
index a6610a937a..86ccb74ffa 100644
--- a/runtime/doc/Makefile
+++ b/runtime/doc/Makefile
@@ -229,7 +229,6 @@ HTMLS = \
 	starting.html \
 	syntax.html \
 	tabpage.html \
-	tags.html \
 	tagsrch.html \
 	term.html \
 	tips.html \
diff --git a/src/version.c b/src/version.c
index 6fe2b32ce1..d43e4c1ca5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    586,
 /**/
     585,
 /**/

From 8d755a8e46c77b826d121b1a26a5abc08de7f593 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 17:27:22 +0100
Subject: [PATCH 428/473] Added tag v7-4-586 for changeset 667cb2eb17a5

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index eb2ce8568b..1f1b85f160 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3308,3 +3308,4 @@ dfd593d81818468ad60cad4fc66c561299f8d969 v7-4-582
 f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 79b3d83592c5ad63ce0c8d276d15f570e95dd941 v7-4-584
 1d3139ae6ce67d69ce8bc221bfc67dc1b47e95d9 v7-4-585
+667cb2eb17a52d9ac28a1b6f686935814e769ecd v7-4-586

From b3a0fb473d22d5b29334400aa089741b80f39f98 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:01:35 +0100
Subject: [PATCH 429/473] updated for version 7.4.587 Problem:    Conceal does
 not work properly with 'linebreak'. (cs86661) Solution:   Save and restore
 boguscols. (Christian Brabandt)

---
 src/screen.c                     | 18 ++++++++++++++++--
 src/testdir/test_listlbr_utf8.in | 22 ++++++++++++++++------
 src/testdir/test_listlbr_utf8.ok | 17 +++++++++++++++++
 src/version.c                    |  2 ++
 4 files changed, 51 insertions(+), 8 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index b767ec3c15..698f969687 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3003,6 +3003,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 					   wrapping */
     int		vcol_off	= 0;	/* offset for concealed characters */
     int		did_wcol	= FALSE;
+    int		old_boguscols   = 0;
 # define VCOL_HLC (vcol - vcol_off)
 # define FIX_FOR_BOGUSCOLS \
     { \
@@ -3010,6 +3011,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 	vcol -= vcol_off; \
 	vcol_off = 0; \
 	col -= boguscols; \
+	old_boguscols = boguscols; \
 	boguscols = 0; \
     }
 #else
@@ -4545,10 +4547,16 @@ win_line(wp, lnum, startrow, endrow, nochange)
 			int	saved_nextra = n_extra;
 
 #ifdef FEAT_CONCEAL
-			if (is_concealing && vcol_off > 0)
+			if ((is_concealing || boguscols > 0) && vcol_off > 0)
 			    /* there are characters to conceal */
 			    tab_len += vcol_off;
+			/* boguscols before FIX_FOR_BOGUSCOLS macro from above
+			 */
+			if (wp->w_p_list && lcs_tab1 && old_boguscols > 0
+							 && n_extra > tab_len)
+			    tab_len += n_extra - tab_len;
 #endif
+
 			/* if n_extra > 0, it gives the number of chars, to
 			 * use for a tab, else we need to calculate the width
 			 * for a tab */
@@ -4577,7 +4585,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 #ifdef FEAT_CONCEAL
 			/* n_extra will be increased by FIX_FOX_BOGUSCOLS
 			 * macro below, so need to adjust for that here */
-			if (is_concealing && vcol_off > 0)
+			if ((is_concealing || boguscols > 0) && vcol_off > 0)
 			    n_extra -= vcol_off;
 #endif
 		    }
@@ -4590,6 +4598,12 @@ win_line(wp, lnum, startrow, endrow, nochange)
 		     * the tab can be longer than 'tabstop' when there
 		     * are concealed characters. */
 		    FIX_FOR_BOGUSCOLS;
+		    /* Make sure, the highlighting for the tab char will be
+		     * correctly set further below (effectively reverts the
+		     * FIX_FOR_BOGSUCOLS macro */
+		    if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list
+								  && lcs_tab1)
+			tab_len += n_extra - tab_len;
 #endif
 #ifdef FEAT_MBYTE
 		    mb_utf8 = FALSE;	/* don't draw as UTF-8 */
diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
index ba12adae05..b3d05dfaed 100644
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -9,9 +9,9 @@ STARTTEST
 :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \"
 :norm! zt
 :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap
-:fu! ScreenChar(width)
+:fu! ScreenChar(width, lines)
 :	let c=''
-:	for j in range(1,4)
+:	for j in range(1,a:lines)
 :	    for i in range(1,a:width)
 :	    	let c.=nr2char(screenchar(j, i))
 :	    endfor
@@ -28,13 +28,13 @@ STARTTEST
 :let g:test ="Test 1: set linebreak + set list + fancy listchars"
 :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6"
 :redraw!
-:let line=ScreenChar(winwidth(0))
+:let line=ScreenChar(winwidth(0),4)
 :call DoRecordScreen()
 :"
 :let g:test ="Test 2: set nolinebreak list"
 :set list nolinebreak
 :redraw!
-:let line=ScreenChar(winwidth(0))
+:let line=ScreenChar(winwidth(0),4)
 :call DoRecordScreen()
 :"
 :let g:test ="Test 3: set linebreak nolist"
@@ -43,9 +43,19 @@ STARTTEST
 :norm! zt
 :set nolist linebreak
 :redraw!
-:let line=ScreenChar(winwidth(0))
+:let line=ScreenChar(winwidth(0),4)
+:call DoRecordScreen()
+:let g:test ="Test 4: set linebreak list listchars and concealing"
+:let c_defines=['#define ABCDE		1','#define ABCDEF		1','#define ABCDEFG		1','#define ABCDEFGH	1', '#define MSG_MODE_FILE			1','#define MSG_MODE_CONSOLE		2','#define MSG_MODE_FILE_AND_CONSOLE	3','#define MSG_MODE_FILE_THEN_CONSOLE	4']
+:call append('$', c_defines)
+:vert resize 40
+:$-7
+:norm! zt
+:set list linebreak listchars=tab:>- cole=1
+:syn match Conceal conceal cchar=>'AB\|MSG_MODE'
+:redraw!
+:let line=ScreenChar(winwidth(0),7)
 :call DoRecordScreen()
-:"
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_listlbr_utf8.ok b/src/testdir/test_listlbr_utf8.ok
index 634cf3906d..b90e696972 100644
--- a/src/testdir/test_listlbr_utf8.ok
+++ b/src/testdir/test_listlbr_utf8.ok
@@ -19,3 +19,20 @@ Test 3: set linebreak nolist
 ~                   
 ~                   
 ~                   
+#define ABCDE		1
+#define ABCDEF		1
+#define ABCDEFG		1
+#define ABCDEFGH	1
+#define MSG_MODE_FILE			1
+#define MSG_MODE_CONSOLE		2
+#define MSG_MODE_FILE_AND_CONSOLE	3
+#define MSG_MODE_FILE_THEN_CONSOLE	4
+
+Test 4: set linebreak list listchars and concealing
+#define ABCDE>-->---1                   
+#define >CDEF>-->---1                   
+#define >CDEFG>->---1                   
+#define >CDEFGH>----1                   
+#define >_FILE>--------->--->---1       
+#define >_CONSOLE>---------->---2       
+#define >_FILE_AND_CONSOLE>---------3   
diff --git a/src/version.c b/src/version.c
index d43e4c1ca5..9cbee6e69a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    587,
 /**/
     586,
 /**/

From 4b1b0555f4acd02b97bca9c70459b1a128070b39 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:01:36 +0100
Subject: [PATCH 430/473] Added tag v7-4-587 for changeset 70793fedd25a

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 1f1b85f160..bc897f535b 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3309,3 +3309,4 @@ f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 79b3d83592c5ad63ce0c8d276d15f570e95dd941 v7-4-584
 1d3139ae6ce67d69ce8bc221bfc67dc1b47e95d9 v7-4-585
 667cb2eb17a52d9ac28a1b6f686935814e769ecd v7-4-586
+70793fedd25a509568abbd4026565675e830b1ca v7-4-587

From 6e699d2422265eecd0574b0ddfb9592108945e36 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:31:02 +0100
Subject: [PATCH 431/473] updated for version 7.4.588 Problem:    ":0argedit
 foo" puts the new argument in the second place instead 	    of the
 first. Solution:   Adjust the range type. (Ingo Karkat)

---
 src/ex_cmds.h                       |  2 +-
 src/testdir/Make_amiga.mak          |  2 ++
 src/testdir/Make_dos.mak            |  1 +
 src/testdir/Make_ming.mak           |  1 +
 src/testdir/Make_os2.mak            |  1 +
 src/testdir/Make_vms.mms            |  1 +
 src/testdir/Makefile                |  1 +
 src/testdir/test_argument_0count.in | 28 ++++++++++++++++++++++++++++
 src/testdir/test_argument_0count.ok |  5 +++++
 src/version.c                       |  2 ++
 10 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 src/testdir/test_argument_0count.in
 create mode 100644 src/testdir/test_argument_0count.ok

diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index 941a97d0d9..21d42d55d4 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -136,7 +136,7 @@ EX(CMD_argdo,		"argdo",	ex_listdo,
 			BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
 			ADDR_ARGUMENTS),
 EX(CMD_argedit,		"argedit",	ex_argedit,
-			BANG|NEEDARG|RANGE|NOTADR|FILE1|EDITCMD|ARGOPT|TRLBAR,
+			BANG|NEEDARG|RANGE|NOTADR|ZEROR|FILE1|EDITCMD|ARGOPT|TRLBAR,
 			ADDR_ARGUMENTS),
 EX(CMD_argglobal,	"argglobal",	ex_args,
 			BANG|FILES|EDITCMD|ARGOPT|TRLBAR,
diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak
index c8becc7a7d..0e9898b9ad 100644
--- a/src/testdir/Make_amiga.mak
+++ b/src/testdir/Make_amiga.mak
@@ -36,6 +36,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test97.out test98.out \
 		test99.out test100.out test101.out test102.out test103.out \
 		test104.out test105.out test106.out test107.out \
+		test_argument_0count.out \
 		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
@@ -175,6 +176,7 @@ test104.out: test104.in
 test105.out: test105.in
 test106.out: test106.in
 test107.out: test107.in
+test_argument_0count.out: test_argument_0count.in
 test_argument_count.out: test_argument_count.in
 test_autoformat_join.out: test_autoformat_join.in
 test_breakindent.out: test_breakindent.in
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 57f85ea67b..1ba440718d 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -35,6 +35,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out  test107.out\
+		test_argument_0count.out \
 		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index 5718d46018..51049fb620 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -57,6 +57,7 @@ SCRIPTS =	test3.out test4.out test5.out test6.out test7.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
+		test_argument_0count.out \
 		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak
index 1ba2dfe946..0b3ce26e93 100644
--- a/src/testdir/Make_os2.mak
+++ b/src/testdir/Make_os2.mak
@@ -37,6 +37,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test98.out test99.out \
 		test100.out test101.out test102.out test103.out test104.out \
 		test105.out test106.out test107.out \
+		test_argument_0count.out \
 		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 9fecf9fa63..f57bf55a6b 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -96,6 +96,7 @@ SCRIPT = test1.out  test2.out  test3.out  test4.out  test5.out  \
 	 test95.out test96.out test98.out test99.out \
 	 test100.out test101.out test103.out test104.out \
 	 test105.out test106.out test107.out \
+	 test_argument_0count.out \
 	 test_argument_count.out \
 	 test_autoformat_join.out \
 	 test_breakindent.out \
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index e76a72b009..671c30d5c3 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -33,6 +33,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
 		test94.out test95.out test96.out test97.out test98.out \
 		test99.out test100.out test101.out test102.out test103.out \
 		test104.out test105.out test106.out test107.out \
+		test_argument_0count.out \
 		test_argument_count.out \
 		test_autoformat_join.out \
 		test_breakindent.out \
diff --git a/src/testdir/test_argument_0count.in b/src/testdir/test_argument_0count.in
new file mode 100644
index 0000000000..88317fa1fc
--- /dev/null
+++ b/src/testdir/test_argument_0count.in
@@ -0,0 +1,28 @@
+Tests for :0argadd and :0argedit     vim: set ft=vim :
+
+STARTTEST
+:so small.vim
+:let arglists = []
+:%argd
+:arga a b c d
+:2argu
+:0arga added
+:call add(arglists, argv())
+:2argu
+:arga third
+:call add(arglists, argv())
+:%argd
+:arga a b c d
+:2argu
+:0arge edited
+:call add(arglists, argv())
+:2argu
+:arga third
+:call add(arglists, argv())
+:e! test.out
+:call append(0, map(copy(arglists), 'join(v:val, " ")'))
+:w
+:qa!
+ENDTEST
+
+
diff --git a/src/testdir/test_argument_0count.ok b/src/testdir/test_argument_0count.ok
new file mode 100644
index 0000000000..ee5daea812
--- /dev/null
+++ b/src/testdir/test_argument_0count.ok
@@ -0,0 +1,5 @@
+added a b c d
+added a third b c d
+edited a b c d
+edited a third b c d
+
diff --git a/src/version.c b/src/version.c
index 9cbee6e69a..2f08c2495c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    588,
 /**/
     587,
 /**/

From 6526421ede1eb78c8e07aed9da4f48d6631362c5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:31:02 +0100
Subject: [PATCH 432/473] Added tag v7-4-588 for changeset a03e143b9358

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bc897f535b..2cefecd969 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3310,3 +3310,4 @@ f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 1d3139ae6ce67d69ce8bc221bfc67dc1b47e95d9 v7-4-585
 667cb2eb17a52d9ac28a1b6f686935814e769ecd v7-4-586
 70793fedd25a509568abbd4026565675e830b1ca v7-4-587
+a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588

From 95bff62b0d92890c1daa739f552dd94b321aee34 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:39:35 +0100
Subject: [PATCH 433/473] updated for version 7.4.589 Problem:    In the
 MS-Windows console Vim can't handle greek characters when 	    encoding
 is utf-8. Solution:   Escape K_NUL. (Yasuhiro Matsumoto)

---
 src/os_win32.c | 18 +++++++++++-------
 src/version.c  |  2 ++
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/os_win32.c b/src/os_win32.c
index 939563805a..ac25d7451e 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1814,18 +1814,22 @@ mch_inchar(
 		if (conv)
 		{
 		    char_u *p = typeahead + typeaheadlen;
-		    char_u *e = typeahead + TYPEAHEADLEN;
 
-		    while (*p && p < e)
+		    if (*p != K_NUL)
 		    {
-			if (*p == K_NUL)
+			char_u *e = typeahead + TYPEAHEADLEN;
+
+			while (*p && p < e)
 			{
+			    if (*p == K_NUL)
+			    {
+				++p;
+				mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
+				*p = 3;
+				++n;
+			    }
 			    ++p;
-			    mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
-			    *p = 3;
-			    ++n;
 			}
-			++p;
 		    }
 		}
 
diff --git a/src/version.c b/src/version.c
index 2f08c2495c..4e78e7f1dd 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    589,
 /**/
     588,
 /**/

From 7babc8007dc9c15dd7d11bbcfdf7d9aa870a480c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 20 Jan 2015 19:39:35 +0100
Subject: [PATCH 434/473] Added tag v7-4-589 for changeset 8ff2d1b611bf

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 2cefecd969..f2614862b1 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3311,3 +3311,4 @@ f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 667cb2eb17a52d9ac28a1b6f686935814e769ecd v7-4-586
 70793fedd25a509568abbd4026565675e830b1ca v7-4-587
 a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
+8ff2d1b611bfeb17b594262cbf9313f819b4483a v7-4-589

From 7ac90f103c60c82ad3d7f6044db276c3bd3758e5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 22 Jan 2015 22:40:20 +0100
Subject: [PATCH 435/473] updated for version 7.4.590 Problem:    Using
 ctrl_x_mode as if it contains flags. Solution:   Don't use AND with
 CTRL_X_OMNI. (Hirohito Higashi)

---
 src/edit.c    | 2 +-
 src/version.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/edit.c b/src/edit.c
index 13faafeb78..2a79582173 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3394,7 +3394,7 @@ ins_compl_bs()
      * allow the word to be deleted, we won't match everything. */
     if ((int)(p - line) - (int)compl_col < 0
 	    || ((int)(p - line) - (int)compl_col == 0
-		&& (ctrl_x_mode & CTRL_X_OMNI) == 0))
+		&& ctrl_x_mode != CTRL_X_OMNI))
 	return K_BS;
 
     /* Deleted more than what was used to find matches or didn't finish
diff --git a/src/version.c b/src/version.c
index 4e78e7f1dd..bef9b19a00 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    590,
 /**/
     589,
 /**/

From 5367c7d9ca762dfaede7857c7c0f59357bc698b5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 22 Jan 2015 22:40:21 +0100
Subject: [PATCH 436/473] Added tag v7-4-590 for changeset 5b8d26b85437

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f2614862b1..174447dc0f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3312,3 +3312,4 @@ f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 70793fedd25a509568abbd4026565675e830b1ca v7-4-587
 a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 8ff2d1b611bfeb17b594262cbf9313f819b4483a v7-4-589
+5b8d26b85437ffa91cd586fa138aba80bba897a9 v7-4-590

From 2c15050e076d3c1581137a02b055beb653c2acae Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 22 Jan 2015 22:41:56 +0100
Subject: [PATCH 437/473] updated for version 7.4.591 Problem:   
 test_listlbr_utf8 fails when the conceal feature is not available. Solution: 
  Check for the conceal feature. (Kazunobu Kuriyama)

---
 src/testdir/test_listlbr_utf8.in | 2 +-
 src/version.c                    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/testdir/test_listlbr_utf8.in b/src/testdir/test_listlbr_utf8.in
index b3d05dfaed..bb6350ddec 100644
--- a/src/testdir/test_listlbr_utf8.in
+++ b/src/testdir/test_listlbr_utf8.in
@@ -2,7 +2,7 @@ Test for linebreak and list option in utf-8 mode
 
 STARTTEST
 :so small.vim
-:if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif
+:if !exists("+linebreak") || !has("conceal") | e! test.ok | w! test.out | qa! | endif
 :so mbyte.vim
 :if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif
 :10new|:vsp|:vert resize 20
diff --git a/src/version.c b/src/version.c
index bef9b19a00..33f8a97271 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    591,
 /**/
     590,
 /**/

From 0d405fc09261fc6b2539cfaa2c80937c366c11a2 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Thu, 22 Jan 2015 22:41:56 +0100
Subject: [PATCH 438/473] Added tag v7-4-591 for changeset 7b8e3be930f3

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 174447dc0f..f84011f353 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3313,3 +3313,4 @@ f2978794e801bfe8a587865492302cc0a16783cc v7-4-583
 a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 8ff2d1b611bfeb17b594262cbf9313f819b4483a v7-4-589
 5b8d26b85437ffa91cd586fa138aba80bba897a9 v7-4-590
+7b8e3be930f39af3cdc1fe969a6de16f2d91e5d2 v7-4-591

From 03716ffa1ebe679e38c13128b5aca65df713b4c1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Sun, 25 Jan 2015 13:02:57 +0100
Subject: [PATCH 439/473] Update runtime files.

---
 runtime/doc/eval.txt           |  4 +-
 runtime/doc/farsi.txt          |  2 +-
 runtime/doc/if_ole.txt         |  2 +-
 runtime/doc/intro.txt          |  4 +-
 runtime/doc/print.txt          |  2 +-
 runtime/doc/quotes.txt         |  4 +-
 runtime/doc/term.txt           |  2 +-
 runtime/doc/todo.txt           | 49 ++++++++++++------------
 runtime/doc/uganda.txt         |  2 +-
 runtime/doc/usr_03.txt         |  2 +-
 runtime/doc/vim.1              |  2 +-
 runtime/indent/fortran.vim     | 21 ++++++----
 runtime/syntax/awk.vim         | 67 +++++++++++++++++++-------------
 runtime/syntax/crontab.vim     | 70 +++++++++++++++++-----------------
 runtime/syntax/fortran.vim     | 48 +++++++++++++++++++++--
 runtime/syntax/mplayerconf.vim | 55 +++++++++++++++++++++++---
 runtime/syntax/strace.vim      |  7 ++--
 17 files changed, 224 insertions(+), 119 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 69ab0a641b..b778e34578 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -956,7 +956,7 @@ Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).
 Floating point numbers can be written in two forms:
 
 	[-+]{N}.{M}
-	[-+]{N}.{M}e[-+]{exp}
+	[-+]{N}.{M}[eE][-+]{exp}
 
 {N} and {M} are numbers.  Both {N} and {M} must be present and can only
 contain digits.
@@ -7371,7 +7371,7 @@ This does NOT work: >
 				:unlet v
 <							*E741*
 			If you try to change a locked variable you get an
-			error message: "E741: Value of {name} is locked"
+			error message: "E741: Value is locked: {name}"
 
 			[depth] is relevant when locking a |List| or
 			|Dictionary|.  It specifies how deep the locking goes:
diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt
index 77ec419d1f..c901d9272b 100644
--- a/runtime/doc/farsi.txt
+++ b/runtime/doc/farsi.txt
@@ -222,7 +222,7 @@ o  Keyboard
 Note:
 	�  stands for Farsi PSP (break without space)
 
-	�  stands for Farsi PCN (for HAMZE attribute )
+	�  stands for Farsi PCN (for HAMZE attribute)
 
 Restrictions
 ------------
diff --git a/runtime/doc/if_ole.txt b/runtime/doc/if_ole.txt
index 7d77b660f1..63e6e312c2 100644
--- a/runtime/doc/if_ole.txt
+++ b/runtime/doc/if_ole.txt
@@ -197,7 +197,7 @@ files in it.
 --remote-silent "+call cursor(10, 27)"
 	      - Places the cursor on line 10 column 27
 In Vim >
-   :h --remote-silent for mor details
+   :h --remote-silent for more details
 
 [.Net remarks provided by Dave Fishburn and Brian Sturk]
 
diff --git a/runtime/doc/intro.txt b/runtime/doc/intro.txt
index a03079c798..9f6dc033e4 100644
--- a/runtime/doc/intro.txt
+++ b/runtime/doc/intro.txt
@@ -1,4 +1,4 @@
-*intro.txt*     For Vim version 7.4.  Last change: 2014 May 24
+*intro.txt*     For Vim version 7.4.  Last change: 2015 Jan 20
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -135,7 +135,7 @@ http://www.vim.org/maillist.php
 
 Bug reports:				*bugs* *bug-reports* *bugreport.vim*
 
-Send bug reports to: Vim Developers <vim_dev@vim.org>
+Send bug reports to: Vim Developers <vim-dev@vim.org>
 This is a maillist, you need to become a member first and many people will see
 the message.  If you don't want that, e.g. because it is a security issue,
 send it to <bugs@vim.org>, this only goes to the Vim maintainer (that's Bram).
diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt
index 2ff6b1063c..e12d7f814e 100644
--- a/runtime/doc/print.txt
+++ b/runtime/doc/print.txt
@@ -693,7 +693,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS
 utility psselect.  This utility has options -e and -o for printing just the
 even or odd pages of a PS file respectively.
 
-First generate a PS file with the 'hardcopy' command, then generate a new
+First generate a PS file with the 'hardcopy' command, then generate new
 files with all the odd and even numbered pages with: >
 
 	psselect -o test.ps odd.ps
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
index 11d8550121..5900eb6976 100644
--- a/runtime/doc/quotes.txt
+++ b/runtime/doc/quotes.txt
@@ -178,14 +178,14 @@ Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
 that vi sorely needs: highlighting for executing commands on blocks, an easily
 navigable and digestible help screen, and more.  (Paul Pax)
 
-The reason WHY I don't have this amazingly useful macro any more, is that I
+The reason WHY I don't have this amazingly useful macro anymore, is that I
 now use VIM - and this is built in!! (Stephen Riehm, Germany)
 
 I am a user of VIM and I love it.  I use it to do all my programming, C,
 C++, HTML what ever.  (Tim Allwine)
 
 I discovered VIM after years of struggling with the original vi, and I just
-can't live without it any more.  (Emmanuel Mogenet, USA)
+can't live without it anymore.  (Emmanuel Mogenet, USA)
 
 Emacs has not a bit of chance to survive so long as VIM is around.  Besides,
 it also has the most detailed software documentation I have ever seen---much
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index d2dd547061..2076e83421 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -410,7 +410,7 @@ adjust the various t_ codes.  This avoids the problem that the xterm can
 produce different codes, depending on the mode it is in (8-bit, VT102,
 VT220, etc.).  The result is that codes like <xF1> are no longer needed.
 Note: This is only done on startup.  If the xterm options are changed after
-Vim has started, the escape sequences may not be recognized any more.
+Vim has started, the escape sequences may not be recognized anymore.
 
 							*xterm-resize*
 Window resizing with xterm only works if the allowWindowOps resource is
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index 7d53f86867..1df73185ea 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 14
+*todo.txt*      For Vim version 7.4.  Last change: 2015 Jan 23
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -37,6 +37,8 @@ not be repeated below, unless there is extra information.
 Regexp problems:
 - The NFA engine does not implement the time limit passed to
   nfa_regexec_multi()
+- Using win_linetabsize() can still be slow. Cache the result, store col and
+  vcol. Reset them when moving to another line.
 - Very slow with a long line and Ruby highlighting. (John Whitley, 2014 Dec 4)
 - Bug with pattern: '\vblock (\d+)\.\n.*\d+%(\1)@<!\.$'
   (Lech Lorens, 2014 Feb 3)
@@ -55,6 +57,12 @@ Regexp problems:
   engine, can we do this with the new engine?  E.g. with
   "/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
 - Diff highlighting can be very slow. (Issue 309)
+- Using "{1,1000}" is much slower than it was with the old engine.
+  (Dominique Pelle, 2015 Jan 22) 
+- Using %> for a virtual column has a check based on 'tabsize'.  Better would
+  be to cache the result of win_linetabsize(col), storing both col and vcol,
+  and use them to decide whether win_linetabsize() needs to be called.  Reset
+  col and vcol when moving to another line.
 
 Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
 More info Jul 24.  Not clear why.
@@ -83,30 +91,21 @@ inconsistent with the documentation.
 
 Better greek spell checking.  Issue 299.
 
-Patch to fix wrong formatting if 'linebreak' is set. (Christian Brabandt, 2014
-Nov 12)
+Patch to fix slow valgrind highlighting. (Dominique, 2015 Jan 15)
+Does maintainer respond?
 
-Patch for fixing a problem of the combination of conceal and linebreak.
-(Christian Brabandt, 2014 Dec 11)
-
-Any more changes from 
-https://github.com/chrisbra/vim-mq-patches/blob/master/linebreak_bug
-?
-
-Patch to avoid recognizing polkit as hog files. (Issue 292)
-
-":0argedit foo" puts new argument in second place instead of first.
-Patch from Ingo Karkat, 2014 Dec 19.
-
-Patch for greek characters on MS-Windows console. (Yasuhiro Matsumoto, 2014
-Dec 17)
+Patch on issue 212: feedkeys() with dot doesn't work as expected.
 
 Patch to support hex values for setting option value.
-(Zyx, 2015 Nov 6)
+(Zyx, 2014 Nov 6)
 
 Patch to fix problems with small screen sizes. (Christian Brabandt, 2015 Jan
 8)
 
+":tabdo windo echo 'hi'" causes "* register not to be changed.
+(Salman Halim, 2015 Jan 17)
+Patch by Christian, 2015 Jan 20.  There is another problem, wait a bit.
+
 On MS-Windows running tests with Mercurial has problems when the fileformat of
 the input files are changed. (Ken Takata, Taro Muraoka, 2014 Sep 25)
 Update Nov 5.
@@ -154,6 +153,9 @@ Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
 Problem caused by patch 7.3.638: window->open does not update window
 correctly. Issue 91.  With patch.
 
+Patch for drag&drop reordering of GUI tab pages reordering.
+(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
+
 'ff' is wrong for one-line file without EOL. (Patch on Issue 77)
 
 Patch on Issue 72: 'autochdir' causes problems for :vimgrep.
@@ -209,6 +211,9 @@ Patch for building a 32bit Vim with 64bit MingW compiler.
 
 Delete old code in os_msdos.c, mch_FullName().
 
+Patch: On MS-Windows shellescape() may have to triple double quotes.
+(Ingo Karkat, 2015 Jan 16)
+
 Redo only remembers the last change.  Could use "{count}g." to redo an older
 change.  How does the user know which change?  At least have a way to list
 them: ":repeats".
@@ -233,9 +238,6 @@ Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
 
 No error for missing endwhile. (ZyX, 2014 Mar 20)
 
-start_global_changes() plus end_global_changes() causes problem for
-clip_unnamed_plus. (Jason Pleau, 2014 Sep 12)
-
 The entries added by matchaddpos() are returned by getmatches() but can't be
 set with setmatches(). (lcd47, 2014 Jun 29)
 
@@ -257,7 +259,7 @@ More tests May 14. Update May 29.  Update Aug 10.
 
 The garbage collector may use too much stack.  Make set_ref_in_item()
 iterative instead of recursive.   Test program by Marc Weber (2013 Dec 10)
-Patch by Ben Fritz, 2014 Jun 22.
+Patch by Ben Fritz, 2014 Jun 22.  Update 2015 Jan 21.
 Related: Vim hangs when freeing a lot of objects.  Patch by Yasuhiro
 Matsumoto, 2014 Aug 26.
 
@@ -430,9 +432,6 @@ Patch from Christian Brabandt doesn't fix it completely.
 Patch from Christian Brabandt to preserve upper case marks when wiping out a
 buffer. (2013 Dec 9)
 
-Patch for drag&drop reordering of GUI tab pages reordering.
-(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
-
 GTK: problem with 'L' in 'guioptions' changing the window width.
 (Aaron Cornelius, 2012 Feb 6)
 
diff --git a/runtime/doc/uganda.txt b/runtime/doc/uganda.txt
index 113df4f64f..167f1baed3 100644
--- a/runtime/doc/uganda.txt
+++ b/runtime/doc/uganda.txt
@@ -194,7 +194,7 @@ child, you should have the intention to do this for at least one year.
 
 How do you know that the money will be spent right?  First of all you have my
 personal guarantee as the author of Vim.  I trust the people that are working
-at the centre, I know them personally.  Further more, the centre has been
+at the centre, I know them personally.  Furthermore, the centre has been
 co-sponsored and inspected by World Vision, Save the Children Fund and is now
 under the supervision of Pacific Academy Outreach Society.  The centre is
 visited about once a year to check the progress (at our own cost).  I have
diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt
index 6173260895..8cbcf13a14 100644
--- a/runtime/doc/usr_03.txt
+++ b/runtime/doc/usr_03.txt
@@ -532,7 +532,7 @@ MATCHING ANY SINGLE CHARACTER
 
 The . (dot) character matches any existing character.  For example, the
 pattern "c.m" matches a string whose first character is a c, whose second
-character is anything, and whose the third character is m.  Example:
+character is anything, and whose third character is m.  Example:
 
 	We use a computer that became the cummin winter. ~
 		 xxx		 xxx	  xxx
diff --git a/runtime/doc/vim.1 b/runtime/doc/vim.1
index 820caa24f5..e2dcd42c2f 100644
--- a/runtime/doc/vim.1
+++ b/runtime/doc/vim.1
@@ -135,7 +135,7 @@ For the first file the cursor will be positioned on line "num".
 If "num" is missing, the cursor will be positioned on the last line.
 .TP
 +/{pat}
-For the first file the cursor will be positioned on the
+For the first file the cursor will be positioned in the line with the
 first occurrence of {pat}.
 See ":help search\-pattern" for the available search patterns.
 .TP
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index e76c64b671..2c83f26b58 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,9 +1,11 @@
 " Vim indent file
-" Language:	Fortran95 (and Fortran90, Fortran77, F and elf90)
-" Version:	0.40
-" Last Change:	2011 Dec. 28
-" Maintainer:	Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
+" Language:	Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
+" Version:	0.41
+" Last Change:	2015 Jan. 15
+" Maintainer:	Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
 " Usage:	Do :help fortran-indent from Vim
+" Credits:
+"  Useful suggestions were made by: Albert Oliver Serra.
 
 " Only load this indent file when no other was loaded.
 if exists("b:did_indent")
@@ -36,8 +38,8 @@ if !exists("b:fortran_fixed_source")
   else
     " f90 and f95 allow both fixed and free source form
     " assume fixed source form unless signs of free source form
-    " are detected in the first five columns of the first 250 lines
-    " Detection becomes more accurate and time-consuming if more lines
+    " are detected in the first five columns of the first s:lmax lines.
+    " Detection becomes more accurate and more time-consuming if more lines
     " are checked. Increase the limit below if you keep lots of comments at
     " the very top of each file and you have a fast computer
     let s:lmax = 500
@@ -129,7 +131,7 @@ function FortranGetIndent(lnum)
   if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*'
         \. '\(else\|else\s*if\|else\s*where\|case\|'
         \. 'end\s*\(if\|where\|select\|interface\|'
-        \. 'type\|forall\|associate\|enum\)\)\>'
+        \. 'type\|forall\|associate\|enum\|block\)\)\>'
     let ind = ind - &sw
     " Fix indent for case statement immediately after select
     if prevstat =~? '\<select\s\+\(case\|type\)\>'
@@ -141,8 +143,11 @@ function FortranGetIndent(lnum)
   if prevstat =~ '&\s*$' && prev2stat !~ '&\s*$'
     let ind = ind + &sw
   endif
+  if prevstat =~ '&\s*$' && prevstat =~ '\<else\s*if\>'
+    let ind = ind - &sw
+  endif
   "Line after last continuation line
-  if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$'
+  if prevstat !~ '&\s*$' && prev2stat =~ '&\s*$' && prevstat !~? '\<then\>'
     let ind = ind - &sw
   endif
 
diff --git a/runtime/syntax/awk.vim b/runtime/syntax/awk.vim
index f80a582226..40491eea1a 100644
--- a/runtime/syntax/awk.vim
+++ b/runtime/syntax/awk.vim
@@ -1,13 +1,15 @@
 " Vim syntax file
 " Language:	awk, nawk, gawk, mawk
 " Maintainer:	Antonio Colombo <azc100@gmail.com>
-" Last Change:	2012 May 18
+" Last Change:	2014 Oct 21
 
 " AWK  ref.  is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
 " The AWK Programming Language, Addison-Wesley, 1988
 
 " GAWK ref. is: Arnold D. Robbins
 " Effective AWK Programming, Third Edition, O'Reilly, 2001
+" Effective AWK Programming, Fourth Edition, O'Reilly, 2015
+" (also available with the gawk source distribution)
 
 " MAWK is a "new awk" meaning it implements AWK ref.
 " mawk conforms to the Posix 1003.2 (draft 11.3)
@@ -33,17 +35,27 @@ set cpo&vim
 syn keyword awkStatement	break continue delete exit
 syn keyword awkStatement	function getline next
 syn keyword awkStatement	print printf return
-" GAWK ref. p. 117
+" GAWK ref. Chapter 7
 syn keyword awkStatement	nextfile
-" AWK  ref. p. 42, GAWK ref. p. 142-166
-syn keyword awkFunction	atan2 close cos exp fflush int log rand sin sqrt srand
-syn keyword awkFunction	gsub index length match split sprintf sub
-syn keyword awkFunction	substr system
-" GAWK ref. p. 142-166
-syn keyword awkFunction	asort gensub mktime strftime strtonum systime
+"
+" GAWK ref. Chapter 9, Functions
+"
+" Numeric Functions
+syn keyword awkFunction	atan2 cos div exp int log rand sin sqrt srand
+" String Manipulation Functions
+syn keyword awkFunction	asort asort1 gensub gsub index length match 
+syn keyword awkFunction	patsplit split sprintf strtonum sub substr
 syn keyword awkFunction	tolower toupper
-syn keyword awkFunction	and or xor compl lshift rshift
-syn keyword awkFunction	dcgettext bindtextdomain
+" Input Output Functions
+syn keyword awkFunction	close fflush system
+" Time Functions
+syn keyword awkFunction	mktime strftime systime
+" Bit Manipulation Functions
+syn keyword awkFunction	and compl lshift or rshift xor
+" Getting Type Function
+syn keyword awkFunction	isarray
+" String-Translation Functions
+syn keyword awkFunction	bindtextdomain dcgettext dcngetext
 
 syn keyword awkConditional	if else
 syn keyword awkRepeat	while for
@@ -51,13 +63,16 @@ syn keyword awkRepeat	while for
 syn keyword awkTodo		contained TODO
 
 syn keyword awkPatterns	BEGIN END
-" AWK  ref. p. 36
-syn keyword awkVariables	ARGC ARGV FILENAME FNR FS NF NR
-syn keyword awkVariables	OFMT OFS ORS RLENGTH RS RSTART SUBSEP
-" GAWK ref. p. 120-126
-syn keyword awkVariables	ARGIND BINMODE CONVFMT ENVIRON ERRNO
-syn keyword awkVariables	FIELDWIDTHS IGNORECASE LINT PROCINFO
-syn keyword awkVariables	RT RLENGTH TEXTDOMAIN
+
+" GAWK ref. Chapter 7
+" Built-in Variables That Control awk
+syn keyword awkVariables        BINMODE CONVFMT FIELDWIDTHS FPAT FS
+syn keyword awkVariables	IGNORECASE LINT OFMT OFS ORS PREC
+syn keyword awkVariables	ROUNDMODE RS SUBSEP TEXTDOMAIN
+" Built-in Variables That Convey Information
+syn keyword awkVariables	ARGC ARGV ARGIND ENVIRON ERRNO FILENAME
+syn keyword awkVariables	FNR NF FUNCTAB NR PROCINFO RLENGTH RSTART 
+syn keyword awkVariables	RT SYMTAB
 
 syn keyword awkRepeat	do
 
@@ -115,15 +130,15 @@ syn case match
 "syn match  awkIdentifier	"\<[a-zA-Z_][a-zA-Z0-9_]*\>"
 
 " Arithmetic operators: +, and - take care of ++, and --
-"syn match   awkOperator	"+\|-\|\*\|/\|%\|="
-"syn match   awkOperator	"+=\|-=\|\*=\|/=\|%="
-"syn match   awkOperator	"^\|^="
+syn match   awkOperator	"+\|-\|\*\|/\|%\|="
+syn match   awkOperator	"+=\|-=\|\*=\|/=\|%="
+syn match   awkOperator	"^\|^="
 
 " Comparison expressions.
-"syn match   awkExpression	"==\|>=\|=>\|<=\|=<\|\!="
-"syn match   awkExpression	"\~\|\!\~"
-"syn match   awkExpression	"?\|:"
-"syn keyword awkExpression	in
+syn match   awkExpression	"==\|>=\|=>\|<=\|=<\|\!="
+syn match   awkExpression	"\~\|\!\~"
+syn match   awkExpression	"?\|:"
+syn keyword awkExpression	in
 
 " Boolean Logic (OR, AND, NOT)
 "syn match  awkBoolLogic	"||\|&&\|\!"
@@ -187,8 +202,8 @@ if version >= 508 || !exists("did_awk_syn_inits")
   HiLink awkFloat		Float
 
   HiLink awkFileIO		Special
-  "HiLink awkOperator		Special
-  "HiLink awkExpression		Special
+  HiLink awkOperator		Special
+  HiLink awkExpression		Special
   HiLink awkBoolLogic		Special
 
   HiLink awkPatterns		Special
diff --git a/runtime/syntax/crontab.vim b/runtime/syntax/crontab.vim
index 36d75c4d13..fd1c30023f 100644
--- a/runtime/syntax/crontab.vim
+++ b/runtime/syntax/crontab.vim
@@ -5,7 +5,7 @@
 " License: This file can be redistribued and/or modified under the same terms
 "   as Vim itself.
 " Filenames: /tmp/crontab.* used by "crontab -e"
-" Last Change: 2012-05-16
+" Last Change: 2015-01-20
 "
 " crontab line format:
 " Minutes   Hours   Days   Months   Days_of_Week   Commands # comments
@@ -13,11 +13,17 @@
 " For version 5.x: Clear all syntax items
 " For version 6.x: Quit when a syntax file was already loaded
 if version < 600
-  syntax clear
+	syntax clear
 elseif exists("b:current_syntax")
-  finish
+	finish
 endif
 
+syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
+
+syntax match crontabVar "^\s*\k\w*\s*="me=e-1
+
+syntax case ignore
+
 syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
@@ -32,45 +38,41 @@ syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains
 syntax match crontabCmnt "^\s*#.*" contains=@Spell
 syntax match crontabPercent "[^\\]%.*"lc=1 contained
 
-syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
-
-syntax match crontabVar "^\s*\k\w*\s*="me=e-1
-
 " Define the default highlighting.
 " For version 5.7 and earlier: only when not done already
 " For version 5.8 and later: only when an item doesn't have highlighting yet
 if version >= 508 || !exists("did_crontab_syn_inits")
-  if version < 508
-    let did_crontab_syn_inits = 1
-    command -nargs=+ HiLink hi link <args>
-  else
-    command -nargs=+ HiLink hi def link <args>
-  endif
-
-  HiLink crontabMin		Number
-  HiLink crontabHr		PreProc
-  HiLink crontabDay		Type
-
-  HiLink crontabMnth		Number
-  HiLink crontabMnth12		Number
-  HiLink crontabMnthS		Number
-  HiLink crontabMnthN		Number
-
-  HiLink crontabDow		PreProc
-  HiLink crontabDow7		PreProc
-  HiLink crontabDowS		PreProc
-  HiLink crontabDowN		PreProc
-
-  HiLink crontabNick		Special
-  HiLink crontabVar		Identifier
-  HiLink crontabPercent		Special
+	if version < 508
+		let did_crontab_syn_inits = 1
+		command -nargs=+ HiLink hi link <args>
+	else
+		command -nargs=+ HiLink hi def link <args>
+	endif
+
+	HiLink crontabMin		Number
+	HiLink crontabHr		PreProc
+	HiLink crontabDay		Type
+
+	HiLink crontabMnth		Number
+	HiLink crontabMnth12		Number
+	HiLink crontabMnthS		Number
+	HiLink crontabMnthN		Number
+
+	HiLink crontabDow		PreProc
+	HiLink crontabDow7		PreProc
+	HiLink crontabDowS		PreProc
+	HiLink crontabDowN		PreProc
+
+	HiLink crontabNick		Special
+	HiLink crontabVar		Identifier
+	HiLink crontabPercent		Special
 
 " comment out next line for to suppress unix commands coloring.
-  HiLink crontabCmd		Statement
+	HiLink crontabCmd		Statement
 
-  HiLink crontabCmnt		Comment
+	HiLink crontabCmnt		Comment
 
-  delcommand HiLink
+	delcommand HiLink
 endif
 
 let b:current_syntax = "crontab"
diff --git a/runtime/syntax/fortran.vim b/runtime/syntax/fortran.vim
index df33793bb2..120a999404 100644
--- a/runtime/syntax/fortran.vim
+++ b/runtime/syntax/fortran.vim
@@ -1,15 +1,15 @@
 " Vim syntax file
 " Language:	Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
-" Version:	0.94
-" Last Change:	2012 June 18
-" Maintainer:	Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
+" Version:	0.95
+" Last Change:	2015 Jan. 15
+" Maintainer:	Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
 " Usage:	For instructions, do :help fortran-syntax from Vim
 " Credits:
 "  Version 0.1 was based on the fortran 77 syntax file by Mario Eusebio and
 "  Preben Guldberg. Useful suggestions were made by: Andrej Panjkov,
 "  Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile,
 "  Walter Dieudonn�, Alexander Wagner, Roman Bertle, Charles Rendleman,
-"  Andrew Griffiths, Joe Krahn, and Hendrik Merx.
+"  Andrew Griffiths, Joe Krahn, Hendrik Merx, and Matt Thompson.
 
 if exists("b:current_syntax")
   finish
@@ -298,6 +298,41 @@ if b:fortran_dialect == "f08"
   syn keyword fortranIntrinsic        bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image
   syn keyword fortranIO               newunit
   syn keyword fortranType             contiguous
+
+" CUDA fortran
+  syn match fortranTypeCUDA           "\<attributes\>"
+  syn keyword fortranTypeCUDA         host global device value
+  syn keyword fortranTypeCUDA         shared constant pinned texture
+  syn keyword fortranTypeCUDA         dim1 dim2 dim3 dim4
+  syn keyword fortranTypeCUDA         cudadeviceprop cuda_count_kind cuda_stream_kind
+  syn keyword fortranTypeCUDA         cudaEvent cudaFuncAttributes cudaArrayPtr
+  syn keyword fortranTypeCUDA         cudaSymbol cudaChannelFormatDesc cudaPitchedPtr
+  syn keyword fortranTypeCUDA         cudaExtent cudaMemcpy3DParms
+  syn keyword fortranTypeCUDA         cudaFuncCachePreferNone cudaFuncCachePreferShared
+  syn keyword fortranTypeCUDA         cudaFuncCachePreferL1 cudaLimitStackSize
+  syn keyword fortranTypeCUDA         cudaLimitPrintfSize cudaLimitMallocHeapSize
+  syn keyword fortranTypeCUDA         cudaSharedMemBankSizeDefault cudaSharedMemBankSizeFourByte cudaSharedMemBankSizeEightByte
+  syn keyword fortranTypeCUDA         cudaEventDefault cudaEventBlockingSync cudaEventDisableTiming
+  syn keyword fortranTypeCUDA         cudaMemcpyHostToDevice cudaMemcpyDeviceToHost
+  syn keyword fortranTypeCUDA         cudaMemcpyDeviceToDevice
+  syn keyword fortranTypeCUDA         cudaErrorNotReady cudaSuccess cudaErrorInvalidValue
+  syn keyword fortranTypeCUDA         c_devptr
+
+  syn match fortranStringCUDA         "blockidx%[xyz]"
+  syn match fortranStringCUDA         "blockdim%[xyz]"
+  syn match fortranStringCUDA         "griddim%[xyz]"
+  syn match fortranStringCUDA         "threadidx%[xyz]"
+
+  syn keyword fortranIntrinsicCUDA    warpsize syncthreads syncthreads_and syncthreads_count syncthreads_or threadfence threadfence_block threadfence_system gpu_time allthreads anythread ballot
+  syn keyword fortranIntrinsicCUDA    atomicadd atomicsub atomicmax atomicmin atomicand atomicor atomicxor atomicexch atomicinc atomicdec atomiccas sizeof __shfl __shfl_up __shfl_down __shfl_xor
+  syn keyword fortranIntrinsicCUDA    cudaChooseDevice cudaDeviceGetCacheConfig cudaDeviceGetLimit cudaDeviceGetSharedMemConfig cudaDeviceReset cudaDeviceSetCacheConfig cudaDeviceSetLimit cudaDeviceSetSharedMemConfig cudaDeviceSynchronize cudaGetDevice cudaGetDeviceCount cudaGetDeviceProperties cudaSetDevice cudaSetDeviceFlags cudaSetValidDevices
+  syn keyword fortranIntrinsicCUDA    cudaThreadExit cudaThreadSynchronize cudaGetLastError cudaGetErrorString cudaPeekAtLastError cudaStreamCreate cudaStreamDestroy cudaStreamQuery cudaStreamSynchronize cudaStreamWaitEvent cudaEventCreate cudaEventCreateWithFlags cudaEventDestroy cudaEventElapsedTime cudaEventQuery cudaEventRecord cudaEventSynchronize
+  syn keyword fortranIntrinsicCUDA    cudaFuncGetAttributes cudaFuncSetCacheConfig cudaFuncSetSharedMemConfig cudaSetDoubleForDevice cudaSetDoubleForHost cudaFree cudaFreeArray cudaFreeHost cudaGetSymbolAddress cudaGetSymbolSize
+  syn keyword fortranIntrinsicCUDA    cudaHostAlloc cudaHostGetDevicePointer cudaHostGetFlags cudaHostRegister cudaHostUnregister cudaMalloc cudaMallocArray cudaMallocHost cudaMallocPitch cudaMalloc3D cudaMalloc3DArray
+  syn keyword fortranIntrinsicCUDA    cudaMemcpy cudaMemcpyArraytoArray cudaMemcpyAsync cudaMemcpyFromArray cudaMemcpyFromSymbol cudaMemcpyFromSymbolAsync cudaMemcpyPeer cudaMemcpyPeerAsync cudaMemcpyToArray cudaMemcpyToSymbol cudaMemcpyToSymbolAsync cudaMemcpy2D cudaMemcpy2DArrayToArray cudaMemcpy2DAsync cudaMemcpy2DFromArray cudaMemcpy2DToArray cudaMemcpy3D cudaMemcpy3DAsync
+  syn keyword fortranIntrinsicCUDA    cudaMemGetInfo cudaMemset cudaMemset2D cudaMemset3D cudaDeviceCanAccessPeer cudaDeviceDisablePeerAccess cudaDeviceEnablePeerAccess cudaPointerGetAttributes cudaDriverGetVersion cudaRuntimeGetVersion
+
+  syn region none matchgroup=fortranType start="<<<" end=">>>" contains=ALLBUT,none
 endif
 
 syn cluster fortranCommentGroup contains=fortranTodo
@@ -453,6 +488,11 @@ else
   hi! def link fortranConditionalR	fortranConditional
 endif
 
+" CUDA
+hi def link fortranIntrinsicCUDA        fortranIntrinsic
+hi def link fortranTypeCUDA             fortranType
+hi def link fortranStringCUDA           fortranString
+
 hi def link fortranFormatSpec	Identifier
 hi def link fortranFloat	Float
 hi def link fortranPreCondit	PreCondit
diff --git a/runtime/syntax/mplayerconf.vim b/runtime/syntax/mplayerconf.vim
index b348327f90..84ad2daf13 100644
--- a/runtime/syntax/mplayerconf.vim
+++ b/runtime/syntax/mplayerconf.vim
@@ -1,7 +1,8 @@
 " Vim syntax file
-" Language:         mplayer(1) configuration file
-" Maintainer:       Nikolai Weibull <now@bitwi.se>
-" Latest Revision:  2007-06-17
+" Language:             mplayer(1) configuration file
+" Maintainer:           Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
+" Previous Maintainer:  Nikolai Weibull <now@bitwi.se>
+" Latest Revision:      2015-01-24
 
 if exists("b:current_syntax")
   finish
@@ -19,7 +20,7 @@ syn region mplayerconfComment   display oneline start='#' end='$'
 
 syn keyword mplayerconfPreProc  include
 
-syn keyword mplayerconfBoolean  yes no
+syn keyword mplayerconfBoolean  yes no true false
 
 syn match   mplayerconfNumber   '\<\d\+\>'
 
@@ -68,7 +69,49 @@ syn keyword mplayerconfOption   hardframedrop nomouseinput bandwidth dumpstream
                                 \ audio-delay audio-preload endpos ffourcc
                                 \ include info noautoexpand noskip o oac of
                                 \ ofps ovc skiplimit v vobsubout vobsuboutid
-                                \ lameopts lavcopts nuvopts xvidencopts
+                                \ lameopts lavcopts nuvopts xvidencopts a52drc
+                                \ adapter af-add af-clr af-del af-pre
+                                \ allow-dangerous-playlist-parsing ass
+                                \ ass-border-color ass-bottom-margin ass-color
+                                \ ass-font-scale ass-force-style ass-hinting
+                                \ ass-line-spacing ass-styles ass-top-margin
+                                \ ass-use-margins ausid bluray-angle
+                                \ bluray-device border border-pos-x border-pos-y
+                                \ cache-min cache-seek-min capture codecpath
+                                \ codecs-file correct-pts crash-debug
+                                \ doubleclick-time dvd-speed edl-backward-delay
+                                \ edl-start-pts embeddedfonts fafmttag
+                                \ field-dominance fontconfig force-avi-aspect
+                                \ force-key-frames frameno-file fullscreen gamma
+                                \ gui gui-include gui-wid heartbeat-cmd
+                                \ heartbeat-interval hr-edl-seek
+                                \ http-header-fields idle ignore-start
+                                \ key-fifo-size list-properties menu-chroot
+                                \ menu-keepdir menu-startup mixer-channel
+                                \ monitor-orientation monitorpixelaspect
+                                \ mouse-movements msgcharset msgcolor msglevel
+                                \ msgmodule name noar nocache noconfig
+                                \ noconsolecontrols nocorrect-pts nodouble
+                                \ noedl-start-pts noencodedups
+                                \ noflip-hebrew-commas nogui noidx noodml
+                                \ nostop-xscreensaver nosub noterm-osd
+                                \ osd-duration osd-fractions panscanrange
+                                \ pausing playing-msg priority profile
+                                \ progbar-align psprobe pvr radio referrer
+                                \ refreshrate reuse-socket rtc rtc-device
+                                \ rtsp-destination rtsp-port
+                                \ rtsp-stream-over-http screenh show-profile
+                                \ softvol softvol-max sub-paths subfont
+                                \ term-osd-esc title tvscan udp-ip udp-master
+                                \ udp-port udp-seek-threshold udp-slave
+                                \ unrarexec use-filedir-conf use-filename-title
+                                \ vf-add vf-clr vf-del vf-pre volstep volume
+                                \ zrhdec zrydoff
+
+syn region  mplayerconfString   display oneline start=+"+ end=+"+
+syn region  mplayerconfString   display oneline start=+'+ end=+'+
+
+syn region  mplayerconfProfile  display oneline start='^\s*\[' end='\]'
 
 hi def link mplayerconfTodo     Todo
 hi def link mplayerconfComment  Comment
@@ -76,6 +119,8 @@ hi def link mplayerconfPreProc  PreProc
 hi def link mplayerconfBoolean  Boolean
 hi def link mplayerconfNumber   Number
 hi def link mplayerconfOption   Keyword
+hi def link mplayerconfString   String
+hi def link mplayerconfProfile  Special
 
 let b:current_syntax = "mplayerconf"
 
diff --git a/runtime/syntax/strace.vim b/runtime/syntax/strace.vim
index 80cd262efc..0f686fd808 100644
--- a/runtime/syntax/strace.vim
+++ b/runtime/syntax/strace.vim
@@ -1,9 +1,8 @@
 " Vim syntax file
 " This is a GENERATED FILE. Please always refer to source file at the URI below.
 " Language: strace output
-" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
-" Last Change: 2002-10-10
-" URL: http://trific.ath.cx/Ftp/vim/syntax/strace.vim
+" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
+" Last Change: 2015-01-16
 
 " Setup
 if version >= 600
@@ -17,7 +16,7 @@ endif
 syn case match
 
 " Parse the line
-syn match straceSpecialChar "\\\d\d\d\|\\." contained
+syn match straceSpecialChar "\\\o\{1,3}\|\\." contained
 syn region straceString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=straceSpecialChar oneline
 syn match straceNumber "\W[+-]\=\(\d\+\)\=\.\=\d\+\([eE][+-]\=\d\+\)\="lc=1
 syn match straceNumber "\W0x\x\+"lc=1

From c2c4f73b585e25b62eceeeb230c58a0a3ad503a4 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 11:26:15 +0100
Subject: [PATCH 440/473] updated for version 7.4.592 Problem:    When doing
 ":e foobar" when already editing "foobar" and 'buftype' 	    is
 "nofile" the buffer is cleared. (Xavier de Gaye) Solution:   Do no clear the
 buffer.

---
 src/ex_cmds.c | 7 +++++++
 src/version.c | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 8195eb71b8..e18a752cb0 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3529,6 +3529,13 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
 #endif
 		check_fname() == FAIL)
 	    goto theend;
+
+	/* ":e foobar" when already editing "foobar" will reload the file.
+	 * But when 'buftype' is "nofile" there is no file to load, so don't
+	 * do anything. */
+	if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')
+	    goto theend;
+
 	oldbuf = (flags & ECMD_OLDBUF);
     }
 
diff --git a/src/version.c b/src/version.c
index 33f8a97271..abf41a66b8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    592,
 /**/
     591,
 /**/

From 57fea136fe0caad4ddf4d4624cf19a74a89fd6f9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 11:26:15 +0100
Subject: [PATCH 441/473] Added tag v7-4-592 for changeset 005a6b650866

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index f84011f353..d8b23e3d61 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3314,3 +3314,4 @@ a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 8ff2d1b611bfeb17b594262cbf9313f819b4483a v7-4-589
 5b8d26b85437ffa91cd586fa138aba80bba897a9 v7-4-590
 7b8e3be930f39af3cdc1fe969a6de16f2d91e5d2 v7-4-591
+005a6b65086666ed56531e4c8a531a3ee0cea638 v7-4-592

From 8f8c28185e7d29d6756c5137a98e89ab6a440f0b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 12:59:55 +0100
Subject: [PATCH 442/473] updated for version 7.4.593 Problem:    Crash when
 searching for "x\{0,90000}". (Dominique Pelle) Solution:   Bail out from the
 NFA engine when the max limit is much higher 	    than the min limit.

---
 src/regexp.c     | 13 ++++++-------
 src/regexp_nfa.c | 14 ++++++++++++--
 src/version.c    |  2 ++
 src/vim.h        |  1 +
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/src/regexp.c b/src/regexp.c
index d36ac49bb6..bae547cd6a 100644
--- a/src/regexp.c
+++ b/src/regexp.c
@@ -8081,7 +8081,8 @@ vim_regcomp(expr_arg, re_flags)
      * First try the NFA engine, unless backtracking was requested.
      */
     if (regexp_engine != BACKTRACKING_ENGINE)
-        prog = nfa_regengine.regcomp(expr, re_flags);
+        prog = nfa_regengine.regcomp(expr,
+		re_flags + (regexp_engine == AUTOMATIC_ENGINE ? RE_AUTO : 0));
     else
 	prog = bt_regengine.regcomp(expr, re_flags);
 
@@ -8105,16 +8106,14 @@ vim_regcomp(expr_arg, re_flags)
 #endif
 	/*
 	 * If the NFA engine failed, try the backtracking engine.
-	 * Disabled for now, both engines fail on the same patterns.
-	 * Re-enable when regcomp() fails when the pattern would work better
-	 * with the other engine.
-	 *
+	 * The NFA engine also fails for patterns that it can't handle well
+	 * but are still valid patterns, thus a retry should work.
+	 */
 	if (regexp_engine == AUTOMATIC_ENGINE)
 	{
+	    regexp_engine = BACKTRACKING_ENGINE;
 	    prog = bt_regengine.regcomp(expr, re_flags);
-	    regexp_engine == BACKTRACKING_ENGINE;
 	}
-	 */
     }
 
     if (prog != NULL)
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 03d7868fa9..2bd75af202 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -244,6 +244,9 @@ static char_u e_nul_found[] = N_("E865: (NFA) Regexp end encountered prematurely
 static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c");
 static char_u e_ill_char_class[] = N_("E877: (NFA regexp) Invalid character class: %ld");
 
+/* re_flags passed to nfa_regcomp() */
+static int nfa_re_flags;
+
 /* NFA regexp \ze operator encountered. */
 static int nfa_has_zend;
 
@@ -2011,10 +2014,10 @@ nfa_regpiece()
 	     *  <atom>*  */
 	    if (minval == 0 && maxval == MAX_LIMIT)
 	    {
-		if (greedy)
+		if (greedy)		/* { { (match the braces) */
 		    /* \{}, \{0,} */
 		    EMIT(NFA_STAR);
-		else
+		else			/* { { (match the braces) */
 		    /* \{-}, \{-0,} */
 		    EMIT(NFA_STAR_NONGREEDY);
 		break;
@@ -2030,6 +2033,12 @@ nfa_regpiece()
 		return OK;
 	    }
 
+	    /* The engine is very inefficient (uses too many states) when the
+	     * maximum is much larger than the minimum.  Bail out if we can
+	     * use the other engine. */
+	    if ((nfa_re_flags & RE_AUTO) && maxval > minval + 200)
+		return FAIL;
+
 	    /* Ignore previous call to nfa_regatom() */
 	    post_ptr = post_start + my_post_start;
 	    /* Save parse state after the repeated atom and the \{} */
@@ -7046,6 +7055,7 @@ nfa_regcomp(expr, re_flags)
 	return NULL;
 
     nfa_regengine.expr = expr;
+    nfa_re_flags = re_flags;
 
     init_class_tab();
 
diff --git a/src/version.c b/src/version.c
index abf41a66b8..6a40cfa32c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    593,
 /**/
     592,
 /**/
diff --git a/src/vim.h b/src/vim.h
index ea53e00cd5..e35987951b 100644
--- a/src/vim.h
+++ b/src/vim.h
@@ -1020,6 +1020,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define RE_MAGIC	1	/* 'magic' option */
 #define RE_STRING	2	/* match in string instead of buffer text */
 #define RE_STRICT	4	/* don't allow [abc] without ] */
+#define RE_AUTO		8	/* automatic engine selection */
 
 #ifdef FEAT_SYN_HL
 /* values for reg_do_extmatch */

From a5449ba097c3ed1b6e90096261e341ee8c4acdfa Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 12:59:55 +0100
Subject: [PATCH 443/473] Added tag v7-4-593 for changeset bdc8e71633e4

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index d8b23e3d61..caa8184373 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3315,3 +3315,4 @@ a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 5b8d26b85437ffa91cd586fa138aba80bba897a9 v7-4-590
 7b8e3be930f39af3cdc1fe969a6de16f2d91e5d2 v7-4-591
 005a6b65086666ed56531e4c8a531a3ee0cea638 v7-4-592
+bdc8e71633e45ebe5f1b59e4328fcf22a5866cb7 v7-4-593

From bfec2c42148a7ba2a9bbc549ba843a508aabbf89 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:22:20 +0100
Subject: [PATCH 444/473] updated for version 7.4.594 Problem:    Using a block
 delete while 'breakindent' is set does not work 	    properly.
 Solution:   Use "line" instead of "prev_pend" as the first argument to 
     lbr_chartabsize_adv().  (Hirohito Higashi)

---
 src/ops.c                       |  5 +----
 src/testdir/test_breakindent.in | 17 +++++++++++++++++
 src/testdir/test_breakindent.ok | 10 ++++++++++
 src/version.c                   |  2 ++
 4 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/src/ops.c b/src/ops.c
index f0d372d898..6df1121a5f 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5308,10 +5308,7 @@ block_prep(oap, bdp, lnum, is_del)
 	    {
 		/* Count a tab for what it's worth (if list mode not on) */
 		prev_pend = pend;
-		/* TODO: is passing prev_pend for start of the line OK?
-		 * perhaps it should be "line". */
-		incr = lbr_chartabsize_adv(prev_pend, &pend,
-						      (colnr_T)bdp->end_vcol);
+		incr = lbr_chartabsize_adv(line, &pend, (colnr_T)bdp->end_vcol);
 		bdp->end_vcol += incr;
 	    }
 	    if (bdp->end_vcol <= oap->end_vcol
diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index a255457b2e..f9d903e51b 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -99,6 +99,23 @@ fygjyl:let line2 = @0
 :$put =line1
 :$put =line2
 :"
+:let g:test="Test 14: breakindent + visual blockwise delete #1"
+:set all& breakindent
+:30vnew
+:normal! 3a1234567890
+:normal! a    abcde
+:exec "normal! 0\<C-V>tex"
+:let line1=ScreenChar(line('.'),8)
+:call DoRecordScreen()
+:"
+:let g:test="Test 15: breakindent + visual blockwise delete #2"
+:%d
+:normal! 4a1234567890
+:exec "normal! >>\<C-V>3f0x"
+:let line1=ScreenChar(line('.'),20)
+:call DoRecordScreen()
+:quit!
+:"
 :%w! test.out
 :qa!
 ENDTEST
diff --git a/src/testdir/test_breakindent.ok b/src/testdir/test_breakindent.ok
index e50265ecdd..3eb9c24fd9 100644
--- a/src/testdir/test_breakindent.ok
+++ b/src/testdir/test_breakindent.ok
@@ -62,3 +62,13 @@ strdisplaywidth: 46 == calculated: 64
 Test 13: breakindent with wrapping Tab
 d
 w
+
+Test 14: breakindent + visual blockwise delete #1
+e       
+~       
+~       
+
+Test 15: breakindent + visual blockwise delete #2
+        1234567890  
+~                   
+~                   
diff --git a/src/version.c b/src/version.c
index 6a40cfa32c..9ae697e4a1 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    594,
 /**/
     593,
 /**/

From 48bbdcff6838313acd8076d09d262978249c58cb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:22:20 +0100
Subject: [PATCH 445/473] Added tag v7-4-594 for changeset f9d02ce2f745

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index caa8184373..3820d6e62a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3316,3 +3316,4 @@ a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 7b8e3be930f39af3cdc1fe969a6de16f2d91e5d2 v7-4-591
 005a6b65086666ed56531e4c8a531a3ee0cea638 v7-4-592
 bdc8e71633e45ebe5f1b59e4328fcf22a5866cb7 v7-4-593
+f9d02ce2f745f75003ff570b2a596c755ccc86ba v7-4-594

From 1e52f2693fb92ef7cf87bde47f0c7cd0ae68565c Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:28:46 +0100
Subject: [PATCH 446/473] updated for version 7.4.595 Problem:    The
 test_command_count test fails when using Japanese. Solution:   Force the
 language to C. (Hirohito Higashi)

---
 src/testdir/test_command_count.in | 1 +
 src/version.c                     | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/testdir/test_command_count.in b/src/testdir/test_command_count.in
index c87b4c909a..a86931f433 100644
--- a/src/testdir/test_command_count.in
+++ b/src/testdir/test_command_count.in
@@ -2,6 +2,7 @@ Test for user command counts	    vim: set ft=vim :
 
 STARTTEST
 :so small.vim
+:lang C
 :let g:lines = []
 :com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>)
 :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>)
diff --git a/src/version.c b/src/version.c
index 9ae697e4a1..fcccaba7f6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    595,
 /**/
     594,
 /**/

From c3f284204b5d60b112b4b11b098005557ee3e08b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:28:47 +0100
Subject: [PATCH 447/473] Added tag v7-4-595 for changeset d83436d11987

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3820d6e62a..bbaff85eec 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3317,3 +3317,4 @@ a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 005a6b65086666ed56531e4c8a531a3ee0cea638 v7-4-592
 bdc8e71633e45ebe5f1b59e4328fcf22a5866cb7 v7-4-593
 f9d02ce2f745f75003ff570b2a596c755ccc86ba v7-4-594
+d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595

From 87012fdfaf455c38c86d864dadc3131f618be75b Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:33:23 +0100
Subject: [PATCH 448/473] updated for version 7.4.596 Problem:    Tiny build
 doesn't compile.  (Ike Devolder) Solution:   Add #ifdef.

---
 src/ex_cmds.c | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e18a752cb0..897e6c39ac 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3530,11 +3530,13 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
 		check_fname() == FAIL)
 	    goto theend;
 
+#ifdef FEAT_QUICKFIX
 	/* ":e foobar" when already editing "foobar" will reload the file.
 	 * But when 'buftype' is "nofile" there is no file to load, so don't
 	 * do anything. */
 	if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f')
 	    goto theend;
+#endif
 
 	oldbuf = (flags & ECMD_OLDBUF);
     }
diff --git a/src/version.c b/src/version.c
index fcccaba7f6..5cb09f8855 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    596,
 /**/
     595,
 /**/

From 549080712cd739422e9871f179089b276bebce18 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:33:23 +0100
Subject: [PATCH 449/473] Added tag v7-4-596 for changeset 6da912e32896

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index bbaff85eec..47ac89c988 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3318,3 +3318,4 @@ a03e143b93587cf29c91121acdf66f6e5dc6e470 v7-4-588
 bdc8e71633e45ebe5f1b59e4328fcf22a5866cb7 v7-4-593
 f9d02ce2f745f75003ff570b2a596c755ccc86ba v7-4-594
 d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595
+6da912e32896c57227a0f297aa1d3312a653cf0a v7-4-596

From 80e5b2c8e3c398aa99032e1908edf3f4de2afc1f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:49:31 +0100
Subject: [PATCH 450/473] updated for version 7.4.597 Problem:    Cannot change
 the result of systemlist(). Solution:   Initialize v_lock. (Yukihiro
 Nakadaira)

---
 src/eval.c    | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/eval.c b/src/eval.c
index e6175f6ba9..242a1f81ec 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6007,6 +6007,7 @@ list_free(l, recurse)
 
 /*
  * Allocate a list item.
+ * It is not initialized, don't forget to set v_lock.
  */
     listitem_T *
 listitem_alloc()
@@ -18713,6 +18714,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
 		goto errret;
 	    }
 	    li->li_tv.v_type = VAR_STRING;
+	    li->li_tv.v_lock = 0;
 	    li->li_tv.vval.v_string = s;
 	    list_append(list, li);
 	}
diff --git a/src/version.c b/src/version.c
index 5cb09f8855..f0107fabf4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    597,
 /**/
     596,
 /**/

From ad3d96df46783eed345d1f3e22c59e0b010d46a5 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 13:49:31 +0100
Subject: [PATCH 451/473] Added tag v7-4-597 for changeset c124a8f34ed1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 47ac89c988..a9bf79cbd5 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3319,3 +3319,4 @@ bdc8e71633e45ebe5f1b59e4328fcf22a5866cb7 v7-4-593
 f9d02ce2f745f75003ff570b2a596c755ccc86ba v7-4-594
 d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595
 6da912e32896c57227a0f297aa1d3312a653cf0a v7-4-596
+c124a8f34ed1cf510d384b384db6f34be5d61a3e v7-4-597

From 187aa63a0a17fefb9fa2a65267c6421d79434939 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:09:37 +0100
Subject: [PATCH 452/473] updated for version 7.4.598 Problem:    ":tabdo windo
 echo 'hi'" causes "* register not to be changed. 	    (Salman Halim)
 Solution:   Change how clip_did_set_selection is used and add 	   
 clipboard_needs_update and global_change_count.  (Christian 	    Brabandt)

---
 src/main.c               |   9 --------
 src/testdir/test_eval.in |  17 +++++++++++++---
 src/testdir/test_eval.ok | Bin 11010 -> 11538 bytes
 src/ui.c                 |  43 ++++++++++++++++++++++++++-------------
 src/version.c            |   2 ++
 5 files changed, 45 insertions(+), 26 deletions(-)

diff --git a/src/main.c b/src/main.c
index 1814385197..ec83d8f149 100644
--- a/src/main.c
+++ b/src/main.c
@@ -959,17 +959,8 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
     if (p_im)
 	need_start_insertmode = TRUE;
 
-#ifdef FEAT_CLIPBOARD
-    if (clip_unnamed)
-       /* do not overwrite system clipboard while starting up */
-       clip_did_set_selection = -1;
-#endif
 #ifdef FEAT_AUTOCMD
     apply_autocmds(EVENT_VIMENTER, NULL, NULL, FALSE, curbuf);
-# ifdef FEAT_CLIPBOARD
-    if (clip_did_set_selection < 0)
-       clip_did_set_selection = TRUE;
-# endif
     TIME_MSG("VimEnter autocommands");
 #endif
 
diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in
index cd605af56e..b9f68f75c7 100644
--- a/src/testdir/test_eval.in
+++ b/src/testdir/test_eval.in
@@ -1,7 +1,6 @@
 Test for various eval features.   vim: set ft=vim :
 
-Note: system clipboard support is not tested. I do not think anybody will thank 
-me for messing with clipboard.
+Note: system clipboard is saved, changed and restored.
 
 STARTTEST
 :so small.vim
@@ -122,7 +121,19 @@ call SetReg('/', ['abc/'])
 call SetReg('/', ["abc/\n"])
 call SetReg('=', ['"abc/"'])
 call SetReg('=', ["\"abc/\n\""])
-
+$put ='{{{1 System clipboard'
+" Save and restore system clipboard.
+" If no connection to X-Server is possible, test should succeed.
+:let _clipreg = ['+', getreg('+'), getregtype('+')]
+:let _clipopt = &cb
+:let &cb='unnamedplus'
+:1y
+:AR +
+:tabdo :windo :echo "hi"
+:3y
+:AR +
+:let &cb=_clipopt
+:call call('setreg', _clipreg)
 $put ='{{{1 Errors'
 call ErrExe('call setreg()')
 call ErrExe('call setreg(1)')
diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok
index 59112d028e72a937287ae2d2b7e60a0a03bd4493..5e8d2cc4f6f0caa2b4386ceec8b3addb70c419a2 100644
GIT binary patch
delta 536
zcmZn)n-sM{Rjod_vbZEQS0Onkvmhxyu_%R0+e)FNvLIC<%vzx=F{d=uN+Be*xI`f>
zzX-@L%FHh<R!9X(D5Rw(mXsEy7V9Y}D3oR9S}7E#0#%jR0@(^y3<?_2>cr@)N7JYt
ztEr=qT2W9$TWjIA)<fJ2v=)oU{qjqI-Y-TAA%)Chh2q4r)D#_s<c!3;^wboE#Jm&*
pU{I9g7p11?f&EUb)_PRENZu#b1XKe^vK*+D8_D6DWz?Rr004&0xIzE`

delta 12
TcmbOf)fBctRc*7W#$6TwAj|}@

diff --git a/src/ui.c b/src/ui.c
index 59794829d8..a2d83458d5 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -73,6 +73,8 @@ ui_write(s, len)
 static char_u *ta_str = NULL;
 static int ta_off;	/* offset for next char to use when ta_str != NULL */
 static int ta_len;	/* length of ta_str when it's not NULL*/
+static int clipboard_needs_update; /* clipboard needs to be updated */
+static int global_change_count = 0; /* if set, inside a start_global_changes */
 
     void
 ui_inchar_undo(s, len)
@@ -569,9 +571,12 @@ clip_copy_selection(clip)
     void
 start_global_changes()
 {
+    if (++global_change_count > 1)
+	return;
     clip_unnamed_saved = clip_unnamed;
+    clipboard_needs_update = FALSE;
 
-    if (clip_did_set_selection > 0)
+    if (clip_did_set_selection)
     {
 	clip_unnamed = FALSE;
 	clip_did_set_selection = FALSE;
@@ -584,22 +589,30 @@ start_global_changes()
     void
 end_global_changes()
 {
-    if (clip_did_set_selection == FALSE)  /* not when -1 */
+    if (--global_change_count > 0)
+	/* recursive */
+	return;
+    if (!clip_did_set_selection)
     {
 	clip_did_set_selection = TRUE;
 	clip_unnamed = clip_unnamed_saved;
-	if (clip_unnamed & CLIP_UNNAMED)
+	clip_unnamed_saved = FALSE;
+	if (clipboard_needs_update)
 	{
-	    clip_own_selection(&clip_star);
-	    clip_gen_set_selection(&clip_star);
-	}
-	if (clip_unnamed & CLIP_UNNAMED_PLUS)
-	{
-	    clip_own_selection(&clip_plus);
-	    clip_gen_set_selection(&clip_plus);
+	    /* only store something in the clipboard,
+	     * if we have yanked anything to it */
+	    if (clip_unnamed & CLIP_UNNAMED)
+	    {
+		clip_own_selection(&clip_star);
+		clip_gen_set_selection(&clip_star);
+	    }
+	    if (clip_unnamed & CLIP_UNNAMED_PLUS)
+	    {
+		clip_own_selection(&clip_plus);
+		clip_gen_set_selection(&clip_plus);
+	    }
 	}
     }
-    clip_unnamed_saved = FALSE;
 }
 
 /*
@@ -1477,10 +1490,12 @@ clip_gen_set_selection(cbd)
     {
 	/* Updating postponed, so that accessing the system clipboard won't
 	 * hang Vim when accessing it many times (e.g. on a :g comand). */
-	if (cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
-	    return;
-	else if (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED))
+	if ((cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS))
+		|| (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED)))
+	{
+	    clipboard_needs_update = TRUE;
 	    return;
+	}
     }
 #ifdef FEAT_XCLIPBOARD
 # ifdef FEAT_GUI
diff --git a/src/version.c b/src/version.c
index f0107fabf4..35a716058e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    598,
 /**/
     597,
 /**/

From 7f9b98e0f06243e58b311cb0647b33b2d3c9c289 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:09:37 +0100
Subject: [PATCH 453/473] Added tag v7-4-598 for changeset b01ca71f93b2

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index a9bf79cbd5..6facaa072c 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3320,3 +3320,4 @@ f9d02ce2f745f75003ff570b2a596c755ccc86ba v7-4-594
 d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595
 6da912e32896c57227a0f297aa1d3312a653cf0a v7-4-596
 c124a8f34ed1cf510d384b384db6f34be5d61a3e v7-4-597
+b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598

From 3dc24e39dd1d0e11ef58ed3f644449f94b343175 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:40:00 +0100
Subject: [PATCH 454/473] updated for version 7.4.599 Problem:    Out-of-memory
 error. Solution:   Avoid trying to allocate a negative amount of memory, use
 size_t 	    instead of int. (Dominique Pelle)

---
 src/regexp_nfa.c | 2 +-
 src/version.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 2bd75af202..3d125f092e 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -5408,7 +5408,7 @@ nfa_regmatch(prog, start, submatch, m)
     regsubs_T		*m;
 {
     int		result;
-    int		size = 0;
+    size_t	size = 0;
     int		flag = 0;
     int		go_to_nextline = FALSE;
     nfa_thread_T *t;
diff --git a/src/version.c b/src/version.c
index 35a716058e..7f84aec662 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    599,
 /**/
     598,
 /**/

From f352bddc6caa6ca00a00b40cbdacfa947e65e1a6 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:40:00 +0100
Subject: [PATCH 455/473] Added tag v7-4-599 for changeset 1ef8ce97fc40

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 6facaa072c..efdf150bc4 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3321,3 +3321,4 @@ d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595
 6da912e32896c57227a0f297aa1d3312a653cf0a v7-4-596
 c124a8f34ed1cf510d384b384db6f34be5d61a3e v7-4-597
 b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
+1ef8ce97fc40b59d7218d7300685d40df63a407c v7-4-599

From 33c25f51b894a946909da967c1e418366adf3be8 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:54:11 +0100
Subject: [PATCH 456/473] updated for version 7.4.600 Problem:    Memory wasted
 in struct because of aligning. Solution:   Split pos in lnum and col.
 (Dominique Pelle)

---
 src/regexp_nfa.c | 131 ++++++++++++++++++++++++++---------------------
 src/version.c    |   2 +
 2 files changed, 76 insertions(+), 57 deletions(-)

diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 3d125f092e..d64e5ae6b1 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -1456,7 +1456,7 @@ nfa_regatom()
 			 * matched an unlimited number of times. NFA_NOPEN is
 			 * added only once at a position, while NFA_SPLIT is
 			 * added multiple times.  This is more efficient than
-			 * not allowsing NFA_SPLIT multiple times, it is used
+			 * not allowing NFA_SPLIT multiple times, it is used
 			 * a lot. */
 			EMIT(NFA_NOPEN);
 			break;
@@ -3726,8 +3726,10 @@ typedef struct
     {
 	struct multipos
 	{
-	    lpos_T	start;
-	    lpos_T	end;
+	    linenr_T	start_lnum;
+	    linenr_T	end_lnum;
+	    colnr_T	start_col;
+	    colnr_T	end_col;
 	} multi[NSUBEXP];
 	struct linepos
 	{
@@ -3812,10 +3814,10 @@ log_subexpr(sub)
 	if (REG_MULTI)
 	    fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n",
 		    j,
-		    sub->list.multi[j].start.col,
-		    (int)sub->list.multi[j].start.lnum,
-		    sub->list.multi[j].end.col,
-		    (int)sub->list.multi[j].end.lnum);
+		    sub->list.multi[j].start_col,
+		    (int)sub->list.multi[j].start_lnum,
+		    sub->list.multi[j].end_col,
+		    (int)sub->list.multi[j].end_lnum);
 	else
 	{
 	    char *s = (char *)sub->list.line[j].start;
@@ -3952,8 +3954,11 @@ copy_ze_off(to, from)
     {
 	if (REG_MULTI)
 	{
-	    if (from->list.multi[0].end.lnum >= 0)
-		to->list.multi[0].end = from->list.multi[0].end;
+	    if (from->list.multi[0].end_lnum >= 0)
+            {
+		to->list.multi[0].end_lnum = from->list.multi[0].end_lnum;
+		to->list.multi[0].end_col = from->list.multi[0].end_col;
+            }
 	}
 	else
 	{
@@ -3985,33 +3990,33 @@ sub_equal(sub1, sub2)
 	for (i = 0; i < todo; ++i)
 	{
 	    if (i < sub1->in_use)
-		s1 = sub1->list.multi[i].start.lnum;
+		s1 = sub1->list.multi[i].start_lnum;
 	    else
 		s1 = -1;
 	    if (i < sub2->in_use)
-		s2 = sub2->list.multi[i].start.lnum;
+		s2 = sub2->list.multi[i].start_lnum;
 	    else
 		s2 = -1;
 	    if (s1 != s2)
 		return FALSE;
-	    if (s1 != -1 && sub1->list.multi[i].start.col
-					     != sub2->list.multi[i].start.col)
+	    if (s1 != -1 && sub1->list.multi[i].start_col
+					     != sub2->list.multi[i].start_col)
 		return FALSE;
 
 	    if (nfa_has_backref)
 	    {
 		if (i < sub1->in_use)
-		    s1 = sub1->list.multi[i].end.lnum;
+		    s1 = sub1->list.multi[i].end_lnum;
 		else
 		    s1 = -1;
 		if (i < sub2->in_use)
-		    s2 = sub2->list.multi[i].end.lnum;
+		    s2 = sub2->list.multi[i].end_lnum;
 		else
 		    s2 = -1;
 		if (s1 != s2)
 		    return FALSE;
-		if (s1 != -1 && sub1->list.multi[i].end.col
-					       != sub2->list.multi[i].end.col)
+		if (s1 != -1 && sub1->list.multi[i].end_col
+					       != sub2->list.multi[i].end_col)
 		return FALSE;
 	    }
 	}
@@ -4062,7 +4067,7 @@ report_state(char *action,
     if (sub->in_use <= 0)
 	col = -1;
     else if (REG_MULTI)
-	col = sub->list.multi[0].start.col;
+	col = sub->list.multi[0].start_col;
     else
 	col = (int)(sub->list.line[0].start - regline);
     nfa_set_code(state->c);
@@ -4482,7 +4487,8 @@ addstate(l, state, subs_arg, pim, off)
 	    {
 		if (subidx < sub->in_use)
 		{
-		    save_lpos = sub->list.multi[subidx].start;
+		    save_lpos.lnum = sub->list.multi[subidx].start_lnum;
+		    save_lpos.col = sub->list.multi[subidx].start_col;
 		    save_in_use = -1;
 		}
 		else
@@ -4490,20 +4496,20 @@ addstate(l, state, subs_arg, pim, off)
 		    save_in_use = sub->in_use;
 		    for (i = sub->in_use; i < subidx; ++i)
 		    {
-			sub->list.multi[i].start.lnum = -1;
-			sub->list.multi[i].end.lnum = -1;
+			sub->list.multi[i].start_lnum = -1;
+			sub->list.multi[i].end_lnum = -1;
 		    }
 		    sub->in_use = subidx + 1;
 		}
 		if (off == -1)
 		{
-		    sub->list.multi[subidx].start.lnum = reglnum + 1;
-		    sub->list.multi[subidx].start.col = 0;
+		    sub->list.multi[subidx].start_lnum = reglnum + 1;
+		    sub->list.multi[subidx].start_col = 0;
 		}
 		else
 		{
-		    sub->list.multi[subidx].start.lnum = reglnum;
-		    sub->list.multi[subidx].start.col =
+		    sub->list.multi[subidx].start_lnum = reglnum;
+		    sub->list.multi[subidx].start_col =
 					  (colnr_T)(reginput - regline + off);
 		}
 	    }
@@ -4539,7 +4545,10 @@ addstate(l, state, subs_arg, pim, off)
 	    if (save_in_use == -1)
 	    {
 		if (REG_MULTI)
-		    sub->list.multi[subidx].start = save_lpos;
+                {
+		    sub->list.multi[subidx].start_lnum = save_lpos.lnum;
+		    sub->list.multi[subidx].start_col = save_lpos.col;
+                }
 		else
 		    sub->list.line[subidx].start = save_ptr;
 	    }
@@ -4549,7 +4558,7 @@ addstate(l, state, subs_arg, pim, off)
 
 	case NFA_MCLOSE:
 	    if (nfa_has_zend && (REG_MULTI
-			? subs->norm.list.multi[0].end.lnum >= 0
+			? subs->norm.list.multi[0].end_lnum >= 0
 			: subs->norm.list.line[0].end != NULL))
 	    {
 		/* Do not overwrite the position set by \ze. */
@@ -4603,16 +4612,17 @@ addstate(l, state, subs_arg, pim, off)
 		sub->in_use = subidx + 1;
 	    if (REG_MULTI)
 	    {
-		save_lpos = sub->list.multi[subidx].end;
+		save_lpos.lnum = sub->list.multi[subidx].end_lnum;
+		save_lpos.col = sub->list.multi[subidx].end_col;
 		if (off == -1)
 		{
-		    sub->list.multi[subidx].end.lnum = reglnum + 1;
-		    sub->list.multi[subidx].end.col = 0;
+		    sub->list.multi[subidx].end_lnum = reglnum + 1;
+		    sub->list.multi[subidx].end_col = 0;
 		}
 		else
 		{
-		    sub->list.multi[subidx].end.lnum = reglnum;
-		    sub->list.multi[subidx].end.col =
+		    sub->list.multi[subidx].end_lnum = reglnum;
+		    sub->list.multi[subidx].end_col =
 					  (colnr_T)(reginput - regline + off);
 		}
 		/* avoid compiler warnings */
@@ -4637,7 +4647,10 @@ addstate(l, state, subs_arg, pim, off)
 		sub = &subs->norm;
 
 	    if (REG_MULTI)
-		sub->list.multi[subidx].end = save_lpos;
+            {
+		sub->list.multi[subidx].end_lnum = save_lpos.lnum;
+		sub->list.multi[subidx].end_col = save_lpos.col;
+            }
 	    else
 		sub->list.line[subidx].end = save_ptr;
 	    sub->in_use = save_in_use;
@@ -4825,15 +4838,15 @@ match_backref(sub, subidx, bytelen)
 
     if (REG_MULTI)
     {
-	if (sub->list.multi[subidx].start.lnum < 0
-				       || sub->list.multi[subidx].end.lnum < 0)
+	if (sub->list.multi[subidx].start_lnum < 0
+				       || sub->list.multi[subidx].end_lnum < 0)
 	    goto retempty;
-	if (sub->list.multi[subidx].start.lnum == reglnum
-			       && sub->list.multi[subidx].end.lnum == reglnum)
+	if (sub->list.multi[subidx].start_lnum == reglnum
+			       && sub->list.multi[subidx].end_lnum == reglnum)
 	{
-	    len = sub->list.multi[subidx].end.col
-					  - sub->list.multi[subidx].start.col;
-	    if (cstrncmp(regline + sub->list.multi[subidx].start.col,
+	    len = sub->list.multi[subidx].end_col
+					  - sub->list.multi[subidx].start_col;
+	    if (cstrncmp(regline + sub->list.multi[subidx].start_col,
 							 reginput, &len) == 0)
 	    {
 		*bytelen = len;
@@ -4843,10 +4856,10 @@ match_backref(sub, subidx, bytelen)
 	else
 	{
 	    if (match_with_backref(
-			sub->list.multi[subidx].start.lnum,
-			sub->list.multi[subidx].start.col,
-			sub->list.multi[subidx].end.lnum,
-			sub->list.multi[subidx].end.col,
+			sub->list.multi[subidx].start_lnum,
+			sub->list.multi[subidx].start_col,
+			sub->list.multi[subidx].end_lnum,
+			sub->list.multi[subidx].end_col,
 			bytelen) == RA_MATCH)
 		return TRUE;
 	}
@@ -5441,6 +5454,7 @@ nfa_regmatch(prog, start, submatch, m)
 
     /* Allocate memory for the lists of nodes. */
     size = (nstate + 1) * sizeof(nfa_thread_T);
+
     list[0].t = (nfa_thread_T *)lalloc(size, TRUE);
     list[0].len = nstate + 1;
     list[1].t = (nfa_thread_T *)lalloc(size, TRUE);
@@ -5482,8 +5496,8 @@ nfa_regmatch(prog, start, submatch, m)
     {
 	if (REG_MULTI)
 	{
-	    m->norm.list.multi[0].start.lnum = reglnum;
-	    m->norm.list.multi[0].start.col = (colnr_T)(reginput - regline);
+	    m->norm.list.multi[0].start_lnum = reglnum;
+	    m->norm.list.multi[0].start_col = (colnr_T)(reginput - regline);
 	}
 	else
 	    m->norm.list.line[0].start = reginput;
@@ -5580,7 +5594,7 @@ nfa_regmatch(prog, start, submatch, m)
 		if (t->subs.norm.in_use <= 0)
 		    col = -1;
 		else if (REG_MULTI)
-		    col = t->subs.norm.list.multi[0].start.col;
+		    col = t->subs.norm.list.multi[0].start_col;
 		else
 		    col = (int)(t->subs.norm.list.line[0].start - regline);
 		nfa_set_code(t->state->c);
@@ -5861,7 +5875,7 @@ nfa_regmatch(prog, start, submatch, m)
 		     * continue with what follows. */
 		    if (REG_MULTI)
 			/* TODO: multi-line match */
-			bytelen = m->norm.list.multi[0].end.col
+			bytelen = m->norm.list.multi[0].end_col
 						  - (int)(reginput - regline);
 		    else
 			bytelen = (int)(m->norm.list.line[0].end - reginput);
@@ -6741,7 +6755,7 @@ nfa_regmatch(prog, start, submatch, m)
 		if (add)
 		{
 		    if (REG_MULTI)
-			m->norm.list.multi[0].start.col =
+			m->norm.list.multi[0].start_col =
 					 (colnr_T)(reginput - regline) + clen;
 		    else
 			m->norm.list.line[0].start = reginput + clen;
@@ -6854,8 +6868,11 @@ nfa_regtry(prog, col)
     {
 	for (i = 0; i < subs.norm.in_use; i++)
 	{
-	    reg_startpos[i] = subs.norm.list.multi[i].start;
-	    reg_endpos[i] = subs.norm.list.multi[i].end;
+	    reg_startpos[i].lnum = subs.norm.list.multi[i].start_lnum;
+	    reg_startpos[i].col = subs.norm.list.multi[i].start_col;
+
+	    reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
+	    reg_endpos[i].col = subs.norm.list.multi[i].end_col;
 	}
 
 	if (reg_startpos[0].lnum < 0)
@@ -6903,13 +6920,13 @@ nfa_regtry(prog, col)
 		struct multipos *mpos = &subs.synt.list.multi[i];
 
 		/* Only accept single line matches that are valid. */
-		if (mpos->start.lnum >= 0
-			&& mpos->start.lnum == mpos->end.lnum
-			&& mpos->end.col >= mpos->start.col)
+		if (mpos->start_lnum >= 0
+			&& mpos->start_lnum == mpos->end_lnum
+			&& mpos->end_col >= mpos->start_col)
 		    re_extmatch_out->matches[i] =
-			vim_strnsave(reg_getline(mpos->start.lnum)
-							    + mpos->start.col,
-					     mpos->end.col - mpos->start.col);
+			vim_strnsave(reg_getline(mpos->start_lnum)
+							    + mpos->start_col,
+					     mpos->end_col - mpos->start_col);
 	    }
 	    else
 	    {
diff --git a/src/version.c b/src/version.c
index 7f84aec662..6b98aca693 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    600,
 /**/
     599,
 /**/

From db17dd64ef1ad673d5e161a7d0937bc8c7c5380a Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 14:54:11 +0100
Subject: [PATCH 457/473] Added tag v7-4-600 for changeset 436d6c9e57f2

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index efdf150bc4..7e169c2320 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3322,3 +3322,4 @@ d83436d119871584ddb012ecf0aa4d01030f65ee v7-4-595
 c124a8f34ed1cf510d384b384db6f34be5d61a3e v7-4-597
 b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 1ef8ce97fc40b59d7218d7300685d40df63a407c v7-4-599
+436d6c9e57f2f6def73e86891cbf72a0328aa9bd v7-4-600

From 77c669628c241a77b876dd78d4b03b9eecb34d43 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 15:19:24 +0100
Subject: [PATCH 458/473] updated for version 7.4.601 Problem:    It is not
 possible to have feedkeys() insert characters. Solution:   Add the 'i' flag.

---
 runtime/doc/eval.txt | 12 ++++++++----
 src/eval.c           |  4 +++-
 src/version.c        |  2 ++
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index b778e34578..0fb315121f 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 7.4.  Last change: 2014 Dec 07
+*eval.txt*	For Vim version 7.4.  Last change: 2015 Jan 27
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -2965,9 +2965,12 @@ extend({expr1}, {expr2} [, {expr3}])			*extend()*
 
 feedkeys({string} [, {mode}])				*feedkeys()*
 		Characters in {string} are queued for processing as if they
-		come from a mapping or were typed by the user.	They are added
-		to the end of the typeahead buffer, thus if a mapping is still
-		being executed these characters come after them.
+		come from a mapping or were typed by the user.
+		By default the string is added to the end of the typeahead
+		buffer, thus if a mapping is still being executed the
+		characters come after them.  Use the 'i' flag to insert before
+		other characters, they will be executed next, before any
+		characters from a mapping.
 		The function does not wait for processing of keys contained in
 		{string}.
 		To include special keys into {string}, use double-quotes
@@ -2981,6 +2984,7 @@ feedkeys({string} [, {mode}])				*feedkeys()*
 		't'	Handle keys as if typed; otherwise they are handled as
 			if coming from a mapping.  This matters for undo,
 			opening folds, etc.
+		'i'	Insert the string instead of appending (see above).
 		Return value is always 0.
 
 filereadable({file})					*filereadable()*
diff --git a/src/eval.c b/src/eval.c
index 242a1f81ec..c9c179a051 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -10500,6 +10500,7 @@ f_feedkeys(argvars, rettv)
     typval_T    *rettv UNUSED;
 {
     int		remap = TRUE;
+    int		insert = FALSE;
     char_u	*keys, *flags;
     char_u	nbuf[NUMBUFLEN];
     int		typed = FALSE;
@@ -10524,6 +10525,7 @@ f_feedkeys(argvars, rettv)
 		    case 'n': remap = FALSE; break;
 		    case 'm': remap = TRUE; break;
 		    case 't': typed = TRUE; break;
+		    case 'i': insert = TRUE; break;
 		}
 	    }
 	}
@@ -10534,7 +10536,7 @@ f_feedkeys(argvars, rettv)
 	if (keys_esc != NULL)
 	{
 	    ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
-					       typebuf.tb_len, !typed, FALSE);
+				  insert ? 0 : typebuf.tb_len, !typed, FALSE);
 	    vim_free(keys_esc);
 	    if (vgetc_busy)
 		typebuf_was_filled = TRUE;
diff --git a/src/version.c b/src/version.c
index 6b98aca693..20291a789e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    601,
 /**/
     600,
 /**/

From 4593a82f8f9e3a17ef6f444802fe830ab72fa3f1 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 15:19:24 +0100
Subject: [PATCH 459/473] Added tag v7-4-601 for changeset 2561531decf1

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 7e169c2320..95e987f26a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3323,3 +3323,4 @@ c124a8f34ed1cf510d384b384db6f34be5d61a3e v7-4-597
 b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 1ef8ce97fc40b59d7218d7300685d40df63a407c v7-4-599
 436d6c9e57f2f6def73e86891cbf72a0328aa9bd v7-4-600
+2561531decf15c1a02f62a1b96ff778e12a5dcbc v7-4-601

From 5fe43ce636d4bfee8540d86c5df2d9706c900e98 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 15:58:40 +0100
Subject: [PATCH 460/473] updated for version 7.4.602 Problem:    ":set" does
 not accept hex numbers as documented. Solution:   Use vim_str2nr(). (ZyX)

---
 runtime/doc/options.txt |  4 +---
 src/option.c            | 16 +++-------------
 src/version.c           |  2 ++
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index d62bb4e8e1..918e1b7e4d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -59,9 +59,7 @@ achieve special effects.  These options come in three forms:
 :se[t] {option}:{value}
 			Set string or number option to {value}.
 			For numeric options the value can be given in decimal,
-			hex (preceded with 0x) or octal (preceded with '0')
-			(hex and octal are only available for machines which
-			have the strtol() function).
+ 			hex (preceded with 0x) or octal (preceded with '0').
 			The old value can be inserted by typing 'wildchar' (by
 			default this is a <Tab> or CTRL-E if 'compatible' is
 			set).  See |cmdline-completion|.
diff --git a/src/option.c b/src/option.c
index 3195fa8d90..e5887366b3 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4540,21 +4540,11 @@ do_set(arg, opt_flags)
 				goto skip;
 			    }
 			}
-				/* allow negative numbers (for 'undolevels') */
 			else if (*arg == '-' || VIM_ISDIGIT(*arg))
 			{
-			    i = 0;
-			    if (*arg == '-')
-				i = 1;
-#ifdef HAVE_STRTOL
-			    value = strtol((char *)arg, NULL, 0);
-			    if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
-				i += 2;
-#else
-			    value = atol((char *)arg);
-#endif
-			    while (VIM_ISDIGIT(arg[i]))
-				++i;
+			    /* Allow negative (for 'undolevels'), octal and
+			     * hex numbers. */
+			    vim_str2nr(arg, NULL, &i, TRUE, TRUE, &value, NULL);
 			    if (arg[i] != NUL && !vim_iswhite(arg[i]))
 			    {
 				errmsg = e_invarg;
diff --git a/src/version.c b/src/version.c
index 20291a789e..2b4b680fba 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    602,
 /**/
     601,
 /**/

From 90d3983b57a2b81964280269be03cc18e39bee71 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 15:58:40 +0100
Subject: [PATCH 461/473] Added tag v7-4-602 for changeset 4e31d9f7c896

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 95e987f26a..24e8ee3932 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3324,3 +3324,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 1ef8ce97fc40b59d7218d7300685d40df63a407c v7-4-599
 436d6c9e57f2f6def73e86891cbf72a0328aa9bd v7-4-600
 2561531decf15c1a02f62a1b96ff778e12a5dcbc v7-4-601
+4e31d9f7c896a346b2346fc4ff005b8b255172c9 v7-4-602

From ca1edc128c1c490eb5b65168cb8fe00c671db7fd Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 16:39:29 +0100
Subject: [PATCH 462/473] updated for version 7.4.603 Problem:    'foldcolumn'
 may be set such that it fills the whole window, not 	    leaving space for
 text. Solution:   Reduce the foldcolumn width when there is not sufficient
 room. 	    (idea by Christian Brabandt)

---
 src/screen.c  | 52 +++++++++++++++++++++++++++++++++++++--------------
 src/version.c |  2 ++
 2 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 698f969687..2ebd98beea 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -109,6 +109,7 @@ static match_T search_hl;	/* used for 'hlsearch' highlight matching */
 
 #ifdef FEAT_FOLDING
 static foldinfo_T win_foldinfo;	/* info for 'foldcolumn' */
+static int compute_foldcolumn __ARGS((win_T *wp, int col));
 #endif
 
 /*
@@ -1202,7 +1203,7 @@ win_update(wp)
 			lnumb = wp->w_lines[i].wl_lnum;
 			/* When there is a fold column it might need updating
 			 * in the next line ("J" just above an open fold). */
-			if (wp->w_p_fdc > 0)
+			if (compute_foldcolumn(wp, 0) > 0)
 			    ++lnumb;
 		    }
 		}
@@ -2238,13 +2239,16 @@ win_draw_end(wp, c1, c2, row, endrow, hl)
 #else
 # define FDC_OFF 0
 #endif
+#ifdef FEAT_FOLDING
+    int		fdc = compute_foldcolumn(wp, 0);
+#endif
 
 #ifdef FEAT_RIGHTLEFT
     if (wp->w_p_rl)
     {
 	/* No check for cmdline window: should never be right-left. */
 # ifdef FEAT_FOLDING
-	n = wp->w_p_fdc;
+	n = fdc;
 
 	if (n > 0)
 	{
@@ -2293,9 +2297,9 @@ win_draw_end(wp, c1, c2, row, endrow, hl)
 	}
 #endif
 #ifdef FEAT_FOLDING
-	if (wp->w_p_fdc > 0)
+	if (fdc > 0)
 	{
-	    int	    nn = n + wp->w_p_fdc;
+	    int	    nn = n + fdc;
 
 	    /* draw the fold column at the left */
 	    if (nn > W_WIDTH(wp))
@@ -2345,6 +2349,24 @@ advance_color_col(vcol, color_cols)
 #endif
 
 #ifdef FEAT_FOLDING
+/*
+ * Compute the width of the foldcolumn.  Based on 'foldcolumn' and how much
+ * space is available for window "wp", minus "col".
+ */
+    static int
+compute_foldcolumn(wp, col)
+    win_T *wp;
+    int   col;
+{
+    int fdc = wp->w_p_fdc;
+    int wmw = wp == curwin && p_wmw == 0 ? 1 : p_wmw;
+    int wwidth = W_WIDTH(wp);
+
+    if (fdc > wwidth - (col + wmw))
+	fdc = wwidth - (col + wmw);
+    return fdc;
+}
+
 /*
  * Display one folded line.
  */
@@ -2396,10 +2418,9 @@ fold_line(wp, fold_count, foldinfo, lnum, row)
 
     /*
      * 2. Add the 'foldcolumn'
+     *    Reduce the width when there is not enough space.
      */
-    fdc = wp->w_p_fdc;
-    if (fdc > W_WIDTH(wp) - col)
-	fdc = W_WIDTH(wp) - col;
+    fdc = compute_foldcolumn(wp, col);
     if (fdc > 0)
     {
 	fill_foldcolumn(buf, wp, TRUE, lnum);
@@ -2787,23 +2808,24 @@ fill_foldcolumn(p, wp, closed, lnum)
     int		level;
     int		first_level;
     int		empty;
+    int		fdc = compute_foldcolumn(wp, 0);
 
     /* Init to all spaces. */
-    copy_spaces(p, (size_t)wp->w_p_fdc);
+    copy_spaces(p, (size_t)fdc);
 
     level = win_foldinfo.fi_level;
     if (level > 0)
     {
 	/* If there is only one column put more info in it. */
-	empty = (wp->w_p_fdc == 1) ? 0 : 1;
+	empty = (fdc == 1) ? 0 : 1;
 
 	/* If the column is too narrow, we start at the lowest level that
 	 * fits and use numbers to indicated the depth. */
-	first_level = level - wp->w_p_fdc - closed + 1 + empty;
+	first_level = level - fdc - closed + 1 + empty;
 	if (first_level < 1)
 	    first_level = 1;
 
-	for (i = 0; i + empty < wp->w_p_fdc; ++i)
+	for (i = 0; i + empty < fdc; ++i)
 	{
 	    if (win_foldinfo.fi_lnum == lnum
 			      && first_level + i >= win_foldinfo.fi_low_level)
@@ -2819,7 +2841,7 @@ fill_foldcolumn(p, wp, closed, lnum)
 	}
     }
     if (closed)
-	p[i >= wp->w_p_fdc ? i - 1 : i] = '+';
+	p[i >= fdc ? i - 1 : i] = '+';
 }
 #endif /* FEAT_FOLDING */
 
@@ -3556,12 +3578,14 @@ win_line(wp, lnum, startrow, endrow, nochange)
 #ifdef FEAT_FOLDING
 	    if (draw_state == WL_FOLD - 1 && n_extra == 0)
 	    {
+		int fdc = compute_foldcolumn(wp, 0);
+
 		draw_state = WL_FOLD;
-		if (wp->w_p_fdc > 0)
+		if (fdc > 0)
 		{
 		    /* Draw the 'foldcolumn'. */
 		    fill_foldcolumn(extra, wp, FALSE, lnum);
-		    n_extra = wp->w_p_fdc;
+		    n_extra = fdc;
 		    p_extra = extra;
 		    p_extra[n_extra] = NUL;
 		    c_extra = NUL;
diff --git a/src/version.c b/src/version.c
index 2b4b680fba..9ead88c5a0 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    603,
 /**/
     602,
 /**/

From f52fd6b6a4f96fa3384feac7af921d0ba8c2cca9 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 16:39:29 +0100
Subject: [PATCH 463/473] Added tag v7-4-603 for changeset 0c8738124a7b

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 24e8ee3932..43ee45392f 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3325,3 +3325,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 436d6c9e57f2f6def73e86891cbf72a0328aa9bd v7-4-600
 2561531decf15c1a02f62a1b96ff778e12a5dcbc v7-4-601
 4e31d9f7c896a346b2346fc4ff005b8b255172c9 v7-4-602
+0c8738124a7b9d6d1d3e18124ad97310e9618c92 v7-4-603

From 1e42d966bbe7ecc7e49f055c928070b8c7e82ebb Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 17:12:00 +0100
Subject: [PATCH 464/473] updated for version 7.4.604 Problem:    Running tests
 changes viminfo. Solution:   Disable viminfo.

---
 src/testdir/test_breakindent.in | 2 +-
 src/version.c                   | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/testdir/test_breakindent.in b/src/testdir/test_breakindent.in
index f9d903e51b..d2869317f2 100644
--- a/src/testdir/test_breakindent.in
+++ b/src/testdir/test_breakindent.in
@@ -100,7 +100,7 @@ fygjyl:let line2 = @0
 :$put =line2
 :"
 :let g:test="Test 14: breakindent + visual blockwise delete #1"
-:set all& breakindent
+:set all& breakindent viminfo+=nviminfo
 :30vnew
 :normal! 3a1234567890
 :normal! a    abcde
diff --git a/src/version.c b/src/version.c
index 9ead88c5a0..18c41c7479 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    604,
 /**/
     603,
 /**/

From ab7e73837387427268b6ca66b21564b96f8aa969 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 17:12:01 +0100
Subject: [PATCH 465/473] Added tag v7-4-604 for changeset f625b6302d04

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 43ee45392f..630a3cc7b7 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3326,3 +3326,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 2561531decf15c1a02f62a1b96ff778e12a5dcbc v7-4-601
 4e31d9f7c896a346b2346fc4ff005b8b255172c9 v7-4-602
 0c8738124a7b9d6d1d3e18124ad97310e9618c92 v7-4-603
+f625b6302d048df7d9f9e738b773f91dd4bbd58e v7-4-604

From 69c5d3699081652cc0e748576b7b57b0f2c544ff Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 18:44:16 +0100
Subject: [PATCH 466/473] updated for version 7.4.605 Problem:    The #
 register is not writable, it cannot be restored after 	    jumping around.
 Solution:   Make the # register writable. (Marcin Szamotulski)

---
 runtime/doc/change.txt | 42 ++++++++++++++++++++++++++++--------------
 src/buffer.c           |  2 +-
 src/globals.h          |  1 +
 src/ops.c              | 26 ++++++++++++++++++++++++--
 src/version.c          |  2 ++
 5 files changed, 56 insertions(+), 17 deletions(-)

diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index de340ec8b5..4fc7912823 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt*    For Vim version 7.4.  Last change: 2014 Jun 26
+*change.txt*    For Vim version 7.4.  Last change: 2015 Jan 27
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1103,11 +1103,12 @@ There are nine types of registers:			*registers* *E354*
 2. 10 numbered registers "0 to "9
 3. The small delete register "-
 4. 26 named registers "a to "z or "A to "Z
-5. four read-only registers ":, "., "% and "#
-6. the expression register "=
-7. The selection and drop registers "*, "+ and "~ 
-8. The black hole register "_
-9. Last search pattern register "/
+5. three read-only registers ":, "., "%
+7. alternate buffer register "#
+7. the expression register "=
+8. The selection and drop registers "*, "+ and "~ 
+9. The black hole register "_
+10. Last search pattern register "/
 
 1. Unnamed register ""				*quote_quote* *quotequote*
 Vim fills this register with text deleted with the "d", "c", "s", "x" commands
@@ -1153,7 +1154,7 @@ letters to replace their previous contents or as uppercase letters to append
 to their previous contents.  When the '>' flag is present in 'cpoptions' then
 a line break is inserted before the appended text.
 
-5. Read-only registers ":, "., "% and "#
+5. Read-only registers ":, ". and "%
 These are '%', '#', ':' and '.'.  You can use them only with the "p", "P",
 and ":put" commands and with CTRL-R.  {not in Vi}
 						*quote_.* *quote.* *E29*
@@ -1164,8 +1165,6 @@ and ":put" commands and with CTRL-R.  {not in Vi}
 		('textwidth' and other options affect what is inserted).
 							*quote_%* *quote%*
 	"%	Contains the name of the current file.
-							*quote_#* *quote#*
-	"#	Contains the name of the alternate file.
 						*quote_:* *quote:* *E30*
 	":	Contains the most recent executed command-line.  Example: Use
 		"@:" to repeat the previous command-line command.
@@ -1174,8 +1173,23 @@ and ":put" commands and with CTRL-R.  {not in Vi}
 		the command was completely from a mapping.
 		{not available when compiled without the |+cmdline_hist|
 		feature}
-
-6. Expression register "=			*quote_=* *quote=* *@=*
+							*quote_#* *quote#*
+6. Alternate file register "#
+Contains the name of the alternate file for the current window.  It will
+change how the |CTRL-^| command works.
+This register is writable, mainly to allow for restoring it after a plugin has
+changed it.  It accepts buffer number: >
+    let altbuf = bufnr(@#)
+    ...
+    let @# = altbuf
+It will give error |E86| if you pass buffer number and this buffer does not
+exist.
+It can also accept a match with an existing buffer name: >
+    let @# = 'buffer_name'
+Error |E93| if there is more than one buffer matching the given name or |E94|
+if none of buffers matches the given name.
+
+7. Expression register "=			*quote_=* *quote=* *@=*
 This is not really a register that stores text, but is a way to use an
 expression in commands which use a register.  The expression register is
 read-only; you cannot put text into it.  After the '=', the cursor moves to
@@ -1196,7 +1210,7 @@ If the "= register is used for the "p" command, the String is split up at <NL>
 characters.  If the String ends in a <NL>, it is regarded as a linewise
 register.  {not in Vi}
 
-7. Selection and drop registers "*, "+ and "~ 
+8. Selection and drop registers "*, "+ and "~ 
 Use these registers for storing and retrieving the selected text for the GUI.
 See |quotestar| and |quoteplus|.  When the clipboard is not available or not
 working, the unnamed register is used instead.  For Unix systems the clipboard
@@ -1218,12 +1232,12 @@ GTK GUI}
 Note: The "~ register is only used when dropping plain text onto Vim.
 Drag'n'drop of URI lists is handled internally.
 
-8. Black hole register "_				*quote_*
+9. Black hole register "_				*quote_*
 When writing to this register, nothing happens.  This can be used to delete
 text without affecting the normal registers.  When reading from this register,
 nothing is returned.  {not in Vi}
 
-9. Last search pattern register	"/			*quote_/* *quote/*
+10. Last search pattern register	"/			*quote_/* *quote/*
 Contains the most recent search-pattern.  This is used for "n" and 'hlsearch'.
 It is writable with `:let`, you can change it to have 'hlsearch' highlight
 other matches without actually searching.  You can't yank or delete into this
diff --git a/src/buffer.c b/src/buffer.c
index 0d14706063..e4230fc420 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1150,7 +1150,7 @@ do_buffer(action, start, dir, count, forceit)
 	{
 	    /* don't warn when deleting */
 	    if (!unload)
-		EMSGN(_("E86: Buffer %ld does not exist"), count);
+		EMSGN(_(e_nobufnr), count);
 	}
 	else if (dir == FORWARD)
 	    EMSG(_("E87: Cannot go beyond last buffer"));
diff --git a/src/globals.h b/src/globals.h
index a26a8b535a..474f74fc41 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1571,6 +1571,7 @@ EXTERN char_u e_nbreadonly[]	INIT(= N_("E744: NetBeans does not allow changes in
 EXTERN char_u e_intern2[]	INIT(= N_("E685: Internal error: %s"));
 EXTERN char_u e_maxmempat[]	INIT(= N_("E363: pattern uses more memory than 'maxmempattern'"));
 EXTERN char_u e_emptybuf[]	INIT(= N_("E749: empty buffer"));
+EXTERN char_u e_nobufnr[]	INIT(= N_("E86: Buffer %ld does not exist"));
 
 #ifdef FEAT_EX_EXTRA
 EXTERN char_u e_invalpat[]	INIT(= N_("E682: Invalid search pattern or delimiter"));
diff --git a/src/ops.c b/src/ops.c
index 6df1121a5f..a4261cb56e 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -856,11 +856,12 @@ valid_yank_reg(regname, writing)
     if (       (regname > 0 && ASCII_ISALNUM(regname))
 	    || (!writing && vim_strchr((char_u *)
 #ifdef FEAT_EVAL
-				    "/.%#:="
+				    "/.%:="
 #else
-				    "/.%#:"
+				    "/.%:"
 #endif
 					, regname) != NULL)
+	    || regname == '#'
 	    || regname == '"'
 	    || regname == '-'
 	    || regname == '_'
@@ -6514,6 +6515,27 @@ write_reg_contents_ex(name, str, maxlen, must_append, yank_type, block_len)
 	return;
     }
 
+    if (name == '#')
+    {
+	buf_T	*buf;
+
+	if (VIM_ISDIGIT(*str))
+	{
+	    int	num = atoi((char *)str);
+
+	    buf = buflist_findnr(num);
+	    if (buf == NULL)
+		EMSGN(_(e_nobufnr), (long)num);
+	}
+	else
+	    buf = buflist_findnr(buflist_findpat(str, str + STRLEN(str),
+							 TRUE, FALSE, FALSE));
+	if (buf == NULL)
+	    return;
+	curwin->w_alt_fnum = buf->b_fnum;
+	return;
+    }
+
 #ifdef FEAT_EVAL
     if (name == '=')
     {
diff --git a/src/version.c b/src/version.c
index 18c41c7479..17e442f8a2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    605,
 /**/
     604,
 /**/

From b2103dfaff0ee9112760b475e362f9ca643ff601 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 18:44:16 +0100
Subject: [PATCH 467/473] Added tag v7-4-605 for changeset c1ed973fb58f

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 630a3cc7b7..3271615baf 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3327,3 +3327,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 4e31d9f7c896a346b2346fc4ff005b8b255172c9 v7-4-602
 0c8738124a7b9d6d1d3e18124ad97310e9618c92 v7-4-603
 f625b6302d048df7d9f9e738b773f91dd4bbd58e v7-4-604
+c1ed973fb58faa650dcd4d25a98c669edb8ca0d4 v7-4-605

From 4ce3b3b48e2dc9fcd019415f3c69631e8f2679d0 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 20:59:31 +0100
Subject: [PATCH 468/473] updated for version 7.4.606 Problem:    May crash
 when using a small window. Solution:   Avoid dividing by zero. (Christian
 Brabandt)

---
 src/normal.c  | 2 ++
 src/version.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/normal.c b/src/normal.c
index cb1a7d154a..74a001e823 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4457,6 +4457,8 @@ nv_screengo(oap, dir, dist)
     col_off2 = col_off1 - curwin_col_off2();
     width1 = W_WIDTH(curwin) - col_off1;
     width2 = W_WIDTH(curwin) - col_off2;
+    if (width2 == 0)
+	width2 = 1; /* avoid divide by zero */
 
 #ifdef FEAT_VERTSPLIT
     if (curwin->w_width != 0)
diff --git a/src/version.c b/src/version.c
index 17e442f8a2..72d85b6184 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    606,
 /**/
     605,
 /**/

From aaa60f81f1871072d39830a71e82a44c21bb7d0f Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 20:59:31 +0100
Subject: [PATCH 469/473] Added tag v7-4-606 for changeset 22f164bd7e8e

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 3271615baf..59470bed3a 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3328,3 +3328,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 0c8738124a7b9d6d1d3e18124ad97310e9618c92 v7-4-603
 f625b6302d048df7d9f9e738b773f91dd4bbd58e v7-4-604
 c1ed973fb58faa650dcd4d25a98c669edb8ca0d4 v7-4-605
+22f164bd7e8ea7de1e4c2a41020dde971112b862 v7-4-606

From 32c381ba96420ebb1216ee539757a39db3c6a264 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 21:39:05 +0100
Subject: [PATCH 470/473] updated for version 7.4.607 Problem:    Compiler
 warnings for unused variables. Solution:   Move them inside #ifdef. (Kazunobu
 Kuriyama)

---
 src/ui.c      | 4 ++--
 src/version.c | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ui.c b/src/ui.c
index a2d83458d5..10ae731772 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -73,8 +73,6 @@ ui_write(s, len)
 static char_u *ta_str = NULL;
 static int ta_off;	/* offset for next char to use when ta_str != NULL */
 static int ta_len;	/* length of ta_str when it's not NULL*/
-static int clipboard_needs_update; /* clipboard needs to be updated */
-static int global_change_count = 0; /* if set, inside a start_global_changes */
 
     void
 ui_inchar_undo(s, len)
@@ -564,6 +562,8 @@ clip_copy_selection(clip)
  * prevents accessing the clipboard very often which might slow down Vim
  * considerably.
  */
+static int global_change_count = 0; /* if set, inside a start_global_changes */
+static int clipboard_needs_update; /* clipboard needs to be updated */
 
 /*
  * Save clip_unnamed and reset it.
diff --git a/src/version.c b/src/version.c
index 72d85b6184..1c4693f25f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    607,
 /**/
     606,
 /**/

From df78ab532b93fda250a2b191f7ba70332ed4d9b3 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 21:39:05 +0100
Subject: [PATCH 471/473] Added tag v7-4-607 for changeset 52b89a52ffd4

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 59470bed3a..16ba55ca00 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3329,3 +3329,4 @@ b01ca71f93b293ba93489bc2320c12caf61bf289 v7-4-598
 f625b6302d048df7d9f9e738b773f91dd4bbd58e v7-4-604
 c1ed973fb58faa650dcd4d25a98c669edb8ca0d4 v7-4-605
 22f164bd7e8ea7de1e4c2a41020dde971112b862 v7-4-606
+52b89a52ffd4f2a925b42be1aa8041bc0c0dff31 v7-4-607

From 4e6dfb898a835908f822ce7ce8d0da1c36212970 Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 22:52:15 +0100
Subject: [PATCH 472/473] updated for version 7.4.608 Problem:    test_eval
 fails when the clipboard feature is missing. Solution:   Skip part of the
 test. Reduce the text used.

---
 src/testdir/test_eval.in |  33 ++++++++++++++++++++++-----------
 src/testdir/test_eval.ok | Bin 11538 -> 11246 bytes
 src/version.c            |   2 ++
 3 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/testdir/test_eval.in b/src/testdir/test_eval.in
index b9f68f75c7..b0ac3a0290 100644
--- a/src/testdir/test_eval.in
+++ b/src/testdir/test_eval.in
@@ -2,13 +2,19 @@ Test for various eval features.   vim: set ft=vim :
 
 Note: system clipboard is saved, changed and restored.
 
+clipboard contents
+something else
+
 STARTTEST
 :so small.vim
 :set encoding=latin1
 :set noswapfile
 :lang C
 :fun AppendRegContents(reg)
-    call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1))))
+  call AppendRegParts(a:reg, getregtype(a:reg), getreg(a:reg), string(getreg(a:reg, 0, 1)), getreg(a:reg, 1), string(getreg(a:reg, 1, 1)))
+:endfun
+:fun AppendRegParts(reg, type, cont, strcont, cont1, strcont1)
+  call append('$', printf('%s: type %s; value: %s (%s), expr: %s (%s)', a:reg, a:type, a:cont, a:strcont, a:cont1, a:strcont1))
 endfun
 :command -nargs=? AR :call AppendRegContents(<q-args>)
 :fun SetReg(...)
@@ -122,18 +128,23 @@ call SetReg('/', ["abc/\n"])
 call SetReg('=', ['"abc/"'])
 call SetReg('=', ["\"abc/\n\""])
 $put ='{{{1 System clipboard'
+if has('clipboard')
 " Save and restore system clipboard.
 " If no connection to X-Server is possible, test should succeed.
-:let _clipreg = ['+', getreg('+'), getregtype('+')]
-:let _clipopt = &cb
-:let &cb='unnamedplus'
-:1y
-:AR +
-:tabdo :windo :echo "hi"
-:3y
-:AR +
-:let &cb=_clipopt
-:call call('setreg', _clipreg)
+let _clipreg = ['+', getreg('+'), getregtype('+')]
+let _clipopt = &cb
+let &cb='unnamedplus'
+5y
+AR +
+tabdo :windo :echo "hi"
+6y
+AR +
+let &cb=_clipopt
+call call('setreg', _clipreg)
+else
+  call AppendRegParts('+', 'V', "clipboard contents\n", "['clipboard contents']", "clipboard contents\n", "['clipboard contents']")
+  call AppendRegParts('+', 'V', "something else\n", "['something else']", "something else\n", "['something else']")
+endif
 $put ='{{{1 Errors'
 call ErrExe('call setreg()')
 call ErrExe('call setreg(1)')
diff --git a/src/testdir/test_eval.ok b/src/testdir/test_eval.ok
index 5e8d2cc4f6f0caa2b4386ceec8b3addb70c419a2..c4fc9ac0b2a25bbc32abf447331a2ebbc6b14755 100644
GIT binary patch
delta 206
zcmbOf^)7sahgyAdPG&(;eqvFILUMjyNorn6F@u6ev^u7+daS07LTW`pk(C0bByK%i
z+ExlBl?AB^Vb%&|i8-aIRtm-Wxv3=?nR)37sX30tsbIaxV#TRQcA-jOQM*}3;~5J8
D1^!6q

delta 524
zcmchTF{;8q5QZ(Ra*Dq)iXzyqSO%=DL_x9GmmPH>X2Z-TC@FFWPa?c~yrX!Aw}_~%
z7B<5a^UcrqUzg|AW!h=xBpzGGs5Dzw3aHW<wxoT@Btrm|Jtzo;D?bT4R14j8`~eql
zdIQk0V1)<Wd?hyOEBI4ESd4>bR+7TZ`7ot9iKhe7%oaaRvw;<euE-3K?sdK+1DzX$
oD!gMd!<+k^eG`4re?Dlw7arAhJwn3lSfb=eY3XhLi}<ho4<`P#3jhEB

diff --git a/src/version.c b/src/version.c
index 1c4693f25f..8e26439815 100644
--- a/src/version.c
+++ b/src/version.c
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    608,
 /**/
     607,
 /**/

From 379ee457eabc744b9ac45e379be5ed48b299334d Mon Sep 17 00:00:00 2001
From: Bram Moolenaar <bram@vim.org>
Date: Tue, 27 Jan 2015 22:52:15 +0100
Subject: [PATCH 473/473] Added tag v7-4-608 for changeset 6b86d256fd33

---
 .hgtags | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.hgtags b/.hgtags
index 16ba55ca00..d5ba727aab 100644
--- a/.hgtags
+++ b/.hgtags
@@ -3330,3 +3330,4 @@ f625b6302d048df7d9f9e738b773f91dd4bbd58e v7-4-604
 c1ed973fb58faa650dcd4d25a98c669edb8ca0d4 v7-4-605
 22f164bd7e8ea7de1e4c2a41020dde971112b862 v7-4-606
 52b89a52ffd4f2a925b42be1aa8041bc0c0dff31 v7-4-607
+6b86d256fd3360a5a0a8f89c3efeda4e961153c0 v7-4-608