Skip to content

Commit

Permalink
Revert "Fix #6605: Remove soft-wrap.enable option wrapping. (#6656)"
Browse files Browse the repository at this point in the history
This reverts commit af88a3c.
  • Loading branch information
archseer authored Apr 8, 2023
1 parent 25858ec commit 6ebfad1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helix-core/src/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ impl LanguageConfiguration {
#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
pub struct SoftWrap {
/// Soft wrap lines that exceed viewport width. Default to off
pub enable: bool,
pub enable: Option<bool>,
/// Maximum space left free at the end of the line.
/// This space is used to wrap text at word boundaries. If that is not possible within this limit
/// the word is simply split at the end of the line.
Expand Down
5 changes: 3 additions & 2 deletions helix-view/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1444,8 +1444,9 @@ impl Document {
.as_ref()
.and_then(|config| config.soft_wrap.as_ref());
let enable_soft_wrap = language_soft_wrap
.map(|soft_wrap| soft_wrap.enable)
.unwrap_or_else(|| editor_soft_wrap.enable);
.and_then(|soft_wrap| soft_wrap.enable)
.or(editor_soft_wrap.enable)
.unwrap_or(false);
let max_wrap = language_soft_wrap
.and_then(|soft_wrap| soft_wrap.max_wrap)
.or(config.soft_wrap.max_wrap)
Expand Down

0 comments on commit 6ebfad1

Please sign in to comment.