aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorBlaž Hrastnik2023-04-08 12:50:43 +0000
committerBlaž Hrastnik2023-04-08 12:52:34 +0000
commit58e457a4e1037caf43c17dea93c5321c1ae74103 (patch)
treed049444df437fb193fc5e6356c0daea89abc85ea /helix-view
parent25858ec2e3265a2cfc562e39136beb76df77953b (diff)
Revert "Fix #6605: Remove soft-wrap.enable option wrapping. (#6656)"
This caused a bug that would ignore the global config. This reverts commit af88a3c15cc4ddbb1e2f2ea6492868ffb8aba40b.
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 65a5a6e2..eca60026 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -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)