From 0861ea6949a0c7281c56083092d389cae5d7bde8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 23 Feb 2025 17:06:54 +0800 Subject: vim-patch:9.1.1139: [fifo] is not displayed when editing a fifo Problem: [fifo] is not displayed when editing a fifo (after v7.4.2189) Solution: stat the filename and detect the type correctly fixes: vim/vim#16702 closes: vim/vim#16705 https://github.com/vim/vim/commit/f1c3134ee1f263e537212a3072e8aa4cb7e8d953 Co-authored-by: Christian Brabandt --- test/old/testdir/test_startup_utf8.vim | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_startup_utf8.vim b/test/old/testdir/test_startup_utf8.vim index e8b99e7937..96b593f1bd 100644 --- a/test/old/testdir/test_startup_utf8.vim +++ b/test/old/testdir/test_startup_utf8.vim @@ -60,6 +60,34 @@ func Test_read_fifo_utf8() call delete('Xtestout') endfunc +func Test_detect_fifo() + CheckUnix + " Using bash/zsh's process substitution. + if executable('bash') + set shell=bash + elseif executable('zsh') + set shell=zsh + else + throw 'Skipped: bash or zsh is required' + endif + let linesin = ['one', 'two'] + call writefile(linesin, 'Xtestin_fifo', 'D') + let after = [ + \ 'call writefile(split(execute(":mess"), "\\n"), "Xtestout")', + \ 'quit!', + \ ] + " if RunVim([], after, '<(cat Xtestin_fifo)') + if RunVim(['set shortmess-=F'], after, '<(cat Xtestin_fifo)') + let lines = readfile('Xtestout') + call assert_match('\[fifo\]', lines[0]) + " call assert_match('\[fifo\]', lines[1]) + else + call assert_equal('', 'RunVim failed.') + endif + + call delete('Xtestout') +endfunc + func Test_detect_ambiwidth() CheckRunVimInTerminal -- cgit