From 72794b36d95e277b93487f0882f9697dcda59aa5 Mon Sep 17 00:00:00 2001 From: Neil Kirsopp Date: Thu, 20 Mar 2014 16:50:40 +0000 Subject: [PATCH 1/2] Remove ANSI from standard out --- plugin/fireplace.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index 7a4e766..1234a66 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -546,7 +546,7 @@ function! s:output_response(response) abort echohl NONE endif if get(a:response, 'out', '') !=# '' - echo substitute(a:response.out, '\r\|\n$', '', 'g') + echo substitute(a:response.out, '\e\[[0-9;]\+m\|\r\|\n$', '', 'g') endif endfunction From 77b06741ef36abc9ad0d7b5b01c3c748734cb21e Mon Sep 17 00:00:00 2001 From: Neil Kirsopp Date: Thu, 20 Mar 2014 17:11:10 +0000 Subject: [PATCH 2/2] Remove ANSI escapes from stderr as well --- plugin/fireplace.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index 1234a66..6ba9a93 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -540,13 +540,14 @@ function! fireplace#quickfix_for(stacktrace) abort endfunction function! s:output_response(response) abort + let substitution_pat = '\e\[[0-9;]*m\|\r\|\n$' if get(a:response, 'err', '') !=# '' echohl ErrorMSG - echo substitute(a:response.err, '\r\|\n$', '', 'g') + echo substitute(a:response.err, substitution_pat, '', 'g') echohl NONE endif if get(a:response, 'out', '') !=# '' - echo substitute(a:response.out, '\e\[[0-9;]\+m\|\r\|\n$', '', 'g') + echo substitute(a:response.out, substitution_pat, '', 'g') endif endfunction