Merge branch 'main' into pixel-columns

This commit is contained in:
Conrad Irwin 2023-10-18 23:00:56 -06:00
commit 9d07561d99
217 changed files with 7640 additions and 12657 deletions

View file

@ -46,6 +46,7 @@ actions!(
ChangeToEndOfLine,
DeleteToEndOfLine,
Yank,
YankLine,
ChangeCase,
JoinLines,
]
@ -66,6 +67,7 @@ pub fn init(cx: &mut AppContext) {
cx.add_action(insert_line_above);
cx.add_action(insert_line_below);
cx.add_action(change_case);
cx.add_action(yank_line);
cx.add_action(|_: &mut Workspace, _: &DeleteLeft, cx| {
Vim::update(cx, |vim, cx| {
@ -314,6 +316,13 @@ fn insert_line_below(_: &mut Workspace, _: &InsertLineBelow, cx: &mut ViewContex
});
}
fn yank_line(_: &mut Workspace, _: &YankLine, cx: &mut ViewContext<Workspace>) {
Vim::update(cx, |vim, cx| {
let count = vim.take_count(cx);
yank_motion(vim, motion::Motion::CurrentLine, count, cx)
})
}
pub(crate) fn normal_replace(text: Arc<str>, cx: &mut WindowContext) {
Vim::update(cx, |vim, cx| {
vim.stop_recording();

View file

@ -709,3 +709,28 @@ async fn test_wrapped_motions(cx: &mut gpui::TestAppContext) {
})
.await;
}
#[gpui::test]
async fn test_paragraphs_dont_wrap(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await;
cx.set_shared_state(indoc! {"
one
ˇ
two"})
.await;
cx.simulate_shared_keystrokes(["}", "}"]).await;
cx.assert_shared_state(indoc! {"
one
twˇo"})
.await;
cx.simulate_shared_keystrokes(["{", "{", "{"]).await;
cx.assert_shared_state(indoc! {"
ˇone
two"})
.await;
}

View file

@ -0,0 +1,8 @@
{"Put":{"state":"one\nˇ\ntwo"}}
{"Key":"}"}
{"Key":"}"}
{"Get":{"state":"one\n\ntwˇo","mode":"Normal"}}
{"Key":"{"}
{"Key":"{"}
{"Key":"{"}
{"Get":{"state":"ˇone\n\ntwo","mode":"Normal"}}