@@ -42,7 +42,7 @@ pub use helix_core::diagnostic::Severity;
42pub use helix_core::register::Registers;
42pub use helix_core::register::Registers;
43use helix_core::{
43use helix_core::{
44 auto_pairs::AutoPairs,
44 auto_pairs::AutoPairs,
45− syntax::{self, AutoPairConfig},
45+ syntax::{self, AutoPairConfig, SoftWrap},
48use helix_core::{Position, Selection};
48use helix_core::{Position, Selection};
@@ -241,6 +241,8 @@ pub struct Config {
241 pub auto_format: bool,
241 pub auto_format: bool,
242 /// Automatic save on focus lost. Defaults to false.
242 /// Automatic save on focus lost. Defaults to false.
243 pub auto_save: bool,
243 pub auto_save: bool,
244+ /// Set a global text_width
245+ pub text_width: usize,
244 /// Time in milliseconds since last keypress before idle timers trigger.
246 /// Time in milliseconds since last keypress before idle timers trigger.
245 /// Used for autocompletion, set to 0 for instant. Defaults to 400ms.
247 /// Used for autocompletion, set to 0 for instant. Defaults to 400ms.
@@ -276,43 +278,6 @@ pub struct Config {
276 pub soft_wrap: SoftWrap,
278 pub soft_wrap: SoftWrap,
279−#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
280−#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
281−pub struct SoftWrap {
282− /// Soft wrap lines that exceed viewport width. Default to off
284− /// Maximum space left free at the end of the line.
285− /// This space is used to wrap text at word boundaries. If that is not possible within this limit
286− /// the word is simply split at the end of the line.
288− /// This is automatically hard-limited to a quarter of the viewport to ensure correct display on small views.
292− /// Maximum number of indentation that can be carried over from the previous line when softwrapping.
293− /// If a line is indented further then this limit it is rendered at the start of the viewport instead.
295− /// This is automatically hard-limited to a quarter of the viewport to ensure correct display on small views.
298− pub max_indent_retain: u16,
299− /// Indicator placed at the beginning of softwrapped lines
302− pub wrap_indicator: String,
305−impl Default for SoftWrap {
306− fn default() -> Self {
310− max_indent_retain: 40,
311− wrap_indicator: "↪ ".into(),
316#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
281#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
317#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
282#[serde(default, rename_all = "kebab-case", deny_unknown_fields)]
318pub struct TerminalConfig {
283pub struct TerminalConfig {
@@ -772,6 +737,7 @@ impl Default for Config {
772 indent_guides: IndentGuidesConfig::default(),
737 indent_guides: IndentGuidesConfig::default(),
773 color_modes: false,
738 color_modes: false,
774 soft_wrap: SoftWrap::default(),
739 soft_wrap: SoftWrap::default(),