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:
parent
feeda7fa37
commit
56d4c0af9f
3 changed files with 119 additions and 98 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue