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 the difference? I can't seem to find the answer by searching.
相关问题
- How to get CATextLayer’s wrapping count in order t
- iText page wrapping- changes order of elements
- Auto wrap and newlines in wxPython grid
- How to call C++ functions of a class from a Python
- Java Mappings and Primitives
相关文章
- 包裹C ++类的API对C消费(Wrapping C++ class API for C consu
- 有什么办法在79个字符来获得vim的自动换行Python字符串?(Is there any way
- How to get CATextLayer’s wrapping count in order t
- iText page wrapping- changes order of elements
- Auto wrap and newlines in wxPython grid
- How to call C++ functions of a class from a Python
- Java Mappings and Primitives
- android convert text width (in pixels) to percent
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.soft : The text in the textarea is not wrapped when submitted in a form. This is default
hard : The text in the textarea is wrapped (contains newlines) when submitted in a form. When "hard" is used, the cols attribute must be specified
Reference: W3Schools
A hard wrap inserts actual line breaks in the text at wrap points, with soft wrapping the actual text is still on the same line but looks like it's divided into several lines.