git: Hard wrap in editor (#26507)
This adds the ability for the editor to implement hard wrap (similar to "textwidth" in vim). If you are typing and your line extends beyond the limit, a newline is inserted before the most recent space on the line. If you are otherwise editing the line, pasting, etc. then you will need to manually rewrap. Release Notes: - git: Commit messages are now wrapped "as you type" to 72 characters.
This commit is contained in:
parent
7bca15704b
commit
c8b782d870
4 changed files with 61 additions and 17 deletions
|
@ -367,6 +367,7 @@ pub(crate) fn commit_message_editor(
|
|||
commit_editor.set_show_gutter(false, cx);
|
||||
commit_editor.set_show_wrap_guides(false, cx);
|
||||
commit_editor.set_show_indent_guides(false, cx);
|
||||
commit_editor.set_hard_wrap(Some(72), cx);
|
||||
let placeholder = placeholder.unwrap_or("Enter commit message");
|
||||
commit_editor.set_placeholder_text(placeholder, cx);
|
||||
commit_editor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue