~torresjrjr/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH vim-haredoc] Strip away escape sequences in Neovim

Details
Message ID
<20231028133602.41715-2-max@mxsr.de>
DKIM signature
missing
Download raw message
Patch: +2 -0
---
 plugin/haredoc.vim | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugin/haredoc.vim b/plugin/haredoc.vim
index 3502184..b9299ce 100644
--- a/plugin/haredoc.vim
+++ b/plugin/haredoc.vim
@@ -76,6 +76,8 @@ function Haredoc(symbol)
		nnoremap <buffer> q  :close<CR>
		nnoremap <buffer> <nowait> u  <C-U>
		nnoremap <buffer> <nowait> d  <C-D>
	elseif has('nvim')
		execute '!haredoc "'..trim(symbol)..'" | sed -e "s/\x1b\[[0-9;]*m//g"'
	else
		execute '!haredoc '..symbol
	endif
-- 
2.42.0
Details
Message ID
<CWK4LSJAM68R.3GURYUA3ENVN8@torresjrjr.com>
In-Reply-To
<20231028133602.41715-2-max@mxsr.de> (view parent)
DKIM signature
missing
Download raw message
Hi Max,

On Sat Oct 28, 2023 at 2:36 PM BST, Max Schillinger wrote:
> @@ -76,6 +76,8 @@ function Haredoc(symbol)
>  		nnoremap <buffer> q  :close<CR>
>  		nnoremap <buffer> <nowait> u  <C-U>
>  		nnoremap <buffer> <nowait> d  <C-D>
> +	elseif has('nvim')
> +		execute '!haredoc "'..trim(symbol)..'" | sed -e "s/\x1b\[[0-9;]*m//g"'

Normally, vim-haredoc tries to display coloured output, which is what
haredoc(1) does by default, or when passed the -Ftty option.

Assuming neovim cannot handle such output and wants plaintext, normally
one would ask haredoc(1) for plaintext with -Fhare. However, recently
this feature has been removed for reasons I don't know, and I'm
discussing this on IRC. Feel free to join us at #hare on
<irc.libera.chat>. I'd rather the upstream be fix than we do a
workaround.

Assuming neovim can handle such coloured output and you want coloured
output, perhaps we ought to write a patch for that instead.

As a neovim user, what's your opinion?
Details
Message ID
<CWK7SADXWKPF.10BJOLETLSCAC@mxsr.de>
In-Reply-To
<CWK4LSJAM68R.3GURYUA3ENVN8@torresjrjr.com> (view parent)
DKIM signature
missing
Download raw message
On Sat Oct 28, 2023 at 4:01 PM CEST, Byron Torres wrote:
> Normally, vim-haredoc tries to display coloured output, which is what
> haredoc(1) does by default, or when passed the -Ftty option.
>
> Assuming neovim cannot handle such output and wants plaintext, normally
> one would ask haredoc(1) for plaintext with -Fhare. However, recently
> this feature has been removed for reasons I don't know, and I'm
> discussing this on IRC. Feel free to join us at #hare on
> <irc.libera.chat>. I'd rather the upstream be fix than we do a
> workaround.

Hello Byron,

yes, not adding colors in the first place makes more sense than adding 
and then removing them.

> Assuming neovim can handle such coloured output and you want coloured
> output, perhaps we ought to write a patch for that instead.
>
> As a neovim user, what's your opinion?

I would prefer to get a colored output in Neovim as well. Have you 
already seen my alternative patch?

https://lists.sr.ht/~torresjrjr/public-inbox/patches/46178

This uses a real terminal which can handle colors.

Best regards,
Max
Reply to thread Export thread (mbox)