on master help sign in
Fix #6605: Remove soft-wrap.enable option wrapping. (#6656)

Co-authored-by: gibbz00 <gabrielhansson@gmail.com>

commitaf88a3c15cc4ddbb1e2f2ea6492868ffb8aba40b authorgibbz00 <gabrielhansson00@gmail.com> dateSat 8 Apr 2023, 14:18 (4 years ago) parente856906
2 files changed+3−4
helix-core/src/syntax.rs+1−1 helix-view/src/document.rs+2−3
helix-core/src/syntax.rs+1−1
@@ -555,7 +555,7 @@ impl LanguageConfiguration {
555555#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
556556pub struct SoftWrap {
557557 /// Soft wrap lines that exceed viewport width. Default to off
558− pub enable: Option<bool>,
558+ pub enable: bool,
559559 /// Maximum space left free at the end of the line.
560560 /// This space is used to wrap text at word boundaries. If that is not possible within this limit
561561 /// the word is simply split at the end of the line.
helix-view/src/document.rs+2−3
@@ -1444,9 +1444,8 @@ impl Document {
14441444 .as_ref()
14451445 .and_then(|config| config.soft_wrap.as_ref());
14461446 let enable_soft_wrap = language_soft_wrap
1447− .and_then(|soft_wrap| soft_wrap.enable)
1448− .or(editor_soft_wrap.enable)
1449− .unwrap_or(false);
1447+ .map(|soft_wrap| soft_wrap.enable)
1448+ .unwrap_or_else(|| editor_soft_wrap.enable);
14501449 let max_wrap = language_soft_wrap
14511450 .and_then(|soft_wrap| soft_wrap.max_wrap)
14521451 .or(config.soft_wrap.max_wrap)