diff options
Diffstat (limited to 'src/testdir/test_history.vim')
-rw-r--r-- | src/testdir/test_history.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_history.vim b/src/testdir/test_history.vim index 1bea78d5a8..f1c31dee04 100644 --- a/src/testdir/test_history.vim +++ b/src/testdir/test_history.vim @@ -98,6 +98,22 @@ function Test_History() call assert_fails('call histdel(":", "\\%(")', 'E53:') endfunction +function Test_history_truncates_long_entry() + " History entry short enough to fit on the screen should not be truncated. + call histadd(':', 'echo x' .. repeat('y', &columns - 17) .. 'z') + let a = execute('history : -1') + + call assert_match("^\n # cmd history\n" + \ .. "> *\\d\\+ echo x" .. repeat('y', &columns - 17) .. 'z$', a) + + " Long history entry should be truncated to fit on the screen, with, '...' + " inserted in the string to indicate the that there is truncation. + call histadd(':', 'echo x' .. repeat('y', &columns - 16) .. 'z') + let a = execute('history : -1') + call assert_match("^\n # cmd history\n" + \ .. "> *\\d\\+ echo xy\\+\.\.\.y\\+z$", a) +endfunction + function Test_Search_history_window() new call setline(1, ['a', 'b', 'a', 'b']) |