Introduce AutoindentMode parameter to Buffer::edit
This controls whether or not we preserve the relative indentation of inserted text blocks. Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This commit is contained in:
parent
cdf6ae25bb
commit
fa5af4383d
18 changed files with 308 additions and 236 deletions
|
@ -13,7 +13,7 @@ use change::init as change_init;
|
|||
use collections::HashSet;
|
||||
use editor::{Autoscroll, Bias, ClipboardSelection, DisplayPoint};
|
||||
use gpui::{actions, MutableAppContext, ViewContext};
|
||||
use language::{Point, SelectionGoal};
|
||||
use language::{AutoindentMode, Point, SelectionGoal};
|
||||
use workspace::Workspace;
|
||||
|
||||
use self::{change::change_over, delete::delete_over, yank::yank_over};
|
||||
|
@ -278,7 +278,7 @@ fn paste(_: &mut Workspace, _: &Paste, cx: &mut ViewContext<Workspace>) {
|
|||
}
|
||||
}
|
||||
drop(snapshot);
|
||||
buffer.edit_with_autoindent(edits, cx);
|
||||
buffer.edit(edits, Some(AutoindentMode::Independent), cx);
|
||||
});
|
||||
|
||||
editor.change_selections(Some(Autoscroll::Fit), cx, |s| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue