Fix bug in vim visual block mode
This commit is contained in:
parent
1c36134cf9
commit
352a554c74
2 changed files with 2 additions and 8 deletions
|
@ -302,11 +302,7 @@ impl Line {
|
||||||
prev_x = glyph.position.x();
|
prev_x = glyph.position.x();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if self.width() - x < x - prev_x {
|
prev_index
|
||||||
prev_index + 1
|
|
||||||
} else {
|
|
||||||
prev_index
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn paint(
|
pub fn paint(
|
||||||
|
|
|
@ -156,7 +156,7 @@ pub fn visual_block_motion(
|
||||||
};
|
};
|
||||||
let mut goal = SelectionGoal::HorizontalRange { start, end };
|
let mut goal = SelectionGoal::HorizontalRange { start, end };
|
||||||
|
|
||||||
let was_reversed = head_x > tail_x;
|
let was_reversed = tail_x > head_x;
|
||||||
if !was_reversed && !preserve_goal {
|
if !was_reversed && !preserve_goal {
|
||||||
head = movement::saturating_left(map, head);
|
head = movement::saturating_left(map, head);
|
||||||
}
|
}
|
||||||
|
@ -184,8 +184,6 @@ pub fn visual_block_motion(
|
||||||
|
|
||||||
let positions = if is_reversed {
|
let positions = if is_reversed {
|
||||||
head_x..tail_x
|
head_x..tail_x
|
||||||
} else if head_x == tail_x {
|
|
||||||
map.x_for_point(movement::saturating_left(map, tail), &text_layout_details)..head_x
|
|
||||||
} else {
|
} else {
|
||||||
tail_x..head_x
|
tail_x..head_x
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue