Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 13821:98274127d675 v8.0.1782
patch 8.0.1782: no simple way to label quickfix entries
commit https://github.com/vim/vim/commit/d76ce852668635d81778cedacc2d3f021ed4e475
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 1 15:02:04 2018 +0200
patch 8.0.1782: no simple way to label quickfix entries
Problem: No simple way to label quickfix entries.
Solution: Add the "module" item, to be used instead of the file name for
display purposes. (Martin Szamotulski, closes #1757)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 01 May 2018 15:15:07 +0200 |
parents | 31bb8e1f7625 |
children | eb7707562201 |
comparison
equal
deleted
inserted
replaced
13820:2e78af0dc866 | 13821:98274127d675 |
---|---|
136 \ ' 2:20 col 10 error 22: Error', | 136 \ ' 2:20 col 10 error 22: Error', |
137 \ ' 3:30 col 15 info 33: Info', | 137 \ ' 3:30 col 15 info 33: Info', |
138 \ ' 4:40 col 20 x 44: Other', | 138 \ ' 4:40 col 20 x 44: Other', |
139 \ ' 5:50 col 25 55: one'], l) | 139 \ ' 5:50 col 25 55: one'], l) |
140 | 140 |
141 " Test for module names, one needs to explicitly set `'valid':v:true` so | |
142 call g:Xsetlist([ | |
143 \ {'lnum':10,'col':5,'type':'W','module':'Data.Text','text':'ModuleWarning','nr':11,'valid':v:true}, | |
144 \ {'lnum':20,'col':10,'type':'W','module':'Data.Text','filename':'Data/Text.hs','text':'ModuleWarning','nr':22,'valid':v:true}, | |
145 \ {'lnum':30,'col':15,'type':'W','filename':'Data/Text.hs','text':'FileWarning','nr':33,'valid':v:true}]) | |
146 let l = split(execute('Xlist', ""), "\n") | |
147 call assert_equal([' 1 Data.Text:10 col 5 warning 11: ModuleWarning', | |
148 \ ' 2 Data.Text:20 col 10 warning 22: ModuleWarning', | |
149 \ ' 3 Data/Text.hs:30 col 15 warning 33: FileWarning'], l) | |
150 | |
141 " Error cases | 151 " Error cases |
142 call assert_fails('Xlist abc', 'E488:') | 152 call assert_fails('Xlist abc', 'E488:') |
143 endfunc | 153 endfunc |
144 | 154 |
145 func Test_clist() | 155 func Test_clist() |
1140 call assert_equal(8, len(l)) | 1150 call assert_equal(8, len(l)) |
1141 call assert_equal(89, l[4].lnum) | 1151 call assert_equal(89, l[4].lnum) |
1142 call assert_equal(1, l[4].valid) | 1152 call assert_equal(1, l[4].valid) |
1143 call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr)) | 1153 call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr)) |
1144 | 1154 |
1155 " Test for %o | |
1156 set efm=%f(%o):%l\ %m | |
1157 cgetexpr ['Xtestfile(Language.PureScript.Types):20 Error'] | |
1158 call writefile(['Line1'], 'Xtestfile') | |
1159 let l = getqflist() | |
1160 call assert_equal(1, len(l), string(l)) | |
1161 call assert_equal('Language.PureScript.Types', l[0].module) | |
1162 copen | |
1163 call assert_equal('Language.PureScript.Types|20| Error', getline(1)) | |
1164 call feedkeys("\<CR>", 'xn') | |
1165 call assert_equal('Xtestfile', expand('%:t')) | |
1166 cclose | |
1167 bd | |
1168 call delete("Xtestfile") | |
1169 | |
1145 " The following sequence of commands used to crash Vim | 1170 " The following sequence of commands used to crash Vim |
1146 set efm=%W%m | 1171 set efm=%W%m |
1147 cgetexpr ['msg1'] | 1172 cgetexpr ['msg1'] |
1148 let l = getqflist() | 1173 let l = getqflist() |
1149 call assert_equal(1, len(l), string(l)) | 1174 call assert_equal(1, len(l), string(l)) |