From a76f59d817e2da31d83b4f0e978b52abe81e0ae9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 11:41:01 +0100 Subject: [PATCH 01/10] patch 8.0.0315: :help :[range] does not work Problem: ":help :[range]" does not work. (Tony Mechelynck) Solution: Translate to insert a backslash. --- src/ex_cmds.c | 6 ++++-- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 58a0186129..8fda8d491e 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -6505,7 +6505,8 @@ find_help_tags( "cpo-*", "/\\(\\)", "/\\%(\\)", "?", ":?", "?", "g?", "g?g?", "g??", "z?", "/\\?", "/\\z(\\)", "\\=", ":s\\=", - "[count]", "[quotex]", "[range]", + "[count]", "[quotex]", + "[range]", ":[range]", "[pattern]", "\\|", "\\%$", "s/\\~", "s/\\U", "s/\\L", "s/\\1", "s/\\2", "s/\\3", "s/\\9"}; @@ -6514,7 +6515,8 @@ find_help_tags( "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)", "?", ":?", "?", "g?", "g?g?", "g??", "z?", "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=", - "\\[count]", "\\[quotex]", "\\[range]", + "\\[count]", "\\[quotex]", + "\\[range]", ":\\[range]", "\\[pattern]", "\\\\bar", "/\\\\%\\$", "s/\\\\\\~", "s/\\\\U", "s/\\\\L", "s/\\\\1", "s/\\\\2", "s/\\\\3", "s/\\\\9"}; diff --git a/src/version.c b/src/version.c index 4da417b925..71622392fb 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 315, /**/ 314, /**/ From dad7309dd22f0c6b5de0b031acd7f54d3aa94326 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 11:54:50 +0100 Subject: [PATCH 02/10] patch 8.0.0316: :help z? does not work Problem: ":help z?" does not work. (Pavol Juhas) Solution: Remove exception for z?. --- 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 8fda8d491e..5b118e564c 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -6503,7 +6503,7 @@ find_help_tags( static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*", "/*", "/\\*", "\"*", "**", "cpo-*", "/\\(\\)", "/\\%(\\)", - "?", ":?", "?", "g?", "g?g?", "g??", "z?", + "?", ":?", "?", "g?", "g?g?", "g??", "/\\?", "/\\z(\\)", "\\=", ":s\\=", "[count]", "[quotex]", "[range]", ":[range]", @@ -6513,7 +6513,7 @@ find_help_tags( static char *(rtable[]) = {"star", "gstar", "[star", "]star", ":star", "/star", "/\\\\star", "quotestar", "starstar", "cpo-star", "/\\\\(\\\\)", "/\\\\%(\\\\)", - "?", ":?", "?", "g?", "g?g?", "g??", "z?", + "?", ":?", "?", "g?", "g?g?", "g??", "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=", "\\[count]", "\\[quotex]", "\\[range]", ":\\[range]", diff --git a/src/version.c b/src/version.c index 71622392fb..68af6ff114 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 316, /**/ 315, /**/ From 43dded8c59c0647a70dd52c3125783945d90ae5a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 16:06:17 +0100 Subject: [PATCH 03/10] patch 8.0.0317: no test for setting 'guifont' Problem: No test for setting 'guifont'. Solution: Add a test for X11 GUIs. (Kazunobu Kuriyama) --- src/testdir/test_gui.vim | 59 ++++++++++++++++++++++++++++++++++++++++ src/version.c | 2 ++ 2 files changed, 61 insertions(+) diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 0a158e72cd..3361649a13 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -72,6 +72,65 @@ func Test_getfontname_without_arg() endif endfunc +func Test_set_guifont() + let l:guifont_saved = &guifont + if has('xfontset') + " Prevent 'guifontset' from canceling 'guifont'. + let l:guifontset_saved = &guifontset + set guifontset= + endif + + let skipped = 0 + if has('gui_athena') || has('gui_motif') + " Non-empty font list with invalid font names. + " + " This test is twofold: (1) It checks if the command fails as expected + " when there are no loadable fonts found in the list. (2) It checks if + " 'guifont' remains the same after the command loads none of the fonts + " listed. + let l:flist = &guifont + call assert_fails('set guifont=-notexist1-*,-notexist2-*') + call assert_equal(l:flist, &guifont) + + " Non-empty font list with a valid font name. Should pick up the first + " valid font. + set guifont=-notexist1-*,fixed,-notexist2-* + call assert_equal('fixed', getfontname()) + + " Empty list. Should fallback to the built-in default. + set guifont= + call assert_equal('7x13', getfontname()) + + elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') + " For GTK, what we refer to as 'font names' in our manual are actually + " 'initial font patterns'. A valid font which matches the 'canonical font + " pattern' constructed from a given 'initial pattern' is to be looked up + " and loaded. That explains why the GTK GUIs appear to accept 'invalid + " font names'. + " + " Non-empty list. Should always pick up the first element, no matter how + " strange it is, as explained above. + set guifont=(´・ω・`)\ 12,Courier\ 12 + call assert_equal('(´・ω・`) 12', getfontname()) + + " Empty list. Should fallback to the built-in default. + set guifont= + call assert_equal('Monospace 10', getfontname()) + + else + let skipped = 1 + endif + + if has('xfontset') + let &guifontset = l:guifontset_saved + endif + let &guifont = l:guifont_saved + + if skipped + throw "Skipped: Test not implemented yet for this GUI" + endif +endfunc + func Test_getwinpos() call assert_match('Window position: X \d\+, Y \d\+', execute('winpos')) call assert_true(getwinposx() >= 0) diff --git a/src/version.c b/src/version.c index 68af6ff114..50c6fb1dd5 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 317, /**/ 316, /**/ From a9f8ffb6345f5b246944c73b9861fcc53eaa5228 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 16:14:53 +0100 Subject: [PATCH 04/10] patch 8.0.0318: small mistake in 7x13 font name Problem: Small mistake in 7x13 font name. Solution: Use ISO 8859-1 name instead of 10646-1. (Kazunobu Kuriyama) --- src/testdir/test_gui.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim index 3361649a13..283b0ccb89 100644 --- a/src/testdir/test_gui.vim +++ b/src/testdir/test_gui.vim @@ -41,7 +41,7 @@ func Test_getfontname_with_arg() call assert_equal('', getfontname('notexist')) " Valid font name. This is usually the real name of 7x13 by default. - let l:fname = '-Misc-Fixed-Medium-R-Normal--13-120-75-75-C-70-ISO10646-1' + let l:fname = '-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1' call assert_equal(l:fname, getfontname(l:fname)) elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3') diff --git a/src/version.c b/src/version.c index 50c6fb1dd5..1448e981de 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 318, /**/ 317, /**/ From 190b04cdd936f4696c22466b7f077f9371d96580 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 17:37:03 +0100 Subject: [PATCH 05/10] patch 8.0.0319: insert mode completion does not respect 'backspace' Problem: Insert mode completion does not respect "start" in 'backspace'. Solution: Check whether backspace can go before where insert started. (Hirohito Higashi) --- src/edit.c | 7 +++++-- src/testdir/test_popup.vim | 20 ++++++++++++++++++++ src/version.c | 2 ++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/edit.c b/src/edit.c index 1164e2032a..bc8652ba41 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3467,10 +3467,13 @@ ins_compl_bs(void) mb_ptr_back(line, p); /* Stop completion when the whole word was deleted. For Omni completion - * allow the word to be deleted, we won't match everything. */ + * allow the word to be deleted, we won't match everything. + * Respect the 'backspace' option. */ if ((int)(p - line) - (int)compl_col < 0 || ((int)(p - line) - (int)compl_col == 0 - && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL) + && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL + || (!can_bs(BS_START) && (int)(p - line) - (int)compl_col + - compl_length < 0)) return K_BS; /* Deleted more than what was used to find matches or didn't finish diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index efbb9185d2..f4ce064d7b 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -511,4 +511,24 @@ func Test_completion_clear_candidate_list() bw! endfunc +func Test_completion_respect_bs_option() + new + let li = ["aaa", "aaa12345", "aaaabcdef", "aaaABC"] + + set bs=indent,eol + call setline(1, li) + 1 + call feedkeys("A\\\\\\\", "tx") + call assert_equal('aaa', getline(1)) + + %d + set bs=indent,eol,start + call setline(1, li) + 1 + call feedkeys("A\\\\\\\", "tx") + call assert_equal('', getline(1)) + + bw! +endfunc + " vim: shiftwidth=2 sts=2 expandtab diff --git a/src/version.c b/src/version.c index 1448e981de..09680b9bc2 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 319, /**/ 318, /**/ From 4d8505155ec3d0f04e268b2997153ecaf37ee188 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 18:25:14 +0100 Subject: [PATCH 06/10] patch 8.0.0320: warning for unused variable with small build Problem: Warning for unused variable with small build. Solution: Change #ifdef to exclude FEAT_CMDWIN. (Kazunobu Kuriyama) --- src/ex_getln.c | 3 +-- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index 4365100a2b..c498e00a12 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -212,8 +212,7 @@ getcmdline( #endif expand_T xpc; long *b_im_ptr = NULL; -#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) \ - || defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CMDWIN) +#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA) /* Everything that may work recursively should save and restore the * current command line in save_ccline. That includes update_screen(), a * custom status line may invoke ":normal". */ diff --git a/src/version.c b/src/version.c index 09680b9bc2..2d6940d946 100644 --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 320, /**/ 319, /**/ From 8cc2a9c062fa38e133a62778518f769a423a2526 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 9 Feb 2017 20:22:30 +0100 Subject: [PATCH 07/10] patch 8.0.0321: errors when trying to use scripts in tiny version Problem: When using the tiny version trying to load the matchit plugin gives an error. On MS-Windows some default mappings fail. Solution: Add a check if the command used is available. (Christian Brabandt) --- runtime/macros/matchit.vim | 4 +++- runtime/mswin.vim | 44 ++++++++++++++++++++++++++------------ src/version.c | 2 ++ 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/runtime/macros/matchit.vim b/runtime/macros/matchit.vim index 9cfe2e532f..f6f463f40c 100644 --- a/runtime/macros/matchit.vim +++ b/runtime/macros/matchit.vim @@ -1,3 +1,5 @@ " Load the matchit package. " For those users who were loading the matchit plugin from here. -packadd matchit +if 1 + packadd matchit +endif diff --git a/runtime/mswin.vim b/runtime/mswin.vim index ca280d227c..6dff7e7719 100644 --- a/runtime/mswin.vim +++ b/runtime/mswin.vim @@ -1,7 +1,7 @@ " Set options and add mapping such that Vim behaves a lot like MS-Windows " " Maintainer: Bram Moolenaar -" Last change: 2012 Jul 25 +" Last change: 2017 Feb 09 " bail out if this isn't wanted (mrsvim.vim uses this). if exists("g:skip_loading_mswin") && g:skip_loading_mswin @@ -23,20 +23,22 @@ set backspace=indent,eol,start whichwrap+=<,>,[,] " backspace in Visual mode deletes selection vnoremap d -" CTRL-X and SHIFT-Del are Cut -vnoremap "+x -vnoremap "+x +if has("clipboard") + " CTRL-X and SHIFT-Del are Cut + vnoremap "+x + vnoremap "+x -" CTRL-C and CTRL-Insert are Copy -vnoremap "+y -vnoremap "+y + " CTRL-C and CTRL-Insert are Copy + vnoremap "+y + vnoremap "+y -" CTRL-V and SHIFT-Insert are Paste -map "+gP -map "+gP + " CTRL-V and SHIFT-Insert are Paste + map "+gP + map "+gP -cmap + -cmap + + cmap + + cmap + +endif " Pasting blockwise and linewise selections is not possible in Insert and " Visual mode without the +virtualedit feature. They are pasted as if they @@ -44,8 +46,10 @@ cmap + " Uses the paste.vim autoload script. " Use CTRL-G u to have CTRL-Z only undo the paste. -exe 'inoremap