aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-03 19:09:19 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-03 21:21:47 +0800
commitb69c5817619c8922039e75e9aaaed06ae35ee002 (patch)
treef1b7a9024ba32ad31e1a376d5529abaf0daf1adf /src/nvim/testdir
parente7a2ae829ae92476b67ca86b039d6b79208080d8 (diff)
downloadrneovim-b69c5817619c8922039e75e9aaaed06ae35ee002.tar.gz
rneovim-b69c5817619c8922039e75e9aaaed06ae35ee002.tar.bz2
rneovim-b69c5817619c8922039e75e9aaaed06ae35ee002.zip
vim-patch:8.2.3992: wrong local-additions in the help with language mix
Problem: Wrong local-additions in the help with language mix. Solution: Adjust how the local additions list is generated. (Hirohito Higashi, closes vim/vim#9464) https://github.com/vim/vim/commit/0e2508d9e63e63414de2c06b3c8a446fdfe4470b Co-authored-by: h-east <h.east.727@gmail.com>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_help.vim40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/nvim/testdir/test_help.vim b/src/nvim/testdir/test_help.vim
index 2ba30ce57f..b370a1e13e 100644
--- a/src/nvim/testdir/test_help.vim
+++ b/src/nvim/testdir/test_help.vim
@@ -96,16 +96,42 @@ func Test_help_local_additions()
call writefile(['*mydoc-ext.txt* my extended awesome doc'], 'Xruntime/doc/mydoc-ext.txt')
let rtp_save = &rtp
set rtp+=./Xruntime
- help
- 1
- call search('mydoc.txt')
- call assert_equal('|mydoc.txt| my awesome doc', getline('.'))
- 1
- call search('mydoc-ext.txt')
- call assert_equal('|mydoc-ext.txt| my extended awesome doc', getline('.'))
+ help local-additions
+ let lines = getline(line(".") + 1, search("^$") - 1)
+ call assert_equal([
+ \ '|mydoc-ext.txt| my extended awesome doc',
+ \ '|mydoc.txt| my awesome doc'
+ \ ], lines)
+ call delete('Xruntime/doc/mydoc-ext.txt')
+ close
+
+ call mkdir('Xruntime-ja/doc', 'p')
+ call writefile(["local-additions\thelp.jax\t/*local-additions*"], 'Xruntime-ja/doc/tags-ja')
+ call writefile(['*help.txt* This is jax file', '',
+ \ 'LOCAL ADDITIONS: *local-additions*', ''], 'Xruntime-ja/doc/help.jax')
+ call writefile(['*work.txt* This is jax file'], 'Xruntime-ja/doc/work.jax')
+ call writefile(['*work2.txt* This is jax file'], 'Xruntime-ja/doc/work2.jax')
+ set rtp+=./Xruntime-ja
+
+ help local-additions@en
+ let lines = getline(line(".") + 1, search("^$") - 1)
+ call assert_equal([
+ \ '|mydoc.txt| my awesome doc'
+ \ ], lines)
+ close
+
+ help local-additions@ja
+ let lines = getline(line(".") + 1, search("^$") - 1)
+ call assert_equal([
+ \ '|mydoc.txt| my awesome doc',
+ \ '|help.txt| This is jax file',
+ \ '|work.txt| This is jax file',
+ \ '|work2.txt| This is jax file',
+ \ ], lines)
close
call delete('Xruntime', 'rf')
+ call delete('Xruntime-ja', 'rf')
let &rtp = rtp_save
endfunc