Avoid panic from assuming a vim operator exists on the operator stack
This commit is contained in:
parent
0b6155609d
commit
243a1a854e
1 changed files with 3 additions and 1 deletions
|
@ -58,7 +58,9 @@ pub fn visual_motion(motion: Motion, times: Option<usize>, cx: &mut WindowContex
|
||||||
|
|
||||||
pub fn visual_object(object: Object, cx: &mut WindowContext) {
|
pub fn visual_object(object: Object, cx: &mut WindowContext) {
|
||||||
Vim::update(cx, |vim, cx| {
|
Vim::update(cx, |vim, cx| {
|
||||||
if let Operator::Object { around } = vim.pop_operator(cx) {
|
if let Some(Operator::Object { around }) = vim.active_operator() {
|
||||||
|
vim.pop_operator(cx);
|
||||||
|
|
||||||
vim.update_active_editor(cx, |editor, cx| {
|
vim.update_active_editor(cx, |editor, cx| {
|
||||||
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
|
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {
|
||||||
s.move_with(|map, selection| {
|
s.move_with(|map, selection| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue