helix/helix-core/src
Vince Mutolo f9baced216
add reflow command (#2128)
* add reflow command

Users need to be able to hard-wrap text for many applications, including
comments in code, git commit messages, plaintext documentation, etc. It
often falls to the user to manually insert line breaks where appropriate
in order to hard-wrap text.

This commit introduces the "reflow" command (both in the TUI and core
library) to automatically hard-wrap selected text to a given number of
characters (defined by Unicode "extended grapheme clusters"). It handles
lines with a repeated prefix, such as comments ("//") and indentation.

* reflow: consider newlines to be word separators

* replace custom reflow impl with textwrap crate

* Sync reflow command docs with book

* reflow: add default max_line_len language setting

Co-authored-by: Vince Mutolo <vince@mutolo.org>
2022-05-02 23:24:22 +09:00
..
increment Replace tendril with smartstring 2022-02-10 11:12:47 +09:00
auto_pairs.rs Configurable auto pairs (#1624) 2022-02-25 17:36:54 +09:00
chars.rs Temporarily turn on unicode-lines 2022-03-17 10:53:50 +09:00
comment.rs Fix toggle_comments command on multiple selections (#1882) 2022-04-05 10:01:58 +09:00
config.rs Add support for local language configuration (#1249) 2022-04-18 12:10:51 +09:00
diagnostic.rs feat(lsp): configurable diagnostic severity (#1325) 2021-12-25 14:32:43 +09:00
diff.rs Fix Clippy lints in tests (#1563) 2022-01-23 16:37:23 +09:00
graphemes.rs Optimize rendering by using Ropey::byte_slice 2022-03-17 09:29:47 +09:00
history.rs fix typos (#2304) 2022-04-27 14:21:20 -05:00
indent.rs Indentation rework (#1562) 2022-03-31 00:08:07 +09:00
lib.rs add reflow command (#2128) 2022-05-02 23:24:22 +09:00
line_ending.rs Add (prev) paragraph motion 2022-04-03 00:46:53 +09:00
macros.rs Split parts of helix-term into helix-view. 2020-09-21 18:24:16 +09:00
match_brackets.rs Fix match brackets comment (#1346) 2021-12-24 07:27:31 +05:30
movement.rs Remove usage of format ident feature from tests (#2028) 2022-04-08 21:26:50 +05:30
object.rs add select_next_sibling and select_prev_sibling commands (#1495) 2022-01-21 00:52:33 +09:00
path.rs fix typos (#2304) 2022-04-27 14:21:20 -05:00
position.rs Fix tab rendering to use dynamic tab width 2022-03-04 11:01:33 +09:00
register.rs Show infobox with register contents 2022-02-10 10:52:06 +09:00
search.rs Jump to the next number on the line before incrementing (#1778) 2022-04-01 22:14:37 +09:00
selection.rs Fix Clippy lints in tests (#1563) 2022-01-23 16:37:23 +09:00
shellwords.rs Open files with spaces in filename, allow opening multiple files (#1231) 2021-12-12 21:13:33 +09:00
state.rs Reduce State use a bit further 2021-08-26 09:21:07 +09:00
surround.rs Fix tests for surround primitives 2022-04-29 15:51:14 +09:00
syntax.rs add reflow command (#2128) 2022-05-02 23:24:22 +09:00
test.rs Remove usage of format ident feature from tests (#2028) 2022-04-08 21:26:50 +05:30
textobject.rs Add `m` textobject to select closest surround pair 2022-04-29 15:51:14 +09:00
transaction.rs core: transaction: Resolve some TODOs 2022-03-03 17:04:25 +09:00
wrap.rs add reflow command (#2128) 2022-05-02 23:24:22 +09:00