Add option to enable linewrap mode

Implements #1081.