diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2019-04-05 10:57:57 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2019-05-05 13:46:19 +0200 |
commit | ced3598a96d658a959da03ead24b00db40fe861f (patch) | |
tree | 8720cb8f6bfb767e57958c0faf0f685d82f9efb2 /src | |
parent | 98a818776419a55e8f488f4d77d413287eed2ec3 (diff) | |
download | rneovim-ced3598a96d658a959da03ead24b00db40fe861f.tar.gz rneovim-ced3598a96d658a959da03ead24b00db40fe861f.tar.bz2 rneovim-ced3598a96d658a959da03ead24b00db40fe861f.zip |
vim-patch:8.0.1678: errorformat "%r" implies "%>"
Problem: Errorformat "%r" implies "%>". (Jan Gosmann)
Solution: Jump to before setting fmt_ptr. (Yegappan Lakshmanan)
https://github.com/vim/vim/commit/e333e79f9bdff82432e0fd7fcf7ae30ef8e3d092
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/quickfix.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 2f8381267b..f4849c92a6 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -730,6 +730,7 @@ static int qf_parse_line(qf_info_T *qi, int qf_idx, char_u *linebuf, // Always ignore case when looking for a matching error. regmatch.rm_ic = true; +restofline: // If there was no %> item start at the first pattern if (fmt_start == NULL) { fmt_ptr = fmt_first; @@ -741,7 +742,6 @@ static int qf_parse_line(qf_info_T *qi, int qf_idx, char_u *linebuf, // Try to match each part of 'errorformat' until we find a complete // match or no match. fields->valid = true; -restofline: for (; fmt_ptr != NULL; fmt_ptr = fmt_ptr->next) { idx = fmt_ptr->prefix; if (qfl->qf_multiscan && vim_strchr((char_u *)"OPQ", idx) == NULL) { diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 9e5c3ec5f5..37a311ab55 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -2558,6 +2558,29 @@ func Xmultifilestack_tests(cchar) call assert_equal(3, l1.items[1].lnum) call assert_equal('two.txt', bufname(l2.items[1].bufnr)) call assert_equal(5, l2.items[1].lnum) + + " Test for start of a new error line in the same line where a previous + " error line ends with a file stack. + let efm_val = 'Error\ l%l\ in\ %f,' + let efm_val .= '%-P%>(%f%r,Error\ l%l\ in\ %m,%-Q)%r' + let l = g:Xgetlist({'lines' : [ + \ '(one.txt', + \ 'Error l4 in one.txt', + \ ') (two.txt', + \ 'Error l6 in two.txt', + \ ')', + \ 'Error l8 in one.txt' + \ ], 'efm' : efm_val}) + call assert_equal(3, len(l.items)) + call assert_equal('one.txt', bufname(l.items[0].bufnr)) + call assert_equal(4, l.items[0].lnum) + call assert_equal('one.txt', l.items[0].text) + call assert_equal('two.txt', bufname(l.items[1].bufnr)) + call assert_equal(6, l.items[1].lnum) + call assert_equal('two.txt', l.items[1].text) + call assert_equal('one.txt', bufname(l.items[2].bufnr)) + call assert_equal(8, l.items[2].lnum) + call assert_equal('', l.items[2].text) endfunc func Test_multifilestack() |