From a5c55d200b18a08341114d34bb2badfac97a54ad Mon Sep 17 00:00:00 2001 From: glepnir Date: Mon, 23 Jun 2025 20:41:31 +0800 Subject: [PATCH] fix(cmd): bar "|" not allowed after :fclose #34613 Problem: `:fclose` command failed when used with trailing `|` bar. Solution: Add `TRLBAR` flag to fclose command to support trailing bar. --- src/nvim/ex_cmds.lua | 2 +- test/functional/ui/float_spec.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/ex_cmds.lua b/src/nvim/ex_cmds.lua index c6f8baade5..246a0a91ec 100644 --- a/src/nvim/ex_cmds.lua +++ b/src/nvim/ex_cmds.lua @@ -1052,7 +1052,7 @@ M.cmds = { }, { command = 'fclose', - flags = bit.bor(BANG, RANGE), + flags = bit.bor(BANG, RANGE, TRLBAR), addr_type = 'ADDR_OTHER', func = 'ex_fclose', }, diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 83801e7679..dbd16a9d91 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -10654,6 +10654,8 @@ describe('float window', function() | ]]) end + -- allow use with trailing bar + eq('hello', n.exec_capture('fclose | echo "hello"')) end) it('correctly placed in or above message area', function()