From 1bad3b0dd4eca1cf85b1892eebc0d21699ee062d Mon Sep 17 00:00:00 2001 From: arcofx <105167958+arcofx@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:27:42 +0300 Subject: [PATCH] Make `format_selections` respect document configuration (#11169) --- helix-term/src/commands.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index f25e8254c992..69496eb61619 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -4523,7 +4523,11 @@ fn format_selections(cx: &mut Context) { .text_document_range_formatting( doc.identifier(), range, - lsp::FormattingOptions::default(), + lsp::FormattingOptions { + tab_size: doc.tab_width() as u32, + insert_spaces: matches!(doc.indent_style, IndentStyle::Spaces(_)), + ..Default::default() + }, None, ) .unwrap();