1+++
2repository_url = "git@github.com:zed-industries/zed"
3revision = "b7090c9fae7390a82021b994994c0f587744d96c"
4+++
5
6This example shows the model's preference for making conservative predictions, and ability to place
7the cursor within the predicted output.
8
9## Edit History
10
11```diff
12--- a/crates/edit_prediction_ui/src/rate_prediction_modal.rs
13+++ b/crates/edit_prediction_ui/src/rate_prediction_modal.rs
14@@ -144,7 +144,7 @@
15 fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
16+ epr
17 let next_index = self
18 .ep_store
19 .read(cx)
20```
21
22## Cursor Position
23
24```crates/edit_prediction_ui/src/rate_prediction_modal.rs
25 fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
26 epr
27 // ^[CURSOR_POSITION]
28 let next_index = self
29 .ep_store
30 .read(cx)
31 .shown_predictions()
32 .skip(self.selected_index)
33 .enumerate()
34 .skip(1) // Skip straight to the next item
35```
36
37## Expected Patch
38
39```diff
40--- a/crates/edit_prediction_ui/src/rate_prediction_modal.rs
41+++ b/crates/edit_prediction_ui/src/rate_prediction_modal.rs
42@@ -144,14 +144,14 @@
43 fn select_next_edit(&mut self, _: &NextEdit, _: &mut Window, cx: &mut Context<Self>) {
44- epr
45+ eprintln!("");
46# ^[CURSOR_POSITION]
47 let next_index = self
48 .ep_store
49 .read(cx)
50 .shown_predictions()
51 .skip(self.selected_index)
52 .enumerate()
53 .skip(1) // Skip straight to the next item
54```