From d48a3b32b5910c3086491e8e3017b806f208e089 Mon Sep 17 00:00:00 2001 From: Robin Gertenbach Date: Mon, 15 Jun 2026 09:02:13 -0700 Subject: [PATCH] Support Neovim's UI2 --- autoload/maktaba/command.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/autoload/maktaba/command.vim b/autoload/maktaba/command.vim index 64677b0..a6a947d 100644 --- a/autoload/maktaba/command.vim +++ b/autoload/maktaba/command.vim @@ -13,6 +13,11 @@ function! maktaba#command#GetOutput(command) abort " Example: #GetOutput('echo') return l:output else + " Neovim's UI2 handles captured output differently. + if has('nvim') && luaeval('pcall(require, "vim._core.ui2") and (require("vim._core.ui2").cfg ~= nil) and true or false') + return l:output + endif + " Vim will dump an extra newline at the beginning of the redir output. " Yeah, I think it's dumb too. call maktaba#ensure#IsTrue(