edwinb / idris2-vim

Vim mode for Idris 2
75 stars 26 forks source link

Option to remove ANSI color codes from response window #18

Closed neriglissar closed 4 years ago

neriglissar commented 4 years ago

Hi,

This pull request adds the option to set

let g:idris_disable_ansi_colors = 1

in order to remove the escaped ansi color codes from the repl response. I was getting output such as

^[[38;5;9;1mError:^[[0m ^[[1mWhile processing right hand side of

and this pull request fixes that with a regex substitution. It should be possible to properly render ANSI colors into syntax highlighting by using AnsiEsc.vim, but I have not tried that yet.

In addition, this pull request sets the filetype of the response buffer to unix to suppress syntax highlighting (this happens when you open the response buffer with \i before issuing a command to the repl).

Note: tested on neovim

neriglissar commented 4 years ago

Just noticed the other pull request. I will close this one.