implemented formatter for selection

This commit is contained in:
toxicvipa committed 2024-03-09 15:06:31 +01:00
1 parent 60235ac06b
commit f5a57c7693
3 files changed
+65 -6

No files matched your search

+7 -2
View File
@@ -22,10 +22,15 @@ pub fn format_rsx(raw: String, use_tabs: bool, indent_size: usize) -> String {
}
#[wasm_bindgen]
pub fn format_selection(raw: String, use_tabs: bool, indent_size: usize) -> String {
pub fn format_selection(
raw: String,
use_tabs: bool,
indent_size: usize,
base_indent: usize,
) -> String {
let block = dioxus_autofmt::fmt_block(
&raw,
0,
base_indent,
IndentOptions::new(
if use_tabs {
IndentType::Tabs