From 7090555daba6bce37dc6cc900387015a10a1e791 Mon Sep 17 00:00:00 2001 From: Em Zhan Date: Mon, 11 Sep 2023 19:06:25 -0500 Subject: Add `insert-final-newline` config option (#8157) Co-authored-by: Xalfer <64538944+Xalfer@users.noreply.github.com>--- helix-view/src/editor.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 6963867a..2265633d 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -287,6 +287,8 @@ pub struct Config { pub workspace_lsp_roots: Vec, /// Which line ending to choose for new documents. Defaults to `native`. i.e. `crlf` on Windows, otherwise `lf`. pub default_line_ending: LineEndingConfig, + /// Whether to automatically insert a trailing line-ending on write if missing. Defaults to `true`. + pub insert_final_newline: bool, /// Enables smart tab pub smart_tab: Option, } @@ -842,6 +844,7 @@ impl Default for Config { completion_replace: false, workspace_lsp_roots: Vec::new(), default_line_ending: LineEndingConfig::default(), + insert_final_newline: true, smart_tab: Some(SmartTabConfig::default()), } } -- cgit v1.2.3-70-g09d2