Commit d5ef35f
authored
Force Break Undo Groups When Forcing Grouping (#81)
### Description
Forces the undo manager to start a new undo group after calling `startUndoGrouping` or `endUndoGrouping`.
This fixes a case where two groups could accidentally be combined. For instance when dragging text and then dragging it back into the same spot. Previously that operation would result in the following undo grouping:
After first drag:
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
```
After dragging back to the original location:
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
- {0,8} "" // Removed text
Group 3:
- {0, 0} "DragText" // Inserted text
```
When it *should* have looked like the following after the second drag back to the original position.
```
Group 1:
- {0,8} "" // Removed text
Group 2:
- {0, 0} "DragText" // Inserted text
Group 3:
- {0,8} "" // Removed text
Group 4:
- {0, 0} "DragText" // Inserted text
```
### Related Issues
* N/A
### Checklist
<!--- Add things that are not yet implemented above -->
- [x] I read and understood the [contributing guide](https://github.com/CodeEditApp/CodeEdit/blob/main/CONTRIBUTING.md) as well as the [code of conduct](https://github.com/CodeEditApp/CodeEdit/blob/main/CODE_OF_CONDUCT.md)
- [x] The issues this PR addresses are related to each other
- [x] My changes generate no new warnings
- [x] My code builds and runs on my machine
- [x] My changes are all related to the related issue above
- [x] I documented my code
### Screenshots
N/A1 parent 82bc832 commit d5ef35f
1 file changed
+20
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
| |||
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
163 | 171 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 172 | + | |
| 173 | + | |
167 | 174 | | |
168 | | - | |
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| |||
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
| 187 | + | |
| 188 | + | |
181 | 189 | | |
182 | 190 | | |
183 | 191 | | |
| |||
187 | 195 | | |
188 | 196 | | |
189 | 197 | | |
| 198 | + | |
| 199 | + | |
190 | 200 | | |
191 | 201 | | |
192 | 202 | | |
| |||
0 commit comments