You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/book/src
Clément Delafargue 8dd1ab4899
Softwrapping improvements (#5893)
* use max_line_width + 1 during softwrap to account for newline char

Helix softwrap implementation always wraps lines so that the newline
character doesn't get cut off so he line wraps one chars earlier then
in other editors. This is necessary, because newline chars are always
selecatble in helix and must never be hidden.

However That means that `max_line_width` currently wraps one char
earlier than expected. The typical definition of line width does not
include the newline character and other helix commands like `:reflow`
also don't count the newline character here.

This commit makes softwrap use `max_line_width + 1` instead of
`max_line_width` to correct the impedance missmatch.

* fix typos

Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>

* Add text-width to config.toml

* text-width: update setting documentation

* rename leftover config item

* remove leftover max-line-length occurrences

* Make `text-width` optional in editor config

When it was only used for `:reflow` it made sense to have a default
value set to `80`, but now that soft-wrapping uses this setting, keeping
a default set to `80` would make soft-wrapping behave more aggressively.

* Allow softwrapping to ignore `text-width`

Softwrapping wraps by default to the viewport width or a configured
`text-width` (whichever's smaller). In some cases we only want to set
`text-width` to use for hard-wrapping and let longer lines flow if they
have enough space. This setting allows that.

* Revert "Make `text-width` optional in editor config"

This reverts commit b247d526d6.

* soft-wrap: allow per-language overrides

* Update book/src/configuration.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update book/src/languages.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

* Update book/src/configuration.md

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

---------

Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>
Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
Co-authored-by: Alex Boehm <alexb@ozrunways.com>
Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
2 years ago
..
generated Add command for resetting diff hunks (#5736) 2 years ago
guides Rewrite and refactor all documentation (#5534) 2 years ago
SUMMARY.md Rewrite and refactor all documentation (#5534) 2 years ago
commands.md Rewrite and refactor all documentation (#5534) 2 years ago
configuration.md Softwrapping improvements (#5893) 2 years ago
from-vim.md Fix typos (#3858) 2 years ago
install.md Rewrite and refactor all documentation (#5534) 2 years ago
keymap.md Rewrite and refactor all documentation (#5534) 2 years ago
lang-support.md Rewrite and refactor all documentation (#5534) 2 years ago
languages.md Softwrapping improvements (#5893) 2 years ago
remapping.md Rewrite and refactor all documentation (#5534) 2 years ago
themes.md Rewrite and refactor all documentation (#5534) 2 years ago
title-page.md book: add wiki links to the title page and install page (#3017) 2 years ago
usage.md Rewrite and refactor all documentation (#5534) 2 years ago