Mercurial > vim
diff src/testdir/test_quickfix.vim @ 9033:0536d1469b67 v7.4.1802
commit https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 30 13:17:09 2016 +0200
patch 7.4.1802
Problem: Quickfix doesn't handle long lines well, they are split.
Solution: Drop characters after a limit. (Anton Lindqvist)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 30 Apr 2016 13:30:05 +0200 |
parents | 90f7dc794aa0 |
children | f221aec7fcca |
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -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