aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/cmdline.txt7
-rw-r--r--src/nvim/testdir/test_history.vim24
-rw-r--r--src/nvim/version.c2
3 files changed, 30 insertions, 3 deletions
diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt
index d870a72600..652487d8ab 100644
--- a/runtime/doc/cmdline.txt
+++ b/runtime/doc/cmdline.txt
@@ -327,8 +327,11 @@ terminals)
List entries 6 to 12 from the search history: >
:history / 6,12
<
- List the recent five entries from all histories: >
- :history all -5,
+ List the penultimate entry from all histories: >
+ :history all -2
+<
+ List the most recent two entries from all histories: >
+ :history all -2,
:keepp[atterns] {command} *:keepp* *:keeppatterns*
Execute {command}, without adding anything to the search
diff --git a/src/nvim/testdir/test_history.vim b/src/nvim/testdir/test_history.vim
index 3163b344d3..ca31e3f06c 100644
--- a/src/nvim/testdir/test_history.vim
+++ b/src/nvim/testdir/test_history.vim
@@ -31,6 +31,30 @@ function History_Tests(hist)
call assert_equal('ls', histget(a:hist, -1))
call assert_equal(4, histnr(a:hist))
+ let a=execute('history ' . a:hist)
+ call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
+ let a=execute('history all')
+ call assert_match("^\n # .* history\n 3 buffers\n> 4 ls", a)
+
+ if len(a:hist) > 0
+ let a=execute('history ' . a:hist . ' 2')
+ call assert_match("^\n # \\S* history$", a)
+ let a=execute('history ' . a:hist . ' 3')
+ call assert_match("^\n # \\S* history\n 3 buffers$", a)
+ let a=execute('history ' . a:hist . ' 4')
+ call assert_match("^\n # \\S* history\n> 4 ls$", a)
+ let a=execute('history ' . a:hist . ' 3,4')
+ call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
+ let a=execute('history ' . a:hist . ' -1')
+ call assert_match("^\n # \\S* history\n> 4 ls$", a)
+ let a=execute('history ' . a:hist . ' -2')
+ call assert_match("^\n # \\S* history\n 3 buffers$", a)
+ let a=execute('history ' . a:hist . ' -2,')
+ call assert_match("^\n # \\S* history\n 3 buffers\n> 4 ls$", a)
+ let a=execute('history ' . a:hist . ' -3')
+ call assert_match("^\n # \\S* history$", a)
+ endif
+
" Test for removing entries matching a pattern
for i in range(1, 3)
call histadd(a:hist, 'text_' . i)
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d4d2af2f26..1ecda654d1 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -841,7 +841,7 @@ static const int included_patches[] = {
// 114 NA
// 113 NA
// 112,
- // 111,
+ 111,
110,
// 109 NA
// 108 NA