Tidy-up
This commit is contained in:
parent
7f06191c9f
commit
7598030102
6 changed files with 63 additions and 76 deletions
|
@ -2514,7 +2514,6 @@ impl Editor {
|
|||
}
|
||||
|
||||
pub fn insert(&mut self, text: &str, cx: &mut ViewContext<Self>) {
|
||||
dbg!("insert!");
|
||||
self.insert_with_autoindent_mode(
|
||||
text,
|
||||
Some(AutoindentMode::Block {
|
||||
|
|
|
@ -61,10 +61,10 @@ pub fn up_by_rows(
|
|||
goal: SelectionGoal,
|
||||
preserve_column_at_start: bool,
|
||||
) -> (DisplayPoint, SelectionGoal) {
|
||||
let mut goal_column = if let SelectionGoal::Column(column) = goal {
|
||||
column
|
||||
} else {
|
||||
map.column_to_chars(start.row(), start.column())
|
||||
let mut goal_column = match goal {
|
||||
SelectionGoal::Column(column) => column,
|
||||
SelectionGoal::ColumnRange { end, .. } => end,
|
||||
_ => map.column_to_chars(start.row(), start.column()),
|
||||
};
|
||||
|
||||
let prev_row = start.row().saturating_sub(row_count);
|
||||
|
@ -95,10 +95,10 @@ pub fn down_by_rows(
|
|||
goal: SelectionGoal,
|
||||
preserve_column_at_end: bool,
|
||||
) -> (DisplayPoint, SelectionGoal) {
|
||||
let mut goal_column = if let SelectionGoal::Column(column) = goal {
|
||||
column
|
||||
} else {
|
||||
map.column_to_chars(start.row(), start.column())
|
||||
let mut goal_column = match goal {
|
||||
SelectionGoal::Column(column) => column,
|
||||
SelectionGoal::ColumnRange { end, .. } => end,
|
||||
_ => map.column_to_chars(start.row(), start.column()),
|
||||
};
|
||||
|
||||
let new_row = start.row() + row_count;
|
||||
|
|
|
@ -364,7 +364,6 @@ impl MultiBuffer {
|
|||
S: ToOffset,
|
||||
T: Into<Arc<str>>,
|
||||
{
|
||||
dbg!("edit", &autoindent_mode);
|
||||
if self.buffers.borrow().is_empty() {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue