1
0
forked from aniani/vim

patch 7.4.1802

Problem:    Quickfix doesn't handle long lines well, they are split.
Solution:   Drop characters after a limit. (Anton Lindqvist)
This commit is contained in:
Bram Moolenaar
2016-04-30 13:17:09 +02:00
parent 113ce08456
commit 6be8c8e165
4 changed files with 252 additions and 28 deletions

View File

@@ -831,3 +831,40 @@ function Test_quickfix_set_list_with_act()
call XquickfixSetListWithAct('c')
call XquickfixSetListWithAct('l')
endfunction
func XLongLinesTests()
let l = getqflist()
call assert_equal(3, len(l))
call assert_equal(1, l[0].lnum)
call assert_equal(1, l[0].col)
call assert_equal(4070, len(l[0].text))
call assert_equal(2, l[1].lnum)
call assert_equal(1, l[1].col)
call assert_equal(4070, len(l[1].text))
call assert_equal(3, l[2].lnum)
call assert_equal(1, l[2].col)
call assert_equal(10, len(l[2].text))
call setqflist([], 'r')
endfunc
func Test_long_lines()
let testfile = 'samples/quickfix.txt'
" file
exe 'cgetfile' testfile
call XLongLinesTests()
" list
cexpr readfile(testfile)
call XLongLinesTests()
" string
cexpr join(readfile(testfile), "\n")
call XLongLinesTests()
" buffer
e testfile
exe 'cbuffer' bufnr('%')
endfunc