Difference between hard wrap and soft wrap?

后端 未结 3 539
一整个雨季
一整个雨季 2020-12-07 12:23

I am in the process of writing a text editor. After looking at other text editors I have noticed that a number of them refer to a \"soft\" versus \"hard\" wrap. What is th

3条回答
  •  渐次进展
    2020-12-07 12:26

    It's usual for text editors to auto-wrap text into paragraphs with hard newlines, but it's less common for the text to be re-flowed into a nice paragraph if you come back later and edit/add/remove words later on. (You can do this manually in emacs with M-q.)

    This is rather annoying, since obsessive compulsive people like me then go back and have to manually re-insert the hard breaks at the appropriate points.

    On the other hand, soft wrapping is annoying because most all command line tools use line-based diff-ing (version control is where this becomes most noticeable to me). If you've got a 1/3-page paragraph that's soft wrapped and fix a typo, it's basically impossible to see where the change is in a regular diff output or similar.

提交回复
热议问题