Unnamed repository; edit this file 'description' to name the repository.
Make `format_selections` respect document configuration (#11169)
arcofx 2024-07-15
parent 079f544 · commit 1bad3b0
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index f25e8254..69496eb6 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();