helix-mods/helix-term/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 b247d526d69adf41434b6fd9c4983369c785aa22.

* 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>
2023-03-08 11:02:11 +09:00
..
commands Softwrapping improvements (#5893) 2023-03-08 11:02:11 +09:00
keymap feat(dap): implement Restart request (#5651) 2023-03-06 18:19:53 +09:00
ui DynamicPicker: Recalculate column widths for new options (#6004) 2023-03-08 10:51:52 +09:00
application.rs LSP: Send replies for malformed and unhandled RPC requests (#6058) 2023-03-08 10:50:57 +09:00
args.rs Fix confusion with using --hsplit --vsplit on startup at same time (#4202) 2022-10-11 09:25:42 -04:00
commands.rs Do not add intermediate lines to jumplist with :<linenum> command. (#5751) 2023-03-08 10:53:31 +09:00
compositor.rs bump msrv to 1.63 (#5570) 2023-02-09 11:24:31 +09:00
config.rs Move top level lsp config to editor.lsp (#1868) 2022-03-28 10:11:52 +09:00
health.rs Print the binary required by the debug adapter (#5195) 2022-12-17 13:03:18 -06:00
job.rs bump msrv to 1.63 (#5570) 2023-02-09 11:24:31 +09:00
keymap.rs keymap: Test backslash escaping in commands 2023-01-25 09:31:58 -06:00
lib.rs Fix new clippy lints (#5892) 2023-02-09 16:27:08 -06:00
main.rs feat(lsp): pass client_info on initialization (#4904) 2022-12-08 21:57:03 -06:00