OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
200 stars 63 forks source link

--help=plain and Latin1 non-breakable space. #318

Open vrotaru opened 3 years ago

vrotaru commented 3 years ago

That's what I get when run ocp-indent --help=plain on Fedora in gnome-terminal. (but the problem is probably, more general) image

The problem is the pre function in IndentConfig which generates a list of `P lines separated with `Noblank to emulate a pre-formated block. it also replaces leading spaces with \xa0 (Latin1 non-breakable space).

Which does not render correctly on UTF-8 terminals. It also seems quite unnecessay since the is support for \'Pre block in cmdliner. This below seem to fix the problem.

   let pre s = [`Pre s]

Let me know if you want a PR.