snippets: Preserve leading whitespace (#31933)
Closes #18481 Release Notes: - Snippet insertions now preserve leading whitespace instead of using language-specific auto-indentation.
This commit is contained in:
@@ -8929,7 +8929,10 @@ impl Editor {
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|range| (range, snippet_text.clone()));
|
||||
buffer.edit(edits, Some(AutoindentMode::EachLine), cx);
|
||||
let autoindent_mode = AutoindentMode::Block {
|
||||
original_indent_columns: Vec::new(),
|
||||
};
|
||||
buffer.edit(edits, Some(autoindent_mode), cx);
|
||||
|
||||
let snapshot = &*buffer.read(cx);
|
||||
let snippet = &snippet;
|
||||
|
||||
Reference in New Issue
Block a user