mirror of https://github.com/helix-editor/helix
This caused a bug that would ignore the global config.
This reverts commit af88a3c15c
.
pull/6552/head^2
parent
25858ec2e3
commit
58e457a4e1
|
@ -555,7 +555,9 @@ impl LanguageConfiguration {
|
||||||
#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
|
#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
|
||||||
pub struct SoftWrap {
|
pub struct SoftWrap {
|
||||||
/// Soft wrap lines that exceed viewport width. Default to off
|
/// Soft wrap lines that exceed viewport width. Default to off
|
||||||
pub enable: bool,
|
// NOTE: Option on purpose because the struct is shared between language config and global config.
|
||||||
|
// By default the option is None so that the language config falls back to the global config unless explicitly set.
|
||||||
|
pub enable: Option<bool>,
|
||||||
/// Maximum space left free at the end of the line.
|
/// 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
|
/// 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.
|
/// the word is simply split at the end of the line.
|
||||||
|
|
|
@ -1444,8 +1444,9 @@ impl Document {
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|config| config.soft_wrap.as_ref());
|
.and_then(|config| config.soft_wrap.as_ref());
|
||||||
let enable_soft_wrap = language_soft_wrap
|
let enable_soft_wrap = language_soft_wrap
|
||||||
.map(|soft_wrap| soft_wrap.enable)
|
.and_then(|soft_wrap| soft_wrap.enable)
|
||||||
.unwrap_or_else(|| editor_soft_wrap.enable);
|
.or(editor_soft_wrap.enable)
|
||||||
|
.unwrap_or(false);
|
||||||
let max_wrap = language_soft_wrap
|
let max_wrap = language_soft_wrap
|
||||||
.and_then(|soft_wrap| soft_wrap.max_wrap)
|
.and_then(|soft_wrap| soft_wrap.max_wrap)
|
||||||
.or(config.soft_wrap.max_wrap)
|
.or(config.soft_wrap.max_wrap)
|
||||||
|
|
Loading…
Reference in New Issue