refactor: Remove G/Z Namespace support
This previously enabled things like `d g g` to work, but we can fix that instead by not clearing out pending vim state on change. Either way, it is unnecessary and causes some user-confusion (zed-industries/community#176), so remove this code for now; and use comments to organize the file a bit instead.
This commit is contained in:
@@ -107,7 +107,7 @@ pub fn normal_motion(
|
||||
Some(Operator::Delete) => delete_motion(vim, motion, times, cx),
|
||||
Some(Operator::Yank) => yank_motion(vim, motion, times, cx),
|
||||
Some(operator) => {
|
||||
// Can't do anything for text objects or namespace operators. Ignoring
|
||||
// Can't do anything for text objects, Ignoring
|
||||
error!("Unexpected normal mode motion operator: {:?}", operator)
|
||||
}
|
||||
}
|
||||
@@ -441,11 +441,8 @@ mod test {
|
||||
use indoc::indoc;
|
||||
|
||||
use crate::{
|
||||
state::{
|
||||
Mode::{self, *},
|
||||
Namespace, Operator,
|
||||
},
|
||||
test::{ExemptionFeatures, NeovimBackedTestContext, VimTestContext},
|
||||
state::Mode::{self, *},
|
||||
test::{ExemptionFeatures, NeovimBackedTestContext},
|
||||
};
|
||||
|
||||
#[gpui::test]
|
||||
@@ -610,22 +607,6 @@ mod test {
|
||||
.await;
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_g_prefix_and_abort(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = VimTestContext::new(cx, true).await;
|
||||
|
||||
// Can abort with escape to get back to normal mode
|
||||
cx.simulate_keystroke("g");
|
||||
assert_eq!(cx.mode(), Normal);
|
||||
assert_eq!(
|
||||
cx.active_operator(),
|
||||
Some(Operator::Namespace(Namespace::G))
|
||||
);
|
||||
cx.simulate_keystroke("escape");
|
||||
assert_eq!(cx.mode(), Normal);
|
||||
assert_eq!(cx.active_operator(), None);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_gg(cx: &mut gpui::TestAppContext) {
|
||||
let mut cx = NeovimBackedTestContext::new(cx).await;
|
||||
|
||||
Reference in New Issue
Block a user