Skip to content

Commit 78ee546

Browse files
committed
Re-link
Lints More lints Clippy More More clippy Fmt More doc work More clippy More
1 parent c0c3da1 commit 78ee546

File tree

17 files changed

+228
-205
lines changed

17 files changed

+228
-205
lines changed

crates/bevy_ecs/src/system/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ use super::{Res, ResMut, SystemState};
106106
///
107107
/// The implementor must ensure that the state returned
108108
/// from [`SystemParamBuilder::build`] is valid for `P`.
109-
/// Note that the exact safety requiremensts depend on the implementation of [`SystemParam`],
109+
/// Note that the exact safety requirements depend on the implementation of [`SystemParam`],
110110
/// so if `Self` is not a local type then you must call [`SystemParam::init_state`]
111111
/// or another [`SystemParamBuilder::build`].
112112
pub unsafe trait SystemParamBuilder<P: SystemParam>: Sized {

crates/bevy_text/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ keywords = ["bevy"]
1010

1111
[features]
1212
default_font = []
13+
serde = []
1314

1415
[dependencies]
1516
# bevy

crates/bevy_text/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ mod pipeline;
4242
mod text;
4343
mod text2d;
4444
mod text_access;
45+
pub mod undo_2;
4546

4647
use bevy_camera::{visibility::VisibilitySystems, CameraUpdateSystems};
4748
pub use bounds::*;

crates/bevy_text/src/undo_2/README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Undo done the right way!
1+
# Undo done the right way
22

3-
Via https://gitlab.com/okannen/undo_2/-/tree/b32c34edb2c15c266b946f0d82188624f3aa3fdc
3+
Via [original](https://gitlab.com/okannen/undo_2/-/tree/b32c34edb2c15c266b946f0d82188624f3aa3fdc)
44

55
## Introduction
66

@@ -10,34 +10,33 @@ end of the Undo history as a precursor to your new change. I found the idea in
1010
[zaboople/klong][zaboople]. This crate is an implementation
1111
of this idea with a minor variation explained below.
1212

13-
As an example consider the following sequence of commands:
13+
As an example consider the following sequence of commands:
1414

1515
| Command | State |
1616
| ------- | ----- |
17-
| Init | |
17+
| Init | |
1818
| Do A | A |
1919
| Do B | A, B |
20-
| Undo | A |
21-
| Do C | A, C |
20+
| Undo | A |
21+
| Do C | A, C |
2222

23-
With the **classical undo**, repeated undo would lead to the sequence:
23+
With the **classical undo**, repeated undo would lead to the sequence:
2424

2525
| Command | State |
2626
|---------|-------|
2727
| | A, C |
2828
| Undo | A |
29-
| Undo | |
30-
29+
| Undo | |
3130

32-
Starting from 5, with **undo_2**, repeating undo would lead to the sequence:
31+
Starting from 5, with **undo_2**, repeating undo would lead to the sequence:
3332

3433
| Command | State |
3534
|---------|-------|
3635
| | A, C |
3736
| Undo | A |
38-
| Undo | A,B |
39-
| Undo | A |
40-
| Undo | |
37+
| Undo | A,B |
38+
| Undo | A |
39+
| Undo | |
4140

4241
**undo_2**'s undo navigates back in history, while classical undo navigates back
4342
through the sequence of command that builds the state.
@@ -53,11 +52,11 @@ and it is similar to vim :earlier.
5352
4. very lightweight, dumb and simple.
5453
5. possibility to merge and splice commands.
5554

56-
## How to use it
55+
## How to use it
5756

5857
Add the dependency to the cargo file:
5958

60-
```[toml]
59+
```toml
6160
[dependencies]
6261
undo_2 = "0.1"
6362
```
@@ -74,7 +73,7 @@ be interpreted by the application. This design pattern makes implementation
7473
easier because it is not necessary to borrow data within the stored list of
7574
commands.
7675

77-
```
76+
```rs
7877
use undo_2::{Commands,Action};
7978
use Action::{Do,Undo};
8079

@@ -156,22 +155,22 @@ assert_eq!(editor.text, "a");
156155
forming the sequence are merged. This makes the traversal of the undo
157156
sequence more concise by avoiding state duplication.
158157

159-
| Command | State | Comment |
158+
| Command | State | Comment |
160159
|---------|------- |----------------------|
161-
| Init | | |
160+
| Init | | |
162161
| Do A | A | |
163162
| Do B | A,B | |
164163
| Do C | A, B, C | |
165-
| Undo | A, B |Merged |
166-
| Undo | A |Merged |
167-
| Do D | A, D | |
164+
| Undo | A, B |Merged |
165+
| Undo | A |Merged |
166+
| Do D | A, D | |
168167
| Undo | A |Redo the 2 Merged Undo|
169-
| Undo | A, B, C | |
170-
| Undo | A, B | |
171-
| Undo | A | |
172-
| Undo | | |
168+
| Undo | A, B, C | |
169+
| Undo | A, B | |
170+
| Undo | A | |
171+
| Undo | | |
173172

174-
2. Each execution of an undos or redo may lead to the execution of a sequence of
173+
1. Each execution of an undos or redo may lead to the execution of a sequence of
175174
actions in the form `Undo(a)+Do(b)+Do(c)`. Basic arithmetic is implemented
176175
assuming that `Do(a)+Undo(a)` is equivalent to not doing anything (here the
177176
2 `a`'s designate the same entity, not to equal objects).
@@ -249,13 +248,14 @@ assert_eq!(editor.text, "az12");
249248
```
250249

251250
## Release note
251+
252252
### Version 0.3
253-
- [Action] is now an enum taking commands, the list of command to be
254-
executed is of the form [Action<T>];
255-
- added [Commands::can_undo] and [Commands::can_redo];
256-
- added [Commands::rebuild], which correspond to the classical redo;
257-
- fixed a bug in [Commands::undo_or_redo_to_index]
258-
- Added support for special commands that represent a state setting. See [SetOrTransition].
259253

260-
[zaboople]: https://github.com/zaboople/klonk/blob/master/TheGURQ.md
254+
- [`Action`] is now an enum taking commands, the list of command to be
255+
executed is of the form [`Action<T>`];
256+
- added [`Commands::can_undo`] and [`Commands::can_redo`];
257+
- added [`Commands::rebuild`], which correspond to the classical redo;
258+
- fixed a bug in [`Commands::undo_or_redo_to_index`]
259+
- Added support for special commands that represent a state setting. See [`SetOrTransition`].
261260

261+
[zaboople]: https://github.com/zaboople/klonk/blob/master/TheGURQ.md

0 commit comments

Comments
 (0)