aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_quickfix.vim
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-12 15:04:44 -0500
committerJames McCoy <jamessan@jamessan.com>2016-12-27 14:10:01 -0500
commit39faa56bce66796f731ec339301acc3d303c08e9 (patch)
treed439d5a3f390e5014a25beed3124fe66150408ca /src/nvim/testdir/test_quickfix.vim
parent29d7a597115b692a7e2e39d213b87ac566444a5c (diff)
downloadrneovim-39faa56bce66796f731ec339301acc3d303c08e9.tar.gz
rneovim-39faa56bce66796f731ec339301acc3d303c08e9.tar.bz2
rneovim-39faa56bce66796f731ec339301acc3d303c08e9.zip
vim-patch:7.4.1802
Problem: Quickfix doesn't handle long lines well, they are split. Solution: Drop characters after a limit. (Anton Lindqvist) https://github.com/vim/vim/commit/6be8c8e165204b8aa4eeb8a52be87a58d8b41b9e
Diffstat (limited to 'src/nvim/testdir/test_quickfix.vim')
-rw-r--r--src/nvim/testdir/test_quickfix.vim37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index 2c6f3c922a..d43ab1e6db 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -813,3 +813,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