aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-06 19:09:48 -0400
committerGitHub <noreply@github.com>2020-10-06 19:09:48 -0400
commita260d5def363ca30f0473365ea514f2dedd0d0ba (patch)
tree957e486c12d36f55c7958a08b79dd647b505b3df
parent7b8935398587992da3233bcd7edd79013889fea4 (diff)
parent7454b11ec115da973da36c36a76a5bf81967a5ff (diff)
downloadrneovim-a260d5def363ca30f0473365ea514f2dedd0d0ba.tar.gz
rneovim-a260d5def363ca30f0473365ea514f2dedd0d0ba.tar.bz2
rneovim-a260d5def363ca30f0473365ea514f2dedd0d0ba.zip
Merge pull request #13060 from janlazo/vim-8.1.2310
vim-patch:8.1.{1619,1771,1624,2274,2310,2401},8.2.{554,1806}
-rw-r--r--src/nvim/ex_cmds.lua12
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/testdir/shared.vim7
-rw-r--r--src/nvim/testdir/test_highlight.vim14
-rw-r--r--src/nvim/testdir/test_mapping.vim2
-rw-r--r--src/nvim/testdir/test_quickfix.vim48
-rw-r--r--src/nvim/testdir/test_timers.vim2
7 files changed, 72 insertions, 15 deletions
diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua
index a01f92df27..d62b00fee1 100644
--- a/src/nvim/ex_cmds.lua
+++ b/src/nvim/ex_cmds.lua
@@ -337,7 +337,7 @@ return {
},
{
command='caddexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
@@ -409,7 +409,7 @@ return {
},
{
command='cexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR, BANG),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, BANG),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
@@ -447,7 +447,7 @@ return {
},
{
command='cgetexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
@@ -1299,7 +1299,7 @@ return {
},
{
command='laddexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
@@ -1389,7 +1389,7 @@ return {
},
{
command='lexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR, BANG),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, BANG),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
@@ -1427,7 +1427,7 @@ return {
},
{
command='lgetexpr',
- flags=bit.bor(NEEDARG, WORD1, NOTRLCOM, TRLBAR),
+ flags=bit.bor(NEEDARG, WORD1, NOTRLCOM),
addr_type=ADDR_LINES,
func='ex_cexpr',
},
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 0c9902aaec..7d4f52af34 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -6377,7 +6377,7 @@ void ex_cexpr(exarg_T *eap)
// Evaluate the expression. When the result is a string or a list we can
// use it to fill the errorlist.
typval_T tv;
- if (eval0(eap->arg, &tv, NULL, true) != FAIL) {
+ if (eval0(eap->arg, &tv, &eap->nextcmd, true) != FAIL) {
if ((tv.v_type == VAR_STRING && tv.vval.v_string != NULL)
|| tv.v_type == VAR_LIST) {
incr_quickfix_busy();
diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim
index 0d32f4d875..9bc037a59f 100644
--- a/src/nvim/testdir/shared.vim
+++ b/src/nvim/testdir/shared.vim
@@ -294,6 +294,13 @@ func GetVimCommandClean()
return cmd
endfunc
+" Get the command to run Vim, with --clean, and force to run in terminal so it
+" won't start a new GUI.
+func GetVimCommandCleanTerm()
+ " Add -v to have gvim run in the terminal (if possible)
+ return GetVimCommandClean() .. ' -v '
+endfunc
+
" Run Vim, using the "vimcmd" file and "-u NORC".
" "before" is a list of Vim commands to be executed before loading plugins.
" "after" is a list of Vim commands to be executed after loading plugins.
diff --git a/src/nvim/testdir/test_highlight.vim b/src/nvim/testdir/test_highlight.vim
index 6aa187b17e..00e42733a7 100644
--- a/src/nvim/testdir/test_highlight.vim
+++ b/src/nvim/testdir/test_highlight.vim
@@ -596,9 +596,17 @@ endfunc
" This test must come before the Test_cursorline test, as it appears this
" defines the Normal highlighting group anyway.
func Test_1_highlight_Normalgroup_exists()
- " MS-Windows GUI sets the font
- if !has('win32') || !has('gui_running')
- let hlNormal = HighlightArgs('Normal')
+ let hlNormal = HighlightArgs('Normal')
+ if !has('gui_running')
call assert_match('hi Normal\s*clear', hlNormal)
+ elseif has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
+ " expect is DEFAULT_FONT of gui_gtk_x11.c
+ call assert_match('hi Normal\s*font=Monospace 10', hlNormal)
+ elseif has('gui_motif') || has('gui_athena')
+ " expect is DEFAULT_FONT of gui_x11.c
+ call assert_match('hi Normal\s*font=7x13', hlNormal)
+ elseif has('win32')
+ " expect any font
+ call assert_match('hi Normal\s*font=.*', hlNormal)
endif
endfunc
diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim
index dd0da5db64..152afb4b9d 100644
--- a/src/nvim/testdir/test_mapping.vim
+++ b/src/nvim/testdir/test_mapping.vim
@@ -406,7 +406,7 @@ func Test_error_in_map_expr()
[CODE]
call writefile(lines, 'Xtest.vim')
- let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8})
+ let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))})
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index fab5cb320f..42ca0fe1d3 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -95,7 +95,7 @@ func XlistTests(cchar)
" Populate the list and then try
Xgetexpr ['non-error 1', 'Xtestfile1:1:3:Line1',
\ 'non-error 2', 'Xtestfile2:2:2:Line2',
- \ 'non-error 3', 'Xtestfile3:3:1:Line3']
+ \ 'non-error| 3', 'Xtestfile3:3:1:Line3']
" List only valid entries
let l = split(execute('Xlist', ''), "\n")
@@ -107,7 +107,7 @@ func XlistTests(cchar)
let l = split(execute('Xlist!', ''), "\n")
call assert_equal([' 1: non-error 1', ' 2 Xtestfile1:1 col 3: Line1',
\ ' 3: non-error 2', ' 4 Xtestfile2:2 col 2: Line2',
- \ ' 5: non-error 3', ' 6 Xtestfile3:3 col 1: Line3'], l)
+ \ ' 5: non-error| 3', ' 6 Xtestfile3:3 col 1: Line3'], l)
" List a range of errors
let l = split(execute('Xlist 3,6', ''), "\n")
@@ -507,7 +507,7 @@ func Xtest_browse(cchar)
Xexpr ""
call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
call assert_equal(0, g:Xgetlist({'size' : 0}).size)
- Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo']
+ Xaddexpr ['foo', 'bar', 'baz', 'quux', 'sh|moo']
call assert_equal(5, g:Xgetlist({'size' : 0}).size)
Xlast
call assert_equal(5, g:Xgetlist({'idx' : 0}).idx)
@@ -4049,4 +4049,46 @@ func Test_qfcmd_abort()
augroup END
endfunc
+" Test for using a file in one of the parent directories.
+func Test_search_in_dirstack()
+ call mkdir('Xtestdir/a/b/c', 'p')
+ let save_cwd = getcwd()
+ call writefile(["X1_L1", "X1_L2"], 'Xtestdir/Xfile1')
+ call writefile(["X2_L1", "X2_L2"], 'Xtestdir/a/Xfile2')
+ call writefile(["X3_L1", "X3_L2"], 'Xtestdir/a/b/Xfile3')
+ call writefile(["X4_L1", "X4_L2"], 'Xtestdir/a/b/c/Xfile4')
+
+ let lines = "Entering dir Xtestdir\n" .
+ \ "Entering dir a\n" .
+ \ "Entering dir b\n" .
+ \ "Xfile2:2:X2_L2\n" .
+ \ "Leaving dir a\n" .
+ \ "Xfile1:2:X1_L2\n" .
+ \ "Xfile3:1:X3_L1\n" .
+ \ "Entering dir c\n" .
+ \ "Xfile4:2:X4_L2\n" .
+ \ "Leaving dir c\n"
+ set efm=%DEntering\ dir\ %f,%XLeaving\ dir\ %f,%f:%l:%m
+ cexpr lines .. "Leaving dir Xtestdir|\n" | let next = 1
+ call assert_equal(11, getqflist({'size' : 0}).size)
+ call assert_equal(4, getqflist({'idx' : 0}).idx)
+ call assert_equal('X2_L2', getline('.'))
+ call assert_equal(1, next)
+ cnext
+ call assert_equal(6, getqflist({'idx' : 0}).idx)
+ call assert_equal('X1_L2', getline('.'))
+ cnext
+ call assert_equal(7, getqflist({'idx' : 0}).idx)
+ call assert_equal(1, line('$'))
+ call assert_equal('', getline(1))
+ cnext
+ call assert_equal(9, getqflist({'idx' : 0}).idx)
+ call assert_equal(1, line('$'))
+ call assert_equal('', getline(1))
+
+ set efm&
+ exe 'cd ' . save_cwd
+ call delete('Xtestdir', 'rf')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index c3b03fe1a5..13971a918d 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -355,7 +355,7 @@ func Test_error_in_timer_callback()
[CODE]
call writefile(lines, 'Xtest.vim')
- let buf = term_start(GetVimCommandClean() .. ' -S Xtest.vim', {'term_rows': 8})
+ let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
let job = term_getjob(buf)
call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))})